Game Variables

Tips and Tricks on Events, Economy, etc.
LWVRR1964

Game Variables Unread post

I've been working with the editor an I fail to find an explanation on game variables.

Could somebody explain what the game variables are and how they work?
Gwizz
CEO
Posts: 1100
Joined: Sat Nov 11, 2006 6:45 pm

Unread post

variables are normally used as counters.

example: If a territory is connected is true then add a one to territoryvaraible1. If 3 more territorys are connecrted and each added one to the Territoryvariable1, then the territoryvariable1 would equal 4.
If a Gold event says does tv1 = 4 and it does then the gold event fires true.
User avatar
AZ Rail Rat
Dispatcher
Posts: 302
Joined: Sat Nov 11, 2006 7:56 pm
Location: Arizona
Contact:

Unread post

I wrote this little help THREE YEARS AGO!!! (Time sure flies when your having fun.) Have not tried it in a while.

http://www.users.qwest.net/%7Egreames/M ... _No_1.html

See if it's useful.
User avatar
Hawk
The Big Dawg
Posts: 6504
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Unread post

I see a link at the bottom of that page pointing to Gathering.
A lot has changed in 3 years. :wink:
Hawk
LWVRR1964

Unread post

I believe that I'm over-thinking these variables. I've read this thread many times and I looked at variables settings in the defult maps and...

I still don't get it!
:shock:
User avatar
Hawk
The Big Dawg
Posts: 6504
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Unread post

Digging up bones here.... :D

**#!help !pleh:

Wasn't there a document that sort of explained variables? I remember seeing one (at least I think it was for RRT3. It might have been for RRT2).

I'm trying to re-do an old map of mine and I'm still not understanding the use of random variable conditions. I pretty much have a grasp on the basic variables though.

BTW! If anyone doesn't like me replying to a thread this old complain to the Board Administrator. :roll: Her name is Helen Waite. :mrgreen:
Hawk
Gwizz
CEO
Posts: 1100
Joined: Sat Nov 11, 2006 6:45 pm

Unread post

I variable is like the letters in Algebra where each letter stands for something. Example X could equal a number or a formula or even other letters or a name. Variables work the same way.

To start, I normally give a variable a value. example: Set Gamevariable1 to = 2.
Then what ever I add, subtract, mulitply, etc. from Game variable1, uses the number 2 as one function. If I added 3 to the GameVariable 1 then it would then = 5. 3 times GV1 would = 9 You can of course let GV1 = 0 but if GV1 is = to 0 then 3 time GV1 would still equal 0.
What you do depends upon how you plan to use the math.

As a simple counter:

For example: Each load of cattle arriving at a station could be set up to add to a variable. When a fixed number of cattle cars have arrived
(say 30) then an event could be set to trigger at 32 and fire true. (The correct number of cattle (30) has arrived)

The win event could have other triggers, each one will have to fire true for the whole event to fire as true.

Variables can also be used to count the number of events that have fired true.

Getting more complicated:

An event can be used for more than one thing, if time is used to separate each usage. Example: in 1890 wool loads are counted for 3 years. At which time 30 loads of wool was hauled. The trigger counts the job done at 30 and triggers true. In 4 years (1894 by date) the variable is then reset to = 50. This time the same variable could be used to count loads of coal that is hauled. This time the event triggers at 80 meaning 30 loads of coal was hauled to trigger the event.

Of course it can get even more complicated then that. you could use a wildcard variable. (any one variable to limit other variables) Then you could use one variable for many different things. It has to do with the requirement for both variables to trigger true. If three variables were used then there would be 9 different ways to trigger one true event. Then using timing that could multiply to many more ways to use one variable.
I'll not get into how this all works now. We could use Events in more creative ways in RT2. RT3 is more like filling in the blanks which makes simple events easier to write.

Remember it is best to have company variables relate to companies.
Territory variables should relate to territories, etc. There are exceptions.
Game variables are the most powerful of the variables. They can be used for just about anything. I often save their use for last.

If you have a specific question, just ask.
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

The best way to learn about variables is to take a game that is sort of like what you have in mind to design, copy it; and look at how the variables are put together. It is like the old lawn mower in the shed when you were a child you can tear it apart to see how it works. In the scenarios that I have done, I try to label them in the event editor so if anyone wants to look at them and see what I did, they are easy to identify.
In Age Of Steam IV-Blue Streak, for example; one has to win speed and haulage trials to get access to the required territories. I wanted to make it so the player could choose the city-territory he wanted each time they were awarded. Also, it was desired to have each choosen territory be eliminated from the list after it was chosen so the player didn't have to remember which ones were previously chosen. Wolverine and I worked on that sucker for days before we got it right. He gets the credit for creating the complex array of variables and events necessary to make that work right. Feel free to look at it and see how he did it. It is one of the most complicated event sequences we have done thus far. This game is good to look at how territory and haulage events are kept track of.
User avatar
Hawk
The Big Dawg
Posts: 6504
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Unread post

I'm not really doing anything specific yet. I'm trying to figure out how the variables work so I can figure out what I want to do.
I understand the basic use of variables but I want to add a little pizazz and use random variables. Those are the ones I don't really understand.
I will admit though, a couple of things Gwizz mentioned gave me food for thought.
I'm also going to have a look at Blue Streak and see what I can see.

!$th_u$! guys. !*th_up*!
Hawk
User avatar
Hawk
The Big Dawg
Posts: 6504
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Unread post

OK! here's a specific question.

Variables set up such as 'Game Variable 1+1'

What do they do?
Hawk
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

Here you go Hawk. Here is a whole series of events with a random variable to trigger one of two possible results. Hope this helps.
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

Image
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

Here is the first choice event that starts the whole thing off
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

Image
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

The variable is set by the choice to start the dominoes falling into place.
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

Image
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

The variable triggered by the choice trips the next event.
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

Image
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

This effect resets the variable for the next event.
User avatar
wsherrick
Engineer
Posts: 584
Joined: Sun Nov 12, 2006 12:38 am
Location: New Hope, Pennsylvania

Unread post

Image
Post Reply