change attribute when selfposition is the same

minimaxminimax Member Posts: 24
edited December 2011 in Working with GS (Mac)
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

Comments

  • CloudsClouds Member Posts: 1,599
    edited December 2011
    Make an attribute that stores the actors initial position (let's call it STARTING STATE).

    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).

  • minimaxminimax Member Posts: 24
    Hi Tynan,

    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....
  • App SurgeApp Surge Member Posts: 651
    create a timer that says for five seconds then put in a rule that says when self linear velocity y = 0 and self linear velocity x = 0 change attribute to ??

    Just thinking aloud there
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi minimax, redsky's and Tynan's ideas are good; here another:

    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

  • MotherHooseMotherHoose Member Posts: 2,456
    I do not know what event you are using to move the actor …

    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
  • CloudsClouds Member Posts: 1,599
    Try something like this:

    image
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    ...............Sorry Tynan, I can't hold my breath much longer............. ;-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • minimaxminimax Member Posts: 24
    Hi redsky,

    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.....
  • CloudsClouds Member Posts: 1,599
    gyroscope "...............Sorry Tynan, I can't hold my breath much longer............. ;-)"

    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
  • MotherHooseMotherHoose Member Posts: 2,456
    @minimax
    Does the timer actually read For 5 seconds ??
    should be After 5 seconds

    MH
  • minimaxminimax Member Posts: 24
    Hi everybody,

    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(
Sign In or Register to comment.