Giving actors multiple attributes

I am trying to give an actor the following attributes; Hit Points, Damage, Exp Modifier to Damage and Ammo. Then when two actors with these attributes come together they will exchange damage until one is destroyed. Any suggestions?

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You need to make them game level attributes and have them exchange the values when they collide.
  • colandercolander Member Posts: 1,610
    Welcome to GameSalad. You could use a rule with a collision event condition. i.e. Actor receives event/overlaps or collides/actor of type/"Your other actor/s name/s". Use the Change Attribute action to modify the actors self attributes you mentioned. Have another rule inside this rule and use your self attributes as conditions for a Destroy action. Make sure you place a Collide behaviour in your actor above your rules.

    There are a lot of tutorials out there for just about everything. Search this forum and use Google. Also have a look at FBS's videos he has a lot of good tutorials on the basics and advanced topics.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You still need game level attributes as you can't read the self attributes of an actor from another actor.
  • GNPGNP Member Posts: 18
  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    edited January 2014
    @GNP From what i can see that template looks like it is full of copyrighted materials.
    Why are you posting it here?
    Edit: I saw this on 4 other threads too.
  • colandercolander Member Posts: 1,610
    FBS is right if you want to pass any info to another actor like a score actor then yes you will need to use game attributes or pass information to a game attribute at some point.

    Why not make all attributes game attributes? I did that in my first game and it was a pain scrolling through a huge list looking for attributes as I worked. This time I made any attribute that didn't need game level communication a self attribute and it cut the list down considerably. Also you can not change the list order of attributes which makes finding them even harder. I don't know for sure but I have read there is a higher performance over head for game attributes.

    Plan your game out as much as possible before you start coding it. It will save you a lot of time further down the development path.
Sign In or Register to comment.