In need > Magnitude reset?

AjBlueAjBlue Member Posts: 215
edited November -1 in Working with GS (Mac)
i have 1 actor moving to the right and one to the left, once they have reached a magnitude of 40 or so. i want the to stop (since this is basically right in front of each other) but then they do not continue their course anymore because the magnitude doesn't change from last time the enemy was seen.

how can i set up my scene to make my actors magnitude to say 1000 if there is no target enemy on the scene.

i can't make it back to 0 because my stop rule says if the magnitude is less than say 40 stop, 0 is still less than 40 so i need to make it a number that can't possibly be touched.

Comments

  • hrsmediahrsmedia Member Posts: 522
    Maybe you could do,
    if Magnitude <40 then Move = (actor speed) , otherwise move = 0

    or if u don't want to use otherwise, you could do 2 rules,
    rule 1 = if Magnitude <40 then Move = (actor speed)
    rule 2 = if Magnitude >40 then Move = 0

    hope that helps..
  • AjBlueAjBlue Member Posts: 215
    that doesn't work as explained once actor is destroyed the magnitude doesn't change so if its destroyed at 38.2 the magnitude doesn't change. im running a display text on my actors saying its magnitude distance
  • AjBlueAjBlue Member Posts: 215
    im trying to convert my actors of screen recycling, and hopefully i will find a way to make it work
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    did you try reseting the magnitude attibute when the actors destroyed?
  • AjBlueAjBlue Member Posts: 215
    is there a way to have an attribute recognize if an actor is inside the screen space, for example my space is h320xw960. if i were to put the actor at h360xw1000. make an attribute false, and add that into the magnitude rule, so it can only work if the enemy is on the screen
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yeah you can do that . Or to do it without the extra actor you could have when self position x is greater then 100 and actor self position x is less then 500 do whatever, and have all conditions valid. Then when the actor is inbetween those positions itll do what you want. Youll have to play around with the 100 and 500 number. Inbetween that is the zone at which the actor will perfrom the behavior
Sign In or Register to comment.