Problem With Spawn and Integer

UtopianGamesUtopianGames Member Posts: 5,692
edited November -1 in Working with GS (Mac)
I don't use spawn a lot in my game so not sure if i have missed this one...

I have a spawn actor that spawns actor X and for the timer i have a game.integer game.timer set to 5 so every "game.timer" spawn actor X.

It works fine until i want to change the game.timer down to lets say 2 so it spawns more frequently.

Now I'm sure this used to work so have a missed a bug or a trick with this?

Darren.

FREE GS Templates
FREE GS Tools
Video Tutorials
Forum
3rd party marketplace

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Problem happens when you have a game.spawntime set to 5 for eg then try and change it to 1 during the game.

    I have worked round it but never came across it before as I'm sure i did something similar a while back with no problems.

    Darren.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Darren your not crazy. I don't remember how long ago but I had the same issue. I honestly cannot even remember what I was working on but I have had the same thing. where it used to update the timer if the attribute changed but now it just takes the first value of the attribute and never changes no matter what the attribute changes too.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Just looked through my email. I reported to GameSalad on Oct 23rd. Never heard back from them. Actually its getting irritating I have had several no reply bug reports lately. :(
  • NtGNtG Member Posts: 103
    sorry to bump such an old thread lol, but has anyone figured this out or have a work-around to this problem?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Just tried it and it worked okay for me. https://www.dropbox.com/s/p74qa83s9o0yi61/timer test.zip

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • NtGNtG Member Posts: 103
    im not using it to spawn though, I am trying to use it to make an actor change direction at random times between 2 and 30 seconds. I have the following:

    Change Attribute self.changeTime to random(2,30)

    Every self.changeTime seconds
    - Change Attribute game.direction to (game.direction+1)%2
    - Change Attribute self.directionChanged to True

    When self.directionChanged is True
    - Change Attribute self.changeTime to random(2,30)
    - After 1 second: Change Attribute self.directionChanged to false

    This code causes the actor to change direction only at the time initially set in the first behavior, and doesn't update throughout the game. self.changeTime changes its number like it is supposed to, but the new number is not replacing the old number in the timer. Anyone know what I'm doing wrong with this? or is this some crazy bug?
  • UtopianGamesUtopianGames Member Posts: 5,692
    Sounds like the changing back to false isn't working.

    Darren.
  • NtGNtG Member Posts: 103
    Sounds like the changing back to false isn't working.

    Darren.
    I put an actor in that displays that attribute and it is correctly changing back to false, so I can rule that out as the problem.
  • NtGNtG Member Posts: 103
    NVM I found a work around
Sign In or Register to comment.