Scene change - saving positions
stemarthe
Member Posts: 4
Hi! this is my first post!
I had a couple of questions and searching the forums and reading what you guys have to say is really helpfull...
But I need some help on this one.
How does the rules in an actor compile? I mean, does GS read the rules from top to bottom as is you were in a code? Can I for example have 2 fixed rules such as
change attribute to something
change attribute to something
have an if event
resolve the if event
in other words, when the scene is loaded and the actor is spawned, will it change the attributes and then check the if statement?
Furthermore, when I was trying this, it kindda seemed to work as such as I had an actor with an initial position, a button to move that actor, another button to change scene.
When I click to move actor a couple of times, then click the change scene, and then click a change scene on that new scene to come back to original scene, the actor had the previous to last position and not the last...
What I did was have the actor save it x,y position, if mouse down and inside move a distance. Once moved, save new x,y position
In turn when you load it should load the very last position but did not. In fact loaded the before last position witch is kinda weird.
Also, i was reading here about memory leaking when changing scenes...is this a real problem and if so, have something like Im trying to do, changing scenes back and forth might cause some big problems in the end?
Thanks for the help guys!
back to GS now!
I had a couple of questions and searching the forums and reading what you guys have to say is really helpfull...
But I need some help on this one.
How does the rules in an actor compile? I mean, does GS read the rules from top to bottom as is you were in a code? Can I for example have 2 fixed rules such as
change attribute to something
change attribute to something
have an if event
resolve the if event
in other words, when the scene is loaded and the actor is spawned, will it change the attributes and then check the if statement?
Furthermore, when I was trying this, it kindda seemed to work as such as I had an actor with an initial position, a button to move that actor, another button to change scene.
When I click to move actor a couple of times, then click the change scene, and then click a change scene on that new scene to come back to original scene, the actor had the previous to last position and not the last...
What I did was have the actor save it x,y position, if mouse down and inside move a distance. Once moved, save new x,y position
In turn when you load it should load the very last position but did not. In fact loaded the before last position witch is kinda weird.
Also, i was reading here about memory leaking when changing scenes...is this a real problem and if so, have something like Im trying to do, changing scenes back and forth might cause some big problems in the end?
Thanks for the help guys!
back to GS now!
Comments
Hope i've been of some help!
:-\
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Here is what I was trying to do. I have a ship actor.
The ship movements are in this ship actor.
So I want to have the ship load its last known position.
Then go into the if statement that makes the ship move, and once move update this new position. So when I change scene and come back it will enter as the last known location of actor.
So...
ive got a change attribute to x and y positions from some game attribute
then I got to the movement and once moved send its new location to the game attribute I created. As for this, does this also mean on the device I wont have any problems going back and forth from and to a scene or will the user have to reboot after a while?
Thanks again guys!