Page 1 of 1

Cloning Q's

PostPosted: Tue May 08, 2007 11:00 pm
by Oman
I have a enemy that shoots bullets. When the bullets hit the player it sends an Activation event to my health. the activation event tells my health bar to [animpos -- ;] lower one animation.

However the enemy creates the bullet on a timer. every 1 second or so it creates a bullet. When my player hits the first bullet my health lowers correctly. But when i hit the 2nd, 3rd, 4th... bullet it doesnt lower. When i check the activation event, it says it only works on bullet.0,

does every bullet created count as a new clone?
If so, how do i get my activation event to activate on every bullet instead of just bullet.0

PostPosted: Tue May 08, 2007 11:35 pm
by d-soldier
What send the activation event? Is it the player (on collision), or the bullet (on collision). I dont think clones cary the same activation event line as the master actor. If you have an activation event from the player (on collision with bullet) to the healthbar, that should be fine... not the bullet.

PostPosted: Wed May 09, 2007 2:06 am
by Sgt. Sparky
d-soldier wrote:What send the activation event? Is it the player (on collision), or the bullet (on collision). I dont think clones cary the same activation event line as the master actor. If you have an activation event from the player (on collision with bullet) to the healthbar, that should be fine... not the bullet.

there is no need to use activation events at all,
just use a global variable. :)

Re: Cloning Q's

PostPosted: Wed May 09, 2007 2:34 am
by Caaz Games
Oman wrote:I have a enemy that shoots bullets. When the bullets hit the player it sends an Activation event to my health. the activation event tells my health bar to [animpos -- ;] lower one animation.

However the enemy creates the bullet on a timer. every 1 second or so it creates a bullet. When my player hits the first bullet my health lowers correctly. But when i hit the 2nd, 3rd, 4th... bullet it doesnt lower. When i check the activation event, it says it only works on bullet.0,

does every bullet created count as a new clone?
If so, how do i get my activation event to activate on every bullet instead of just bullet.0
I wouldn't use activation events, or global thingy. i would use my way , i forgot the link so type the words in the search "Easy Way To Make A Health Bar"

PostPosted: Thu May 10, 2007 12:23 am
by Oman
The bullet sends the activation event.

I will try all ur ideas now. :)

PostPosted: Thu May 10, 2007 12:29 am
by Oman
kk. i used caaz's way... i didnt know you could do

health.animpos -- ;

Thx for all ur ideas :D

PostPosted: Thu May 10, 2007 4:19 am
by Caaz Games
you can use an actors name before any variable to make that actor do what ever the variable, like this
Code: Select all
Player.animpos++;
and all kinds of stuff

PostPosted: Thu May 10, 2007 4:25 am
by Sgt. Sparky
__CAAZ__ wrote:you can use an actors name before any variable to make that actor do what ever the variable, like this
Code: Select all
Player.animpos++;
and all kinds of stuff

not just ++ and --,
but += whatever number or value. :D
(-= *= and /= to!)