Respawn after destroy doesn't reset the attributes? @CodeMonkey , @Photics
POM
Member Posts: 2,599
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?!
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
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?
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
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?
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?
think the big issue is to have the attributes on the individual actors rather than as gameAttributes.
MH
Got the email, im applying the changes right now to the game, many thanks!
That's mentioned in the book. "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.