How to Create a Condition/Variable

Have any technical questions or suggestions? Post them here.

How to Create a Condition/Variable

Postby Saint Vain » Sat Apr 07, 2012 10:12 pm

Hello, this is my last question. I don't know how to create a condition or variable.

For example, if the player chooses not to go with character X in the second chapter, then character X dies in chapter 9. But if they choose to go with character X and follow that character around, then they'll have the chance to save them in chapter 9.

Or, for another example, if the player said something mean to character Y in chapter three, then that character won't like them any more and will be rude, but if they said something nice, then character Y's dialogue will always be positive.

Does this have something to do with branches? I know how to use labels and go to labels, but otherwise I'm totally lost.
User avatar
Saint Vain
 
Posts: 29
Joined: Sat Apr 07, 2012 9:51 pm

Re: How to Create a Condition/Variable

Postby fleet » Sat Apr 07, 2012 10:16 pm

Here's how to use variables on pages with menus and branches without creating scripts.

Example: On a page that you intend to place a menu, in the Action catalog, scroll down until you see "Set game Variable"
Double click on it to send it to your Action Window.
In the Property Inspector window, type in a Variable name. such as 'Love'
In the same window, select the operator "Assign"(it's the default)
In the same window, type in the number 0 in the value box.

Go back to the Action catalog, scroll up and double-click on Show menu.
Over in the property inspector tab, after selecting a menu style, in Option 1, for the Phrase, type in Tell you you like her.
In the Event box for Option 1, select 'Set variable'
This will add a variable name block to the property inspector window.
In the variable name box, type in love (use the EXACT name that you did before).
For the Operator box, select Add
For the Value box, type in 1

In the Phrase box for Option 2, type in Tell her she has a nice personality
In the Event box for Option 2, select 'Set variable'
This will add a variable name block to the property inspector window.
In the variable name box, type in love (use the EXACT name that you did before).
For the Operator box, select Subtract
For the Value box, type in 1.

You only have to create the variable love one time.

To make the ending selection, on a subsequent page, double click Branch from the Action catalog.
IN the Property inspector window, click on Condition
This brings up the Edit condition pop up window.
In the Edit condition pop up windows, click on the green + sign.
This will add contents to that window, type in love in the Variable name box.
In the Operator bix, select Greater than or equal
In the Value box, type in 1 (or if you are going to have multiple menus, type in an appropriate number (for example, if you have five menus, with the option of adding or subtracting 1 in each case, if you want the player to get a good ending if he has a majority of good selections, type in 3).
Click on the Done button to close the Edit condition pop up window.
Back in the Property inspector window, in the When true box, select an appropriate Event (I like to use Change Page, where you would go to a happy ending).
IN the Property inspector window, in the When false box, select an appropriate Event (again, I like Change Page, where you go to the unhappy ending).

I hope this helps.
Why? I like big ones, that's why.
User avatar
fleet
 
Posts: 871
Joined: Tue Aug 31, 2010 12:03 am
Location: USA

Re: How to Create a Condition/Variable

Postby Saint Vain » Sun Apr 08, 2012 2:06 am

Thank you, this is incredibly helpful but going to be incredibly difficult. :shock: *newbz*
User avatar
Saint Vain
 
Posts: 29
Joined: Sat Apr 07, 2012 9:51 pm


Return to Support & Development

Who is online

Users browsing this forum: No registered users and 6 guests

cron