advice on recycling actors?

pjnolenpjnolen Member Posts: 152
edited November -1 in Working with GS (Mac)
I have 2 actors off screen, when the stage starts they both move onto the screen, when they do that(overlap or collide with background image) their combat rules take effect.

When one dies, i have it reset it's hitpoints back to full and change it's x and y location back off screen. But instead of just waiting there(not being on top of the background and should not be doing anything) it still has the combat rules active and flys back onto the screen over and over. Even though it should just sit there.

Is there a better way of doing this?

Comments

  • pjnolenpjnolen Member Posts: 152
    I've watched the video on recycling, but the only thing it does is have them move offscreen and automatically come back on, i want to do the same thing except they need to stay off screen, until called again. how do i keep them offscreen?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi again pj; use a boolean as a switch. So the Rules of the off-screen actor, put When UseActor is true, then move it off-screen; otherwise move to x and y positions on-screen.

    So when another actor's Rules changes the boolean, the actor will change position accordingly.

    If the off-screen actor needs to be in different positions under different circumstances or different times, then make the attribute an integer; so Rules would include when UseActor = 0, 1, 2 or 3, etc then its position.

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

  • pjnolenpjnolen Member Posts: 152
    ok, this works halfway, i have an attribute called 'attack'. when it's set to true, it activates a bunch of stuff, like shoot at player, move towards player, etc. When it is set to false, i constrain the actor back offscreen, BUT it's still shooting and trying to move towards the player.

    How do I tell it to STOP doing all those 'true' things when set to false?

    Because just using 'true' as a condition doesn't work. Once it's set to true, even if it changes to false, the actor still continues to do all the things under the true condition.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Difficult to say what's going on there without seeing all of your Rules. Maybe try, instead of using "Otherwise", use another "When" Rule. So, straightforwardly:

    When attribute Attack is true
    --All your stuff--

    When attribute Attack is false
    Change x and y positions to move it off-screen

    If that doesn't work, you'll have to add into the When Attack is false, stuff to turn everything "off", if you see what I mean. I could help out there if I saw your actual Rules. (Although you shouldn't need to do that; the boolean switch should work; odd that it's not...) Anyhow, see how you go.

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

  • pjnolenpjnolen Member Posts: 152
    I'm trying the if true - this, if false - this, set of rules now, it's so damn frustrating because i've probably set this spawn up 20 different ways and one way or another it just isn't working for me. Even stuff that SHOULD work doesn't work.

    I can email you a screen shot of my rules, if you can help out. I did a test run inside a new project i created. when i turn on true, actor moves to a location, and shoots continuously.

    when i turn on false, it moves to a different position, and stops firing.

    For some reason, my rule to chase the player, even though it's inside the rule with a 'needs true condition', is ignoring the fact that it's set to false!

    can I get your email?
Sign In or Register to comment.