Spawning error and about HP.

gawakamygawakamy Member Posts: 109
edited April 2012 in Working with GS (Mac)
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?

Best Answers

  • matthewsuttlesmatthewsuttles Posts: 42
    Accepted Answer
    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.
  • matthewsuttlesmatthewsuttles Posts: 42
    Accepted Answer
    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

  • matthewsuttlesmatthewsuttles Member Posts: 42
    I also suggest making a photobucket account and taking screenshots of your actor rules and post them. This might help diagnose the problem.
  • gawakamygawakamy Member Posts: 109
    @matthewsuttles Ye, I think the characters' HPs on the same attribute. Then do I have to make them separately? And what is phtobucket? It sounds like a web site for photos. Thanks, I'll try it now except photobucket.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Make the HP attribute a self attribute in the actor, and not a game attribute.
  • gawakamygawakamy Member Posts: 109
    @JohnPapiomitis Hi, John. I even don't know what different is between self attribute and game attribute. How can I compare them?
  • gawakamygawakamy Member Posts: 109
    Thanks, all. I could figure it out. :)
Sign In or Register to comment.