Can you put attributes in an actor and....

GAMEINTERNGAMEINTERN PRO Posts: 56
edited April 2012 in Working with GS (Mac)
Can you put attributes in a actor ( PLAYER ) and have it say:

when attribute "Player" collides with Actor "T"
Change Attibute T to Attribute T +1

when attribute "Player" collides with Actor "R"
Change Attibute R to Attribute R +1

when attribute "Player" collides with Actor "E"
Change Attibute E to Attribute E +2


when attribute "T" = 1 and

when attribute "R" = 1 and

when attribute "E" = 2

Change Scene to Next Level.


My Player has all the Attributes ( A through Z ) and I dont seem to see why it wont take it to the next scene.

Any help on this would be super!
I hope I make sense here, Im still learning.

Thanks All :)

Best Answer

  • tatiangtatiang Posts: 11,949
    edited April 2012 Accepted Answer
    You have rules that say if the actor collides with R, change t to t+1; if the actor collides with E, change t to t+1. I don't think that's what you meant to do.

Answers

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    All the attributes you wish to access by other actors must be game attributes and not self.

    So when actor player collides with actor T
    Change game.attribute T to 1

    When actor player collides with actor R
    Change game.attribute R to 1

    Then you would be best off having a level rules actor just offscreen that has the rule that when game attributes T, R and E = the values you wish, then change scene.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2012
    Yes, you can. As to why it won't work, I'm not sure. It could be that your player actor is colliding multiple times with your letter actors. To figure this out, create a new actor with a Display Text behavior and then concatenate the values of your attributes together: self.T..self.R..self.E

    Watch as you preview your game to see if that actor has the value 000 initially and then 112 after colliding with the player. If it is displaying 536 or something, you know your collision rules aren't working properly.
  • GAMEINTERNGAMEINTERN PRO Posts: 56
    Okay, the result when Placing a Display Text on my PLAYER ACTOR:

    Kinda wired cause it displayed 0 then when it collides into a letter (Say "T") it goes to 1 but if it then collides into say the "R" then it goes to 2 instead of each letter having its own value.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    What attribute type are you using. It should be integer.
  • GAMEINTERNGAMEINTERN PRO Posts: 56
    Hi scitunes, yes I am using integer
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Can you post a screenshot of your player's rules?
  • GAMEINTERNGAMEINTERN PRO Posts: 56
    Sure! How do you take a screenshot on a MAC?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    command+shift+3
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    To post an image to the forums, use this code:

    image
  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    its cause your rules say is = to

    it probably needs to say is >or= to

    cause if it collided more then once you change to next scene rule is not lounger valid
  • GAMEINTERNGAMEINTERN PRO Posts: 56
    Duh of course, let me change that. I knew I was just over looking something. I will confirm...just a moment.
  • GAMEINTERNGAMEINTERN PRO Posts: 56
    Okay that fixed that issue, how do I simply have it to stop adding to the count once it reaches the desired value?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2012
    Make a rule When ALL conditions are valid ... self.t<1 AND actor collides with actor T ... change attribute self.t to self.t+1.
  • GAMEINTERNGAMEINTERN PRO Posts: 56
    perfect! thanks.
Sign In or Register to comment.