Respawn after destroy doesn't reset the attributes? @CodeMonkey , @Photics

POMPOM Member Posts: 2,599
edited November -1 in Working with GS (Mac)
Hey guys
Ok so this is the case:
I have an actor with boolean attributes set to false by default , then they go to true by touch , then destroy, then actor "manager" spawn the same actor just destroyed, BUT
i use display text to display the attributes,
and they are starting at TRUE in the spawned actor. (the prototype is all "false" )
Am i doing something wrong or is it a bug?

I hope you understand what im trying to say here..

EDIT:
I just saw CodeMonkey's template Swiching YO YO, and in the actor he put a rule:
Reset (change) SELF attribute to false and then destroy.

@CodeMonkey why do you reset the SELF.attribute if you destroy the actor?!

i didnt know i should do it!! and im using gamesalad for a year!

@Photics do you have this info and its kind in your book?!

Comments

  • PhoticsPhotics Member Posts: 4,172
    p-o-m said:
    @Photics do you have this info and its kind in your book?!

    I'm not sure if The Unofficial GameSalad Textbook addresses this issue, because I'm not exactly sure what the issue is.

    The book does cover the difference between Actor, Scene and Game attributes. Is that the issue? Was this about confusion between the different types of attributes?
  • MotherHooseMotherHoose Member Posts: 2,456
    @p-o-m

    all attribute changes must occur before the actor is destroyed.
    logically, once an actor is destroyed... the actor will not be able to alter/affect the game play.

    therefore: change the boolean to false just before the destroy behavior... as in CodeMonkey's template.

    MH
  • POMPOM Member Posts: 2,599
    Ok i think i did not explained the issue good enough.. let me try again :

    i have an actor "ball" , it has a self.attribute ("initiate") boolean set to false as default.
    If i press the ball the attribute ("initiate") becomes true, in the actor there are sets of rules
    ********************
    When "initiate" is true
    do this
    do this
    do this
    destroy.
    *******************

    Then after 10 seconds a "manager" actor spawns the actor "ball" again
    but this time its attribute ("initiate") is set to true, although i did not pressed it yet!

    But the prototype default is set to false, so why the spawned actor comes with true?

    EDIT :
    I can also ask this in other way:
    when i have an actor in the scene, and its attributes (self) changes during gameplay, does those changes apply to the prototype as well? so if i now spawn that actor should i expect it to come with the changes that made?
  • PhoticsPhotics Member Posts: 4,172
    p-o-m said:
    But the prototype default is set to false, so why the spawned actor comes with true?

    I don't know. It might be a bug. The remedy seems simple... just put a Change Attribute at the top, setting the value to false.
  • POMPOM Member Posts: 2,599
    @Photics

    HAHA... its not that simple, im talking about a lot of actors.... a lot , thank you for your time.
    oh well.. to work then.

    By the way:
    how do you make those special links at the forum? what is the code?
  • MotherHooseMotherHoose Member Posts: 2,456
    Roy...I sent you an email.

    think the big issue is to have the attributes on the individual actors rather than as gameAttributes.

    MH
  • Rob2Rob2 Member Posts: 2,402
  • POMPOM Member Posts: 2,599
    @MH
    Got the email, im applying the changes right now to the game, many thanks!
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    On the yo-yo project, the spawned actor instances use an actor attribute to control their own movement. If you were to spawn several of them in short intervals, then they would all need to rely on their own attribute instead of sharing an attribute with others.
  • PhoticsPhotics Member Posts: 4,172
    p-o-m said:
    HAHA... its not that simple, im talking about a lot of actors.... a lot , thank you for your time.
    oh well.. to work then.

    Are you using a game/scene attributes instead of actor attributes? When you use actor attributes, the data is independent of others spawned from the same prototype.

    That's mentioned in the book.
    p-o-m said:
    By the way:
    how do you make those special links at the forum? what is the code?

    "I don't even see the code. All I see are blond, brunette, red-head."

    Heh... that's a line from the Matrix... the code is HTML.
Sign In or Register to comment.