Some self, real attributes keep changing to 0 after I edit them for an instant reset...

jckmcgrawjckmcgraw Member Posts: 647
edited April 2012 in Working with GS (Mac)
Hello Everybody,

This is a pretty specific scenario, so if I'm not making it clear, please let me know.

I am using @TShirtBooth 's GS cookbook video on instant resetting for scenes. Everything has worked great up until a day or 2 ago. To start, I have the actor's self.startX change to self.pos.x; I also have it for the Y's. Then, when attribute game.reset is true, I have the actor change attribute: self.pos.x to self.startX.

Here is where the problem occurs... Once I make the rule change att. self.pos.x to self.startX and leave that actor and come back, self.startX just changes to 0. As you can see, this is a huge problem, because all of my actors go to coordinates (0,0) at the beginning of every level (I have game.reset change to true at very beginning).

NOTE: The self attributes I made (self.startX and self.startY) = 0 on the left.

Any help would be greatly appreciated!

Thanks,
Jack McGraw

Answers

  • jckmcgrawjckmcgraw Member Posts: 647
    @tshirtbooth

    It changes to false 0.1 seconds after if changes to true in a control actor

    Thanks for the quick reply!
    Jack McGraw
  • jckmcgrawjckmcgraw Member Posts: 647
    edited April 2012
    @tshirtbooth

    I found out that the problem had to do with giving it time to change, but that it wasn't the only problem. At the very beginning of a scene, after 0.1 sec, I had game.reset = true, and the actors to set their self.startX after 0.1. Therefore, I got a bad overlap, but it didn't cause the bug every time. For that problem I changed the game.reset to trigger after 0.3 sec.

    For the other problem, it is pretty general. I was just having a bunch of self integer attributes randomly change to 0 in my rules.

    EX: have something trigger every self.time sec. instead of having self.time in the timer, it changed to 0.

    I just changed it back to self.time, and am hoping it doesn't happen again. I can still do the display text debugging if that might have an affect still.

    Thanks,
    Jack McGraw
  • jckmcgrawjckmcgraw Member Posts: 647
    @tshirtbooth

    That's a good question... I don't really know why I've been doing that. I guess to make sure it reset game attributes that I use for every level. Do I even need to do that for that reason?
  • jckmcgrawjckmcgraw Member Posts: 647
    @tshirtbooth

    Oh ok. Well I guess the problem I had is gone now that you mentioned the timing.

    Thanks so much TSB!
    Jack McGraw
Sign In or Register to comment.