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.)
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.
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 🙂
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 🙁