Faulty game logic

sladaksladak Member Posts: 119
Hello

I was wondering if anyone can help. I have a very simple rule:

If game.score>39 Do winning stuff

Otherwise

Do losing stuff

In my game, there are occassions when both winning and losing stuff occur simultaneously. This seems to happen when i score exactly 40.

This should obviously not occur. I am running 0.10.2.

Any ideas???

Comments

  • sladaksladak Member Posts: 119
    Hello

    Doing a final test on my game before submission and i hjave noticed something very odd. I have two rules which decide if the player wins or loses

    1: game.score>39 .........do the winning stuff

    2: game.score<40 ..........do losing stuff

    When i get 40 points, i get both winning and game over screens!!! There is no other logic in there so its down to these statements. Any ideas????

  • sladaksladak Member Posts: 119
    ok, repeated the same level and now it works fine.....
  • RUPASRUPAS Member Posts: 823
    could send me your project and help you, do not quite understand what his problem.
    rupas30@hotmail.com
  • sladaksladak Member Posts: 119
    Hmmmmm.....very weird. I cannot reproduce it but its on an adhoc build so there is a flaw in there somewhere.

    @RUPA The project literally has the rules above

    I am running 0.10.2 which i know is slightly older. Was there any problems with logic in this version?

    Was waiting to get this submitted before upgrading to avoid any issues
  • jamie_cjamie_c ImagineLabs.rocks Member, BASIC Posts: 5,670
    edited June 2013
    Try a rule like this:

    if game.score<=39, do your loosing stuff

    otherwise

    do your winning stuff

  • sladaksladak Member Posts: 119
    @Jamie_C yeah thanks. Was just thinking about trying that. It is very strange though and it appears the logic fails sometimes
  • sladaksladak Member Posts: 119
    Even when i use "otherwise" i get faulty logic. Sometimes neither conditions action
  • jamie_cjamie_c ImagineLabs.rocks Member, BASIC Posts: 5,670
    Care to post a screen grab of the logic you're using? Maybe something else is going on.
  • sladaksladak Member Posts: 119
    Here are the pics. Too big to fit into one screen grab. First is rule, second is otherwise
  • sladaksladak Member Posts: 119
    I remember seeing something in the forums about the game logic being faulty in a certain version, but cant seem to find it now. I wonder if thats the problem
  • sladaksladak Member Posts: 119
    Any help would be greatly appreciated
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,861
    Merged the two discussions.

    @sladak -- the first screen-shot shows your logic to be:
    when gameScore > 39

    There is faulty logic... but it is not because of GameSalad!

    change it to:
    when gameScore < 39
  • sladaksladak Member Posts: 119
    Hi

    @RThurman

    Ok the order is different to what i stated above but the problem is the same. The point is both sides of the condition are carried out which should be impossible.

    When i get 40 I get both winning and losing screens appear, where, since game.score is greater than 39, i should only get the top half of the condition......or am i going nuts??

  • sladaksladak Member Posts: 119
    Update:

    This always occurs in my adhoc build when my score is equal to the conditioning criteria. However, it does not occur in the gamesalad viewer when i get same score.

    At least now i known when it occurs
  • sladaksladak Member Posts: 119
    I get same error when i change the rule slightly from >19 to "greater or equal to 20"

    Both conditions execute. This is driving me mad. Surely this has been noticed before?????
  • jamie_cjamie_c ImagineLabs.rocks Member, BASIC Posts: 5,670
    I honestly think It's got to be 'faulty' scripting and not faulty logic on GS's part (no offense!) :). Maybe try to make a very simple test project with a simplified version of those rules, just testing the => part. My guess is there is something else somewhere in your script messing things up.
  • sladaksladak Member Posts: 119
    Oksy - it seems i have got around it.

    I have now created two rules:

    Rule 1
    If >39 : Do winning stuff

    No otherwise statement

    Rule 2
    If <40: Do losing stuff

    This works and i no longer get simultaneous win/game over overlays.

    There is obviously still a problem with the way Gamesalads logic is transferred over to the build........
    @codewizard Could this please be investigated?
Sign In or Register to comment.