Spawning error and about HP.

Hi, GS dudes.
I made some characters which are displayed around 30 at once on the screen, but there are 2 problems.
First, I used random spawning behavior to spawn charcters watching Tshirtbooth's instruction video. But the spawn actor spawns only some characters and stop to spawn. When I watched the video, it spawned consistantly, but my one did only once. I have tried to figure it out, but failed. I don't know what I have done wrong.
Second, the characters must have their each HP bar, but when the first character is attacked and HP become zero, the other character's HP bar also become zero at same time.
How can I figure them out?
I made some characters which are displayed around 30 at once on the screen, but there are 2 problems.
First, I used random spawning behavior to spawn charcters watching Tshirtbooth's instruction video. But the spawn actor spawns only some characters and stop to spawn. When I watched the video, it spawned consistantly, but my one did only once. I have tried to figure it out, but failed. I don't know what I have done wrong.
Second, the characters must have their each HP bar, but when the first character is attacked and HP become zero, the other character's HP bar also become zero at same time.
How can I figure them out?
Best Answers
-
matthewsuttles Posts: 42
This might sound like a stupid suggestion. But are the characters HPs on the same attribute.
I also had some problems with spawning for my game. Try removing the spawn rule entirely and place it back. This might fix the problem. It did for me. -
matthewsuttles Posts: 42
Photobucket is a free website that will allow you to make an account and post pictures. You can then post these pictures to the forum to allow everyone to see what you have coded to help out.
I agree with John but then you would need a attribute inside of an actor.
Go to your actor
In the attributes area where your position and size are make an attribute as an integer and name it Health or what ever you want. This is a self attribute.
Then create a rule that states when the actor receives overlap or collision with "your enemy" then to change the self heath attribute to heath attribute minus 1 or what ever you would like.
It will look like this in the code window for the player actor.
If actor receives event overlap or collides with actor "enemy"
Change Attribute self.health to self.health-1
If self.health is less than or equal to 0 then
"Change scene or whatever you want the game to do when the players health is 0"
Hope this helps!
Answers