Simply put: I'm having trouble figuring out how to get choices to appear based on variable conditions.
To give an example: Imagine a 'notice board' where a character accepts quests. At level=1, it displays Fight Goblins and Fight Slimes as the choices (and the player then goes to an area to fight the selection). At level=2 it displays Fight Ogres and Fight Trolls, but no longer displays Fight Goblins and Fight Slimes as choices. This could then be continued with level>2 Fight Dragons and Fight Demons.
What I'm trying to do: My game is based around a central base area wherein the player chooses missions to do (it is more of a tactical game then a linear RPG). Thus there will be one central area where missions are offered. As the missions will change frequently over the course of the game and depend upon previous actions I'm going to need to put in a lot of variables for what exactly is offered.
I feel like something similar has probably come up, but I haven't been able to find it in my searches. Just not sure how to write the if/then code.
Thanks for any help!
Uhm,
Control Variables: variable[id] = Actor X's Level
Conditional Branch: if variable[id] == 1
Show choices: [gobs,slimes]
Else
Conditional Branch: if variable[id] == 2
Show choices: [ogres,trolls]
else
Show choices: [dragons,dems]
Thanks! I know it seems simple, but I was really over complicating it.
Two additional questions:
1) How can multiple variables be set to determine whether a choice appears? Let's forget about character level, let's say I want a missions called 'Join Royal Army' to appear after the player has increased his relations with both the king and the guard captain. If I wanted it to be 'Join Royal Army' to appear after 'king approval'>5 and 'guard captain approval'>3, how would that be written? Would I just stack conditional branches?
2) This one is likely very simple (I got fairly comfortable with VX Ace about six months ago, then spent a lot of time writing in Word documents, and now my memory is spotty on the basics and I can't find the things that should be obvious): Every time I do the conditional branch it resets the variable to the choice that is made. Right now I have the simple setup of
Conditional branch: if variable kingapproval >= 1
Show choices: [fight goblins, fight slimes, cancel]
That is all working fine, however when I try to run it again, the kingapproval gets reset to whatever choice I made (fight goblins sets it to 0, fight slimes to 1, cancel to 2). This is one that I think should be really easy, but I can't see the part that I'm messing up.
Thanks again!
1) you can do nested (stacked) conditions, yes...
2) That's weird, Show Choices shouldn't be altering the variables
Here is the current setup: I have three events. One event increases the variable 0001 by 4 (King Approval). The second event is a conditional branch that asks if the player wishes to join the Royal Guard or decline if approval is greater than or equal to 2 (if not, text messages displays saying not enough approval). The third event is just a text display of the current value.
[IMG]http://i43.photobucket.com/albums/e354/CRogers271/1_zpsfc929980.jpg[/IMG]
Approval is 4 after talking to the king.
I then do the conditional branch, take the decline option, and come back to check approval.
[IMG]http://i43.photobucket.com/albums/e354/CRogers271/2_zps283ee643.jpg[/IMG]
Somehow it has reset to 1 (if I chose the first option, it resets to zero). I don't have an option anywhere in the game that should be able to set the 0001 variable to 1.
Here are the screen shots of the events.
[IMG]http://i43.photobucket.com/albums/e354/CRogers271/3_zps3232d40b.jpg[/IMG]
Just the text display of a variable.
[IMG]http://i43.photobucket.com/albums/e354/CRogers271/4_zps78a2a378.jpg[/IMG]
Talking to the king improves the 0001 variable by 4.
[IMG]http://i43.photobucket.com/albums/e354/CRogers271/5_zpsfc353909.jpg[/IMG]
The conditional branch displays the two choices when the variable is greater or equal to 2, else it displays not enough approval. Every time I use it, the branch resets approval to 0 or 1 based on the choice I made. I originally had a lot of show text messages in there to display depending upon choices, but cut them out to get down to basics.
Is there a basic mistake I'm making in there? I tried to replicate the issue through a completely new game but couldn't, so unsure about what is causing the variable to change.
Edit: Those images came out a lot smaller than they looked on my computer, I can upload larger ones if necessary.
next time, use [alt]-[PrtScrn] instead of just [PrtScrn], that will limit the screenshot to the active window.
There is nothing in the events that can change the variable back to 1 - which means that something else change that variable.
That can only be either a parallel common event or a script - and this usually happens with several scripts that use variables to let the developer control them, if you don't configure those scripts correctly they're using and changing the wrong variables.
Check any script you installed if it has been configured to use variable number one (those options are usually in the second part of the scripts, after the description but before the beginning of the true programming area). There is especially one overlay script that does this to variables 1 and two if you don't change that setting to different variables.
Thanks! It was a More Choices script (one of only two I was expecting to use). I see the problem now (sadly, I saw it earlier when I was looking through issues for the script, I just didn't understand the words/implications).
Thanks again!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.