Health Bars?

pinata14pinata14 Member Posts: 150
edited April 2012 in Working with GS (Mac)
hey, i was wondering if there was a practical way for making a health bar for an enemy. The conditions im doing this under is that there must be a separate health bar for every enemy, or for every instance of the same actor. I was thinking of using particles but it doesn't work well at all. anybody have an idea how to make unique health bars for each instance that is on scene/spawned onto scene?
Thanks,
Ryan

Answers

  • App SurgeApp Surge Member Posts: 651
  • pinata14pinata14 Member Posts: 150
    Sorry but this isnt what I need @redsky, I need it to work for multiple instances so that each enemy will have its own health bar without prespawning everything
  • App SurgeApp Surge Member Posts: 651
    Instead of game attributes use self attributes. Then it will work for instances.
  • pinata14pinata14 Member Posts: 150
    @redsky the health attribute is already set. I just need to find a way to make a visible "health bar" to let players know how they are doing against the enemies. I was wondering if there was a way to do this for every enemy without having to make separate health bar instances for every enemy instance, also maybe to have a way to spawn a health bar for each instance that gets spawned during gameplay.
  • cstultscstults Member Posts: 3
    I too would also like to figure this out. I'm in the process of developing a tower defense game and i'm trying to figure out all the behaviors and what not before i start the game. Can't quite figure this one out i'll be following your post pinata14, hope this gets figured out.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2012
    @pinata14 Is there a reason you can't have each instance spawn a health bar relative to the actor's position and then in the health bar have a replicate behavior or a constrain width behavior to determine the length?

    Oops, I see the error of my ways. The trick is getting the self.lives value from the enemy actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • pinata14pinata14 Member Posts: 150
    if im not mistaken, it is impossible to do this as of now. i guess we just wait for writable tables and hopefully we can do something like
    change table(enemy index,1,self.index) to self.health
    and on the health bar
    change width to (table(enemy index,1,self.index))/max health*bar length
    then we just make a ridiculous amount of columns so the table will be almost unlimited
    when are writable tables scheduled to come out?
    @tshirtbooth @mynameisace any thoughts on how to make this work without tables/if my table idea will work?
    Thanks,
    Ryan
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Without writeable tables it's not impossible, but not overly performance-friendly either.

    How many enemies will the maximum be that you're having on screen at any one time?

    Writeable tables won't be too long, so might be worth the wait.

    Ace
  • pinata14pinata14 Member Posts: 150
    edited April 2012
    @mynameisace
    im not sure how many enemies i will have yet because i have to make the enemies before i make the levels right? is the way you are talking about something you can just put a rule in the prototype and it will work for each individual instance? Also, this game is something i chose to do for a project in school and it is due in 5 weeks. Do you think writable tables will be out in time to finish the game... Pretty much all that is left is making the enemies and designing the level layouts.
    Thanks for all the great tips all the time,
    Ryan
  • pinata14pinata14 Member Posts: 150
    @mynameisace
    any answers to my previous question?
    thanks
  • pinata14pinata14 Member Posts: 150
    sorry for the bump, but i need to know my limits before i can continue working. thanks
    @mynameisace
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Sorry, only just seen this post.

    You can always go ahead and design the levels then add in your enemies at the end.

    Well, all I know is that we (sous's) don't have the build yet and it's normally released a couple of weeks after we get it (although when we get it my NDA says I can't tell people that we have it) so it may be out in time, but also might not.

    I'd design the levels and see if we have the build when you've completed it.

    Ace
Sign In or Register to comment.