Counter Problems

crapscraps Member Posts: 353
edited November -1 in Working with GS (Mac)
I have 8 dice that are set to randomly generate a number (1-6 ) - this part works fine. In the game I will be counting the number of 6's that appear.

Made an actor called "counter"

Rule
game.die1 = 6, game.die2 = 6, etc for all 8 die.
Change Att - game.counter to game.counter +1

My problem is that the counter correctly counts the number of 6's around 75% of the time.
When not working it "shorts" the count.

Ides for a fix or what I may have done wrong?

Thanks

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Crazy as it sounds have you tried a timer after 0.5 seconds if game.die1=6 change attribute game.counter to game.counter+1 (same for other dice).

    Darren.

    image
  • crapscraps Member Posts: 353
    Will Do. Is this to give the "system" time to react?
  • crapscraps Member Posts: 353
    UtopianGames - tried your suggestion:

    Timer
    After 0.5 sec
    if game.die1 = 6
    CA game.counter to game.counter + 1

    Did this for each die.

    No real change still is only accurate about 75 % of the time.

    Cant see why my rules wont work properly.
  • crapscraps Member Posts: 353
    My current app totally relies on a counter system that will determine the number of 6's that are rolled between 8 dice - like I stated above.

    The counter system that is outlined SHOULD WORK!
    What is with GS. Am I missing something?

    Can anyone help me out or suggest another way to achieve my goal?

    This is really a simple / basic Rule.

    Thanks
  • crapscraps Member Posts: 353
    I found the problem but have no idea on how to fix it.

    Currently I have 4 dice that when actor1 is touched a number between 1-6 is generated for each of 4 die.

    If any 6's are produced the "counter" actor counts the number of 6's.
    The counter works - BUT

    For example if the dice outcome on the first roll is as follows (die 1-4)
    3, 6, 2, 1 - the counter registers 1 - as it should.

    But if on the second roll of the dice the outcome is
    6, 6, 4, 2 - the counter still registers 1 - not 2.
    (you will notice that a 6 reappears in the second position as in the first roll)

    I appears that the counter does not count a previously registered 6 if on the second roll a 6 shows up in the same position as the previous roll.

    The counter is somehow not clearing the first 6,
    Yes I do have a game.counter to 0.

    However if on each roll of the dice a 6 appears in a different position the counter works correctly.

    Help!
Sign In or Register to comment.