RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Weighted Higher/Lower Machine

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 84
puking up frothing vitriolic sarcastic spittle
I decided that the higher/lower machines in Sore Losers are too easy to win on so I weighted them, basically meaning that some games cannot be won no matter what the player does. Just like a real machine, to be honest. Anyway...

The machine is split into two parts, the machine itself and the common event it calls. The machines simply inform the player what the game is about and allows them to decide whether or not they are going to bet. The code for it is simple, and also allows you to dictate that the player is facing up (i.e. facing the machine, which you can obviously change if your gambling machine sprite needs the player facing in a different direction). The code goes a little something like this:



The second part of the machine, the common event, is what actually controls the game. In this example, the game has a 10% chance of simply disallowing the player a chance to win. It does this by forcing the second number to be 12 when the player selects lowers and to be 1 when the player selects higher. You can change this chance by altering the random number check; lowing the amount of numbers it can choose from will lower the chance the player can actually win and vice-versa.

The code for it goes something like this.



And that's it.