Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Connecting one Variable to Another

9 years ago

I wanted to do a simple game to learn scripting.

How does one connect one variable to another, as in making one variable change other variables?

I wanted to have the character the player chose affect the stat variables.

Would be something like this? :
IF %CHARSELECT := 1 THEN %STRENGTH := 10
IF %CHARSELECT := 1 THEN %CHARIMSA := 3
IF %CHARSELECT := 1 THEN %VITALITY := 12
IF %CHARSELECT := 1 THEN %SPEED := 5

Connecting one Variable to Another

9 years ago

Well, it would actually be:

IF %CHARSELECT = 1 THEN %STRENGTH := 10

It's easy to get the equal sign and "set variable to" sign mixed up. Aside from that, you seem to have the right idea.

Connecting one Variable to Another

9 years ago

Thank you.

This is probably going to be a complete failure as I am clueless on scripting. I can mess with variables tons, but scripting is like walking into a minefield for me.

Connecting one Variable to Another

9 years ago

Actually I wouldn't even use scripting for this if I was making my first story with scripting because you can just alter the variables using a link.

Connecting one Variable to Another

9 years ago

You can, but the stuff I plan on doing with involve messing with variables in such a way that the scripting is actually a shortcut.

I plan on having the player picking and controlling multiple characters along with some sort of leveling system that changes the stats. (So I'll eventually need to script variables being added together to get what another variable is.)

Setting a variable is easy in script compared to doing it variables only. I'm done plenty of variables only work in some of my unfinished stories. One of them was going to implement a random event system without the use of scripting. However it appears that it is much easier to script it than to make out the map variables and variable restriction links in order to create a random event system. So this is kinda a learning experience to get me through learning scripting more than anything else.

Connecting one Variable to Another

9 years ago

I agree with most of the things you said but scripting and variables aren't mutually exclusive. I usually use variables for the easy stuff (like what you were doing in the Op) and scripting for harder stuff or random variables

Connecting one Variable to Another

9 years ago

Here's something to keep in mind:

:= means set it to so and so

= means equals to

Connecting one Variable to Another

9 years ago

I established that for her.