Actors suddently not fully initializing

thebitmasterthebitmaster PRO Posts: 75
edited November -1 in Working with GS (Mac)
I'm working on updating Astrominer (in App Store), but, seemingly randomly, several of the asteroids aren't running all their initializer code. They are all prototype instances, none are unlocked, all should be completely identical. However, some of the non-rule-based code (mainly Change Attribute code) is obviously getting run for some of the asteroids, but not all of them. It's also affecting at least one collision-based rule. I added a Show Text rule to the beginning of the Asteroid object code, and, sure enough, it shows on the functional asteroid, but not on the others. Under what instances might code inside an Actor outside a Rule not run? I've been assuming that code put directly in an Actor's body with no rule is "initialization code" and gets run exactly once as soon as GameSalad instantiates it. Is that correct, or am I missing something?

Details:

Asteroid objects, all still linked to prototype:
Show Text (shows only on some asteroids)
bunch of Change Attribute Commands (run on one asteroid, but not on the others)
On Collision Rule (works on same asteroid, but not firing on others)

I'm using the 0.9.6 tools, but the problem cropped up seemingly at random after things had been working well for a while. Previous versions of the game seem to work correctly.

Comments

  • thebitmasterthebitmaster PRO Posts: 75
    Note that I've tried deleting the asteroid objects and re-adding them, with not change in behavior. Changing the order of the actors in the layers doesn't seem to help, though this has solved previous instances where some actors weren't colliding properly.
  • thebitmasterthebitmaster PRO Posts: 75
    I found the problem. I had used:

    random(100)

    instead of the correct

    random(0,100)

    While I would certainly like to hear some kind of compiler error from GameSalad about this kind problem, this time it wasn't their fault, it was mine. After correcting the random statement's syntax, the asteroids are moving correctly again.
Sign In or Register to comment.