Suddenly- nothing

shaihaludshaihalud Member Posts: 34
edited November -1 in Working with GS (Mac)
Some of you may remember me- I've been working with gamesalad for a little over a year now but haven't been that active recently as I've had other things on my plate.

After starting a new game today, I am completely stumped as to why what I'm doing isn't working. In a nut shell:

Actor (ACT)
if RUN = 0
-change GO to random(1,6)
-change RUN = 1

if RUN = 1
- and GO = 1
-- and VAR1 < 15
--- accel to 1
-- else change RUN to 0

- and GO = 2
-- and VAR2 < 15
--- accel to 2
-- else change RUN to 0

etc.

So, basically, the actor is supposed to accel, randomly, to one of 6 locations (GO) UNLESS that someplace is 15 (or greater), on which case it should complete the loop (by setting RUN to 0 and etc). Unfortunately, while it does correctly change RUN back to 0, the RUN rule does not implement again.

Originally, I did without the RUN rule altogether and just said that it should choose a new GO, but that didn't work- so i figured i'd toss in a container rule and see if that worked. the only way i can get it to work is if it runs on a timer, which is something that i don't want to do, A because it is something else the game needs to keep track of, and B because it should NEVER need a timer to check if a rule is true or false or not. All attributes are integers (but that shouldn't matter, hopefully)

Any suggestions?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    Hey - great to see you again! The Cat rides the Astrobus was one of my fave games back in the day ;)

    As to your issue - perhaps try using a timer e.g. after .1 second, trigger rule.

    I'm not sure why, but when stuff didn't trigger when I thought it should, putting a timer in helped.

    Let us know if it works at all.

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • shaihaludshaihalud Member Posts: 34
    Hey QS! Time long, see no.

    Right now I've rewrote the code to not use the RUN rule and to put a .1 sec timer at the end of each GO part-

    GO = 1
    - and VAR1 < 15
    -- accel to 1
    - (TIMER) else change GO to (rand)

    It works, and the timer is probably not too intrusive, but I still wish I didn't have to use it.
Sign In or Register to comment.