Does 'Not Equals To' work...
allaboutiweb
Member Posts: 42
I am trying to create a non-repeating number generator to act as 'player 2', the user being player 1. At the moment I have a rule on a 'select' button that is pressed by the user after they have picked their number which generates a random number:
When touch is pressed and round number is 1
Change 'player2' attribute to random (1,10)
Change attribute 'round 1 score' to 'player2'
After 2 seconds spawn actor... (this spawns an actor that displays text - Player 2 picked XX click to continue) and then adds 1 to the number of rounds.
I then have another rule on the 'select' button:
When touch is pressed and round number is 2
Change 'player2' attribute to random (1,10) not equal to 'round 1 score'
After 2 seconds spawn actor... (this spawns an actor that displays text - Player 2 picked XX click to continue) and then adds 1 to the number of rounds.
And so on.
It doesn't seem to be working right so does the symbol (I know I used the text in the above example) for not equal to work in the expression editor?
When touch is pressed and round number is 1
Change 'player2' attribute to random (1,10)
Change attribute 'round 1 score' to 'player2'
After 2 seconds spawn actor... (this spawns an actor that displays text - Player 2 picked XX click to continue) and then adds 1 to the number of rounds.
I then have another rule on the 'select' button:
When touch is pressed and round number is 2
Change 'player2' attribute to random (1,10) not equal to 'round 1 score'
After 2 seconds spawn actor... (this spawns an actor that displays text - Player 2 picked XX click to continue) and then adds 1 to the number of rounds.
And so on.
It doesn't seem to be working right so does the symbol (I know I used the text in the above example) for not equal to work in the expression editor?
Comments
However, my experience with random is that bruteforce is the only solid answer. There are examples in the shared templates, but you can also invent anew one more suiting your needs. You can keep a little random bruteforce machine outside of the visible area (so you can check it but players don't see).