change attribute when selfposition is the same

Hello there,
I want to create a rule in which an attribute will changed when the selfposition of an actor was not changed after a defined time.
The condition could be like `If for 5 seconds selfposition x/y was not changed than change attribute`....
Is it possible in gamesalad to create something like that?
thx,
Max
I want to create a rule in which an attribute will changed when the selfposition of an actor was not changed after a defined time.
The condition could be like `If for 5 seconds selfposition x/y was not changed than change attribute`....
Is it possible in gamesalad to create something like that?
thx,
Max
Comments
Change STARTING STATE to the actors position.
After a set amount of time check (using a timer set to 'after') if the actors position is > or < than the STARTING STATE (if so then change the attribute you want to change if t has moved).
thanks! But what I mean is to change an attribute if the selfposition was NOT changed after 5 seconds.
To concrete my problem:
Normally the actor have not a constantly selfposition like x= 500 and y= 700 or so.... The selfposition will changed in game everytime. But if the selfposition was not changed after 5 seconds (maybe only after 7 seconds...) the attribute of the actor will be changed....
Just thinking aloud there
Make an integer attribute called Timer set to 0,
put a Timer behavior: every 1 second,
change attribute Timer to Timer+1.
Rule When Timer >5
AND when Actor position.x = 500
AND when Actor position.y = 700,
then change your attribute.
Hope that helps out.
---------------------------------------------
http://davidgriffinapps.co.uk/
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I'll take-a-stab-at-it with Touch is pressed
the actor's X,Y are real attribute and will update with every event that changes them
so what you want to find out is if the user has done anything to change the X,Y
in your actorPrototype create 2 new real attributes:
currentX and currentY
in your touch is pressed rule (to drag the actor around)
-----
under Otherwise: add a newRule when touch is released
--changeAttribute: self.currentX to self.Position.X
--changeAttribute: self.currentY to self.Position.Y
--Timer After 5 seconds √Run to completion
--Rule when (All)
---Attribute: self.currentX = self.Position.X
---Attribute: self.currentY = self.Position.Y
do whatever you want
MH
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I´ve create an timer with the configuration `for 5 seconds´. In this ´time´-window I create a rule:
when self motion linear velocity x = 0 and y = 0 then destroy actor.
The result is the actor will instantly destroyed at the moment the game is beginning.....
There is a screen shot in my post, but they never show up properly ! (weeps into his coffee).
Here's the link: http://1.2.3.10/bmi/img717.imageshack.us/img717/8192/screenshot20111228at164.png
Does the timer actually read For 5 seconds ??
should be After 5 seconds
MH
thanks to all but the problem exists any longer. I´ve done it like motherhoose tolds but the timer-situation would not actualize after changing position. The result is after beginning the game the timer will start and after 5 seconds game-play including position-changing the actor is destroyed. :O(