Property as a value for another property

Making a sort of slot machine game. I have an object that has two property sensors. I want both sensors to be “true” to proceed with the game. One property is PlayerCredits, which I initialize to a starting amount (say 100), and the other property is PlayerBet, which the player sets at 1,2 or 3 credits. I check to see that the bet is not zero, nor more than three, but also that it is less than the PlayerCredits. For the PlayerBet sensor, I have the evaluation type as “less than” and the property as PlayerBet, but for the value, I want to use the value of PlayerCredits but if I enter the text “PlayerCredits” in the value area of the sensor, it doesn’t work. I think it sees it as a zero. If I type in an integer (1,2,3 etc.) then it works fine.
I don’t want to use Python, and I don’t think I really have to, so maybe there is a way with logic bricks only.

I strongly believe that there is a logical equivalent that doesn’t require to compare PlayerBet to PlayerCredits. But I can’t think of one. Are you really (really) sure you don’t want to use a python controller?

You can use the expression controller for this.

I am not quite sure how to use the Expression controller. I tried it but it didn’t work. I must not be using it the correct way.

You may write “PlayerBet < PlayerCredits” to trigger the actuators IF the PlayerBet property is less than the PlayerCredits property.

agoose77 - thank you, I think I get it. I will try it tomorrow.

I tried to set up the expression controller but it didn’t do what I expected, although it did make some changes to the game. What I want to do is this: When the key is pressed, the game needs to evaluate first of all, if the property “PlayerCredits” is not equal to zero. If it is greater than zero, then the game needs to see if at least one credit is bet (“PlayerBet”), and not more than three credits bet. It also needs to check that the bet (“PlayerBet”) is not more than the credits (“PlayerCredits”). I have these two properties of the same object as well as a keyboard sensor. When ALL of these conditions are met, then the game can proceed with the spin of the “slot machine”. But I can’t seem to set it up correctly. I’ve tried checking the ["] [,] and also “Tap” and “Level” but I just seem to make it worse.

Something like this for the expression:


(PlayerBet &gt; 0) AND NOT (PlayerBet &gt; 3) AND (PlayerBet &lt;= PlayerCredits)

The parenthesis are optional.

agoose77 - OK well I am not sure if I tried it exactly the way you have it. So I will try your example. Thanks again!