Fun With Variables

Hey everyone! I'd like to know what your favorite experience with variables was/is. What did you do, and how did using variables help you do it? Did you save yourself from having to use a script?

For me, my favorite experience has been figuring out how the Point system in my game should work. Here's a run down: You get Points by doing side quests (Making them a finite resource). You can spend Points to increase attributes (Charisma, Strength, Courage, IQ). But, you need a certain number of Points to advance the game--which means if you spend too many Points too soon, you could end up getting stuck, a clear bug. Here's how I worked it out.

V1 = Number of Points. Increases whenever you complete a side quest.

V2 = Number of Location Points. Increases whenever you complete a side quest, but NEVER decreases. It could also be known as "Total Points".

V3-6 = The four attributes you could get.

V7 = Bonus Points. This variable gives you an extra Point whenever you gain 5 Points. It increases when you complete a side quest and goes to 0 when you complete 5 side quests.

Variables 1, 3, 4, 5, 6 and 7 would have been in the game anyway, but I solved a bug by adding in one variable. Nifty!

Go ahead and share your experiences with variables as well, whether they be good or bad.

-Wallace
Well, I managed to use a variable for a puzzle instead of working with switches. It was used to activate a cut-scene event when the variable Orb_Count equals 3.

So in-game, there are these 3 pedestals that need Orbs to be placed on them. The player would place an Orb on the correct pedestal (setting an Orb on the wrong pedestal results in an instant-kill as a consequence for guessing wrong), and Orb_Count would add 1 for each Orb placed correctly. When all 3 Orbs are placed correctly, the Orb_Count would equal 3 thus completing the puzzle and trigger the cut-scene.

I was having trouble using switches tied to Conditional Branches (one for each Orb) to activate the cut-scene event. Using a variable was much simpler for this sort of puzzle.
Using variables to record my game's progress, and progress of side quests.


Using one variable (to show steps in the game's progression) can remove the need for a whole big heap of switches.
   Hmm, Variables... I've done so much with variables though, I use them to track side-quest progress and to run my evented weather/time/Nurishment/exposure/toxicity systems. Probably the lengthiest use I've found for them is for a sort of campfire/inn system where you can chat with the other members of your party. I use odd values for instances where one has something to say and even values denote the time in-between speaking to someone and reaching the point in the game where they have something new to say. Another common use I have for variables is for items that have a bit of a delayed reaction to track how many times the event runs before it wears off, such as an antitoxin that doubles the rate at which the body purges toxins, but after it's changed your toxicity level 6 times the negative effects involved with the antitoxin goes away and at 12 runs the antitoxin is out of your system. At the moment I'm working on linking two actors together so that they share the same mp pool and share states but I haven't been completely successful with that yet.
Another creative way I've used variables is in battles. Attack? Psh, I attack with variable 97! If you want to add an "extra stat", go ahead and use a variable to do that.

If you want to make your NPCs say something different-ish each time you talk to them, you can set a variable to a random number (between 0 and 2, most likely) and conditional branch the text, i.e.:

Con. Branch "Random" Variable = 0

"Hi!"

Else

Con. Branch "Random" Variable = 1

"Hello!"

Else

Con. Branch "Random" Variable = 2

"Salutations!"

branch end

This takes some of the monotony of talking to your NPCs away.

-Wallace
I got a quest that is like:

"Gather followers.

When you have gathered followers above number x, they build a house."

Basically, the map transfer event goes somewhere else when you got enough variables.
I managed to make a mini-game that involves gathering wood for a lumberyard under a time limit. The player gets paid for each piece of wood they obtain. I used a variable to keep track of the amount of wood obtained and the amount of money the player receives. (Unfortunately, I couldn't do math related tricks in a message box, so I had to find a work around.)
I used one variable as a complex 'throw decoy' mechanic in which the player can throw an item five spaces in front of him, up to 5 at once. These items would use a dynamically ID'd event within the map to display the item thrown, which would blink and disappear after about 15 seconds. When an enemy on the map saw the item, it would distract them, causing them to go towards the item and ignore the player. At this point the player could attack the monster for much more damage than normal.

I also used one more variable for all of the maps enemies' health and respawn timer.

My tutorial on Intermediate/Advanced Game Variables can shed light on how I pulled these off.
Seita I wanna know how you did thaaaaat.

I use a variable instead of HP for the main character in my game, which makes eventing things a bajillion times easier. I don't use the DBS though, so there's that.
Oh, difficult question to answer. I have had a bunch of fun with eventing that do not really know what to pick. Here is a selection of "finished" event systems for RMXP I have created for the interested: https://www.mediafire.com/#f4z54e00szurj
Did I enjoy the silly door system the most? Was it the evented title screen or my most amazing battle system?

As the question is about variables in particular my favorite experience was without a doubt designing my Pig Puzzles experiment as I am very sure Shaz remember. It is a workable yet imperfect system.
She had so much fun figuring out the issues and how to fix them, well… I had fun. :>

*hugs*
 
Pig Puzzles ... I don't remember. Obviously it was such a harrowing experience I have blocked it from my deepest memories 😉 I'll have to look that up when I finish work this evening 🙂
Sure you do:

pigpuzzles.png


It was the very first thing you did as my eventing student ^_^

The idea behind that system is that you can give the pig a number of moves (left,right,down,up) which it will repeat endlessly. The goal is to get it from start to a specific area. The actual moves are encoded into a single variable. (Limits number of possible moves that can be registered)
Now I think you're just playing mind tricks with me.


I honestly can't remember doing this puzzle, but that was such a long time ago. Maybe I'll have to revisit it ... if you hadn't already sprung another one on me.


You're so mean 🙁

Original thread: https://forums.rpgmakerweb.com/threads/fun-with-variables.22714/