Damn variables...

ulisseulisse Member Posts: 25
edited November -1 in Working with GS (Mac)
Hi
I am trying to have 2 actors communicating through a global variable.
The variable holds a timer (a real) for actor A, who uses it inside a timer.
Actor B sets it to a new value and, after an amount of time, it restores it's original value.
Looks like actor A responds to the first setting, but as I replace the original value actor A still responds to the altered value.
More...if I try to display in actor A the value of the global variable I always see it's original value.
Please help me

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi ulisse. What I gather from your description, you'll need a second global boolean attribute that acts as a switch; when it's false, the new value, when it's true, the original value (or the other way around, can't think straight tonight!.) Hope that's enough to help.

    :-)

    ---------------------------------------------------------------
    Spiral Gyro Apps

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

  • ulisseulisse Member Posts: 25
    Sorry for the late reply. I've been away for a while
    Looks like simply restarting GS solved the problem along with the usual slowdown
    However thanks for the help
  • ulisseulisse Member Posts: 25
    Looks like I've got another similar problem.
    I have a spawner inside a timer and I want to alter its duration while progressing in game.
    I keep the loop duration inside a global variable, but as I alter it my timer still behaves the same.
    I printed the value so I'm sure it changes at the right time. Maybe the timer cannot change once activated?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    this is more complicated than you might think (it least it was for me!)

    Search for "timer with variable rate" in the shared projects
  • ulisseulisse Member Posts: 25
    great :D now the timer it's up and running
    thanks a lot
Sign In or Register to comment.