GameSalad seeming bug. Can someone explain this to me?

Hi everyone. I've been working on a project using GameSalad and have enjoyed the process. I just wanted to mention here what I think is a bug. I simplified and tested the problem in a new project. Tell me if my logic is incorrect in anyway..
I have a simple Rule with 2 conditions. self.Bla should equal 0 and self.Position.X < 300. When the rule fires I change self.Bla to 1 so the loop doesn't fire anymore. However when testing I find that when self.Position.X goes above 300 and then below again the rule fires again. So why is this happening. Its not supposed too right? When I place self.Bla = 1 outside of the rule it only fires once like its supposed too.

I created a very simple actor to illustrate my point. Here's an image. In the image are 3 simple rules. the one above. Left key pressed and right key pressed (which moves the actor right and left : ) ).
http://postimg.org/image/fiqoba2hx/

So why is this firing more then once. It fires everytime position moves above and below 300. I change the attribute self.bla no where else in this simple project. Is this a bug in GameSalad. I'd like to know so I can prevent doing coding like this in my other projects. Hopefully someone knows. Thanks :)

Comments

  • mounted88mounted88 Member Posts: 1,113
    Well you have 2 options here
    The first is remove the self.bla=0 attribute from the first rule and test

    Or add a change attribute in the otherwise self.bla=0

    Those both should work but I recommend the first one. I'm not in front of my computer to test. But that should do the trick.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited October 2013

    Hello @EarthSpirit just to mention, you don't have to put 0.0 into an attribute - an integer or even a real one - 0 will do just fine.

    So if I understand what you're after from your description, try amending your Rules to:

    Rule: When self.Bla =0
    Rule: --- nested in above-- When self.Position.X < 300
    Change Attribute self.Bla to 1

    That'll only happen once, and won't happen again until Bla is zero again and self pos. is below 300 again.

    Edit: @mounted 88 beat me to it again!... posting while I was typing. :-)

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

  • mounted88mounted88 Member Posts: 1,113

    Hello @EarthSpirit just to mention, you don't have to put 0.0 into an attribute - an integer or even a real one - 0 will do just fine.

    So if I understand what you're after from your description, try amending your Rules to:

    Rule: When self.Bla =0
    Rule: --- nested in above-- When self.Position.X < 300
    Change Attribute self.Bla to 1

    That'll only happen once, and won't happen again until Bla is zero again and self pos. is below 300 again.

    Edit: @mounted 88 beat me to it again!... posting while I was typing. :-)
    @gryoscope Sorry I like to help people when I can :)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hey @mounted88, no apology necessary! It's great you like to help people when you can (ditto :-) ) and it's good you're "quick off the draw" too! B-) :D

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

  • EarthSpiritEarthSpirit Member, PRO Posts: 7
    So i guess I have to workaround this. Is this a bug in GameSalad, the fact that it runs over and over even thought self.Bla is equal to 1?
  • BellowBellow Bartender Member, PRO Posts: 227
    Its is not bug. Try this

    create att name it fire

    at player actor rule this

    key (or whatever you want, touch mouse pressed vs) is down
    attribute fire=0

    do

    spawn actor bullet
    change attribute fire to 1


    put another rule on bullet

    timer 2 sec

    destroy this actor
    change attribute fire to 0
  • EarthSpiritEarthSpirit Member, PRO Posts: 7
    The fact is.. This thing fires more then once. It is a bug. I don't know what you guys are talking about.
  • EarthSpiritEarthSpirit Member, PRO Posts: 7
    Even though self.bla is equal to 1, this rule fires over and over again.
  • EarthSpiritEarthSpirit Member, PRO Posts: 7
    Try it.. create a new project with one actor. Have a rule with 2 conditions. If actor position < 400 and attribute = 0 then set the attribute to 1 and do the debug statement "LOOP RAN".. Then create rules to move around the actor. You will find that every time the actor goes above 400 and below 400, the rule will run again and again. The statement "LOOP RAN" will run again and again.
  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069
    I replicated your logic and ran debugging. Working perfectly fine. Try using display text to display the self attribute and see if it's changing that way. Also if you don't clear out your debugging statements they will stick around, making it seem like its happening over and over.

    Follow us: Twitter - Website

  • EarthSpiritEarthSpirit Member, PRO Posts: 7
    edited November 2013
    That is so strange cause it doesn't work for me at all. I posted a video with the bug. Maybe its different versions. Here's a video of me creating a new project and it runs over and over. Maybe I'm missing something but I really don't know what.


    I realize in debugging i wrote "This loop is hit". I ment "This Rule is hit" lol.
    The video is available on higher quality if you view it directly on youtube.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    I can confirm that this umm... misbehavior is happening in GS 10.4.0 (I haven't upgraded to 10.4.1 yet). It happens when numbers other than 0 and 1 are used. And it happens if the attribute is a game, scene, or self attribute.
  • natzuurnatzuur Member Posts: 304
    Yeah must be a bug in 10.4. Can confirm that recreating step by step in 10.4.1 isn't causing any issues.
  • EarthSpiritEarthSpirit Member, PRO Posts: 7
    I have 10.4.1 according to the about menu
  • natzuurnatzuur Member Posts: 304
    Hmm really strange, I would def submit a bug report. http://gamesalad.com/support
Sign In or Register to comment.