Event Help: Using Random Variables to alter gameplay?

Mazer

Villager
Member
Joined
Jan 24, 2016
Messages
15
Reaction score
2
First Language
English
Primarily Uses
Here's my dilemma.


I am using a Variable system to control specific elements of the gameplay. Here is exactly what I am currently attempting:


I want to set up an event that adds a Constant variable to a Random Number and if that total is > than X, then the player succeeds. If not, they fail.


So:


When Player uses Action Key on Event:


IF: Variable Constant + Random Number >/= 6 THEN PASS


Else: FAIL


The key is to just check the number, not actually alter the Variable Constant.


I am sure this may have something to do with Game Progression Variables...but I am a bit fuzzy on the exact wording...


Would someone be able to point me in the right direction? :)
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
that can be done by a simple series of control variable commands followed by a conditional branch - with careful selection of when to alter a variable and when not, using temporary variables to calculate the result.


I suggest you follow the link to the starting point in my signature and check the tutorials there, especially the variables guide. That should teach you enough on how to use variables for this task.
 

taarna23

Marshmallow Princess
Global Mod
Joined
Jul 20, 2012
Messages
2,402
Reaction score
4,966
First Language
English
Primarily Uses
RMMZ
This is actually easier than you might think, and it looks like you're on the right track. Let me show you an example of this that I use:


randomEvent.png


This little thing decides if you get a treasure box, or if a monster jumps out of nowhere to fight you. the "DungeonTreasure" variable gets set elsewhere, can be between + and - 5 and remains constant through a single dungeon. Every time an event like this is triggered, a random 1-10 is chosen, and the set variable added to it. Then the decision is made. Shiny things or a butt-kicking?


Sounds like what you need is nearly the same. Good luck with your project!
 

Mazer

Villager
Member
Joined
Jan 24, 2016
Messages
15
Reaction score
2
First Language
English
Primarily Uses
I appreciate both replies! You guys have really helped me go in the right direction. Thank you so much!
 

Users Who Are Viewing This Thread (Users: 1, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top