Far Gate Campaign Editor Tutorial

By Louis S Carrozzi, Mission Designer - Far Gate

Super X Studios - Seattle, WA, USA

<< BACK TO MAIN MENU <<


Section 3: Managing Objects And Triggers

This section is going to be broken up into two sections: The first section will discuss placing objects into your system (such as planets, ships etc.) and the second section will show how to create and use triggers to define how those objects behave - and how the entire mission behaves - over time. I have included both concepts in this one section because triggers and objects are very dependant on one another.

SECTION 3A: Specifics of Object Placement and Parameters

What is an "object" anyway?

Since I use this term throughout this tutorial, it deserves a better definition for those who don't know what an object is. An object (in our editor) is defined as ANYTHING that you can see or add into the main editor window physically. A sun is an object. A station hub is an object. Asteroids are objects. Wormholes are objects. Even a "Celestial Shpere" is an object (even though it only shows up as a "background" in your mission). Its still an object. Nebulas and gas fields are also objects. You get the idea. Pretty simple, huh?

So, how the heck do we get objects into our mission?

Easy. You simply select the object you want to add from the left hand side of the object panel (we'll add a blue sun here...):

Then, hit the "add" button...

Then click somewhere in you main editor window. Suns appear instantly when you click the add button. Other objects, such as ships, will only appear once you click somewhere in the editor window. You can hold down the [Shift] key when dropping in objects, to add multiple objects of one type - for example a fleet of cruisers.

There are two golden rules for adding objects to your mission:

1) The Camapaign editor MUST be [Reset] (via the reset button) before you can add OR modify any object in your mission.

2) If you want to add any "ships" or "structures" to a specific player, you need to specify which player you want to add them to via the right-hand side of the object panel. For example, if you want to add a Heart to player 2 (enemy by default), you need to click on player 2 in the right hand column like this:

You will notice that I have selected Player 2, Squad 1. The next ships or structures I add next will now automatically be assigned to Player 2, Squad 1. This same technique can assign ships or structures of any type to any squad of any players 1-6. Once you do this a few times, it will become very intuitive: Select the player and squad you want to add units to, then click the object you want to add, then click the "Add" button, and then click where you would like to place the unit(s) in the mission.

Players deserver some explaination here. Player 1 (the actual human player of your mission) will be hostile (by deafult) with Player 2. This is designed to make player-vs-computer scenarios quick and easy to create. However, you can override this alignment setting with a "Set Alignment" trigger action which we will cover later in this tutorial in Section 4. All other players (3-6) will be neutral by default.

Here is what our system should look like right now:

Pretty boring huh? No problem. Take a look at what options you have for MODIFYING objects. You'll notice that your right-hand object panel (scene) listing has a new addition. The blue sun:

To access the properties of any object, just double click on the name of that object in the right hand object panel.

IMPORTANT: You MUST be "Reset" to view an object's property window. (Like I said before, you will be using reset and play a lot when creating a mission).

In our case, double clicking the blue sun on the right-hand side of the object window will bring up a screen like this:

Manipulation Panel:

Rather that give examples of all of these functions, I'll just explain what each of these buttons do here, and you can experiment on your own.

Move: Clicking this button after placing an object will allow you to freely move the object within the main editor window. Holding down the left mouse button, and moving the mouse forward or back, will allow you to veritcally move an object off the main elliptic. Once you let go of the mouse button (left) it will place the object at that position.

Rotate: This will allow you to rotate the object in any of the 3 axes, X, Y, and Z. You will rotate an object on its "X" axis by default, but you can rotate it in Y and Z directions by holding down the [shift] or [ctrl] buttons on your keyboard after clicking this button.

Reset Orient: This resets the object to its original orientation.

Link and Clear Link: I have never actually used these, so you'll have to ask James. ;)

Set Orbit: This button allows you to re-direct the orbit of an object to a new "planetary body". For example, if you want a Station Hub to orbit a planet instead of the sun, you select the station in the main editor window, then click this button, then click on the planet you want the station to orbit. All objects orbit the sun by default, so you will only need to use this if you want an object to orbit another planetary body.

Set Eccentricity: This is used for modifying the "weirdness" of planets orbiting a sun. If you want strange orbits for planets (other than the deafault circles) this is the button you want to use.

Set Spin: First, select a star or planet, then click this to adjust how fast, and in which direction, a planet rotates. Moving your mouse left or right will adjust the direction and speed of the spin of a planet or other body.

Clear Spin: If you really muck things up with the spin, you can reset the spin to "zero" with this button.

Scale: You can adjust the size of any object with this button. NOTE: While you CAN resize ships with this button, you won't alter any damage or fire properties of that ship, and it will look pretty silly. This is mainly designed for adjusting sun, planet, asteroid and nebula sizes. The "spinner" on the right will tell you (in relative scale) how big your object is versus the original size. For example, if you scale an object to 300% of its original size, it will be 3 times as big as it was to begin with. Adjusting this to 33% will make the object 1/3 its original size.

Reset Scale: Resets an object to its default size.

Health: This "spinner" allows you to set the default health of a ship or structure. For example, if you want a ship to be heavily damaged by default, you might set this to 25% of max health. This won't affect "inert" objects such as planets or other non-living objects.

Invincible (checkbox): This allows you to specify any unit as "invincible". Use this with great care, as any unit that is invincible can never be destroyed!!

View: This button is VERY useful. It allows you to instantly zoom to the object you have selectedin your right hand object (or "scene") list. Sometimes when you are working with a large number of similar units, this will save you having to figure out what properties you are looking at for what object. When you design complex missions, the value of this key will become VERY appearent. It takes you to EXACTLY the object who's properties you are looking at.

Ok, enough of that. You get the idea. You have GREAT flexibility in placing and changing the properties of objects through the "Manipulation" window.

The thing to note is that what properties you can adjust depends greatly on what type of object you are modifying.

Now let's make our system a little less boring.

First, I'm going to add a Celestial Sphere to give us some "space". You can do this by simply double-clicking on a celestial sphere in the left hand side of the object panel like this:

Now, our system should look like this:

Ok. Now we can scale that sun a bit bigger. (see above for how to do this under "Scale".) I'm going to scale it up to 300%, like this:

Now, let's drop in some asteroid fields. We'll add in 4 asteroid "fields" from left hand object list.

1) Click on the type of field you want like this:

2) Click on the [ADD] button:

3) Then, click somewhere in the system to get something like this:

4) You can also hold down the [SHIFT] key before clicking in the main editor window to add "multiple" of the same type of object. Let go of [Shift] key to stop adding.

NOTE: This is very useful for quickly creating fleets of ships.

OK. Now, we can't really see the asteroids at this zoom, so let's right click on one of the asteroids to zoom to it, then hold down the right mouse button and move your mouse back to get a good view of the field like this:

You'll notice that navigating and moving in the campaign editor is exactly the same as naviagting in the game itself.

Go ahead and hit the [PLAY] button to see the asteroids and sun, fully animated, exactly as they will appear in the game! ** Remeber to hit the [RESET] button before you try and add more objects to this mission.** The editor must always be reset before adding objects.

Notice also that your new "Asteroid Field" now shows up in the right hand section of the object triggers panel -

Also, notice that each individual asteroid of that field appears here (in the scene list):

NOTE: You need to be careful about how many objects you add to a mission. Each object takes up RAM (random access memory), especially animated particle systems such as nebulas and wormholes. Each asteroid field can contain hundreds of asteroids, so use these object "clusters" sparingly. This is a bigger issue for multiplayer maps, and for slower computers.

Now, let's hit the [TAB] key to zoom back out to the full system view. We're going to add 3 more asteroid fields, and then some planets.

To add in more asteroid fields, f irst, hit the [ESC] key to get out of the main editor window.

To add in the 3 new asteroid fields, click on the asteroid field you want to add (as shown above), then click the [ADD] button, then hold down the [SHIFT] key and click in the main editor window 3 times. Your system should now look something like this:

You will notice that objects you place in your mission always appear directly on the elliptical plane (0 units up or down on the vertical or "Y" axis.)

If you want to place objects above or below the elliptical plane, then simply hold down the left mouse button when adding your object and move your mouse back or forward to move it vertically. Let go of the mouse button to lock its new orientation. (This is the same as moving a player unit up or down in the game.)

If you want to modify an object's position, scale, rotation etc. AFTER you've added it to your mission, you can go into its Manipulation Panel (as described above for our blue sun).

Now, let's add in some planets and moons. For simplicity, we'll just add in 4 of the same type of planet, and then we'll modify each seperately. After that, we'll add in 1 moon to orbit 1 of the planets.

First, select the "Arctic Planet" from the Object Database (left) side of the object panel like this:

Then, click the [ADD] button and hold down the [SHIFT] key, then drop in 4 arctic planets into your editor window. For the last planet, hold down the left mouse button and move the planet up. Your system should now look something like this:

Hit the [ESC] key to get back to the object panel.

Now, you may or may not see your planets in the "scene" column of your object panel. If you don't see your newly added objects, you can hit the [Update] button and you scene list should now look like this:

You'll notice that your 4 new planets have ID numbers next to them.

These numbers are called "IDs" and they make each and every object in your scene unique. Because each and every object in your mission has a unique ID, you can use specific objects (chosen by ID number) for activating triggers. Your ID numbers will likely be different from the numbers you see above, but each will be unique.

Our next task will be to make these 4 tiny planets a bit bigger, and set rotation and spin for each. I'll show you how to manipulate 1 planet, and you can then experiment with the other 3.

NOTE: There are two ways you can select and manipulate objects in your mission:

1) You can double-click on the object in your scene (main editor window) OR

2) You can double-click on the object in your scene list (object panel)

You will likely use both of these methods, especially when dealing with a lot of the same type of object. You can't tell by ID number which object you are modifying in your mission, but you can left click on the object in the main editor window, and it will automatically highlight in your scene list.

As always, your scene MUST be [RESET] before you can modify your scene objects.

Go ahead and [Reset], then double click on one of the planets in your scene list. You will get the manipulation window for that planet:

Now, click on the [VIEW] button and notice that the main editor window automatically zooms to that planet like this:

Now hit the [SCALE] button and then move your mouse left or right to scale the planet size up or down. You'll notice that you have a scale guide on your manipulation panel that changes as you scale the object's size up or down.

Click the left button to "lock in" the new size. I'm going to scale the planet size up to 200% of its original size. It will now look like this:

The next thing we need to do is decide what rotation (x, y and z axis) we want for this planet. You can rotate a planet in 3 directions: Yaw, Pitch and Roll. To rotate the "yaw" you only need to hit the [ROTATE] button, move your mouse left or right, then left click to "lock in" the rotation.

To rotate the planet in the "pitch" or "roll" directions, hold down the [SHIFT] or [CTRL] keys while you are moving your mouse.

TECHNICAL NOTE on Rotation Types:

- Yaw is defined as "rotation around the Y axis of an object". Think of a car turning left or right, and that's Yaw rotation.

- Pitch is defined as "rotation around the X axis of an ojbect". Think of an flying airplane nosing up or nosing down, and that's Pitch rotation.

- Roll is defined as "rotation around the Z axis of an object". Think of a flying plane rolling upside down, then returning to right side up, and that's Roll rotation.

Now, let's set a spin for that planet.

Click the [SPIN] button, and move your mouse left or right to set the spin of your planet. When you get the spin you want, click the left mouse button to "lock in" the spin. You can hit the [CLEAR SPIN] button to reset the spin back to zero if you make a mistake.

Once you have set the spin, rotation, and scale for the first planet, click the [OK] button on the Manipulation panel to get back to the scene list in the object panel.

Go ahead and practice setting scale, spin and rotation on the other 3 planets.

You system may look something like this when you are done:

Notice that everything in your mission right now automatically orbits the Sun.

In order for this to work, you must always add your sun to your mission first. If you don't, then your planets, asteroids etc. won't orbit properly, because they would have nothing to orbit!

- You can reset the orbits of objects by deleting and re-adding a sun to your mission.

We can modify the orbit of an object by resetting the orbit in the Manipulation panel for that object.

To show how this works, lets add a moon to orbit one of the outer planets.

First, find a suitable "planet" that will act as a moon. I usually use "bluemoon" but you can experiment with other planets as moons.

Go ahead and [ADD] the moon fairly close to one of you planets like this. NOTE: I have scaled the size of this paticular moon up to 346% for this screenshot. BlueMoons will be very tiny when you add them, so you may not see the moon if you are zoomed out to [TAB] view.

When you first add this moon, it's orbit will automatically be set to the sun. To get it to orbit the planet, go ahead and double click on the moon in the main editor window to select it in your scene list, then double click on the BlueMoon that gets selected your scene list:

Then double click on Planet (bluemoon) in the scene-list to get into its manipulation panel like this:

Now click on the [Set Orbit] button.

When you do, your mouse will automatically switch to the main editor window. Now, simply left-click on the planet you want that moon to orbit.

That's it. You won't see anything happen, nor will you see an orbit ring appear. However, the orbit should be set. If you now hit the [Play] button for your mission and watch, your moon should orbit the planet you clicked on in the last step.

NOTE: Its a good practice to get both the moon and its "parent" planet in the editor view before you try setting the orbit for the moon. That way, when you go to set the moon's orbit, you don't have to navigate around your system and risk picking the wrong planet. This can cause some very wierd effects...

We're almost done setting up our system and get to the fun stuff with triggers, ships, and bases. =)

The last thing we'll do before adding in player units is to [Scale] those 4 asteroid fields up a bit. That way, the asteroids will be more spread out, and easier to get to for pods, drones etc.

Go ahead and scale each asteroid field up to 400% of its original size using the Manipulation panel for each. Be sure you select the asteroid fields and not the individual asteroids like this:

Set each asteroid fields' scale just like you did with the planets and sun, via its Manipulation panel. (see above for details).

When you are done, you system should look something like this:

Congratulations! You have now completed a solar system.

Next, we're going to add in a couple of hubs and tiggers to make this a playable single player mission.

Adding in player units and bases works almost exactly the same way as adding in planets etc. to your mission, with one very important addition:

- You should always select the PLAYER and SQUAD you want to assign a unit to before adding a unit to your mission. Otherwise, the next ship or base you add to your mission will default to the last player you selected. -

Yes, you can change a unit's player later on, and you can drag and drop units from one player to another in your scene list if you make a mistake, but its a good practice to select the player and squad you want to add a ship to before adding it to you mission to avoid confusion or getting results you don't want.

You can access which player and squad you want to assign units to from the scene list like this:

Just click the player, then click the squad.

In the example above, the very next ship(s) or structures that we add will go into Player 1, Squad 1. The other players will work exactly the same way.

NOTE on SQUADS: Each squad will hold a maximum, fixed number of units. Once squad 1 is filled up, then any following units will be auto-assigned to squad 2 until its filled up, then be assigned to squad 3 etc. There is a maximum of about 150 units per player, so just keep an eye on your Player list to see how many ships are added, and how many "slots" you have left to add more. Remember to hit the [Update] button if your ships don't appear in the list right away!

NOTE on PLAYERS:

Player 1 is ALWAYS the user's player, or the player that the single player (human) uses to play the game.

Player 2 is ALWAYS the enemy of Player 1, by default.

Players 3-6 are NEUTRAL by default, but can be made hostile or friendly to other players via a "Set Alignment" trigger (discussed below).

You can add ANY type of ships or structure of ANY race to ANY player. The types of ships you add has nothing to do with what player they are controlled by, or what they're alignment will be. All alignment and player settings are controlled via the player list (as shown above) and the "Set Alignment" trigger action which we will cover in a bit.

Let's go ahead and add in a Station Hub to Player 1. First select Player 1, Squad 1 as shown above. Then, click Station Hub in under Proximan Structures like this:

Now we can [ADD] it to our mission just like we did the planets above. I'm going to place my hub near some asteroids so player 1 (the user) doesn't have to travel too far to get resources. The mission now looks like this:

Go ahead and zoom to the hub by right-clicking on it, then hit the [Play] button.

You'll notice a few things. First, the unit is green, which means its friendly. However, there is no money to build anything!! Go ahead and hit [ESC] to get out of the editor window, then hit [Reset] to reset your mission.

We can fix the no-money problem with a trigger. We're going to add a trigger that will add $5000 to player 1 as soon as the mission starts.

SECTION 3B: Working with Objects and Triggers

Go ahead and click on the Mission menu item, then click on Triggers menu item to bring up the trigger editor like this:

Now, click on the [New Trigger] button to add a new trigger. Your trigger window should look like this now:

"Trigger#1" isn't a very descriptive name for our trigger, so let's rename it in the "Name" field and call it something that will let us know what this trigger does. I'm going call this trigger "Add Money to Player 1". Now our trigger window will look like this:

Now, our trigger still won't do much like this, so we need to add in a condition to execute the trigger, and one or more actions to execute. Right now it has no Conditions to trigger it, and no Actions to carry out once its triggered.

Let's think about what we want to do here:

We want the trigger to execute as soon as the mission starts, and we want it to add some cash to player 1.

We'll need some kind of a "timer" to count off zero seconds, and as soon as zero seconds is reached (which will be the instant the mission starts) then we want some kind of action that will add money to player 1. Fortunately for us, the trigger editor can do this very easily!

Go ahead and click on the [New] button under the "Conditions" section and you'll get a window that looks like this:

Now, click on the "down arrow" of the Condition window and you'll see a number of conditions that you can use to trigger your trigger:

We want to use the "Timer", so go ahead and click on "Timer" in the list, and your condition screen will now look like this:

You'll see that the time is set to 0.0 seconds by default, and since this is when we want our trigger to execute, just click [OK] to close this window and get back to the trigger editor. Your trigger window should now look something like this:

What this says now is that our "Add Money to Player 1" trigger will execute when "All of" the conditions listed are met.

Since we only have 1 condition (our zero-second timer), the trigger will execute immediately, as soon as the mission starts.

Now, we need to actually DO something with our trigger. We need to add money to player 1. This is where our "action" comes in.

Go ahead and click on the [New] button under the "Actions" section and you'll get a screen that looks like this:

Now, click the "down arrow" button and you'll bet a big old list of actions you can do, like this:

Go ahead and click on the "Game: Add Resources" option, and your window will change to look like this:

The "Game: Add Resources" action adds money to a player based on either a hard number entered into the "amount" field, or a variable amount set by either a system, or user created variable.

For now, let's just type in "5000" in the "Amount" field, and then click [OK].

Our trigger window should now look like this:

Congratulations! You have now created a working trigger called "Add Money to Player 1".

- It is an "Initially Enabled" trigger, which means that it will execute as soon as the mission starts.

- Its a "One shot" trigger, meaning that it will only execute once when its condtion(s) are met. (a non-one-shot trigger will loop over and over again...)

- It will execute when "All of" the conditions listed are met. Since the only condition listed is a "Timer" set to zero seconds, it will execute immediately.

- Once executed, the trigger will "Add $5000 to player 1" via a "Game: Add Resources" action.

Go ahead and click the [X] button in the upper right of the triggers window to close it, then hit the [Reset] button. Then hit the [Play] button to execute your mission. Now look at the money for Player 1. It should look like this:

You should now be able to build some structures, ships, etc.

Our mission will now start Player 1 (the user) with a single hub and $5000 to build stuff.

But, what if we wanted to start Player 1 with a Station Hub, 2 Podbays, a Hangar and a Shipyard?

Well, you can't just [ADD] the podbays, hangar and shipyard, because there is no way to "attach" them to our Station Hub. However, there IS a workaround to this problem.

Go ahead and play your mission, and use your $5000 to build 2 podbays, a hangar, and a shipyard.

When all 4 structures are built, hit the [ESC] key, then hit the [Pause] button on your mission but DO NOT hit the [Reset] button.

Your Station Hub should now look something like this:

Now click on "Save Current State As..." menu item from the "File" menu of the object panel, and give the mission a new filename and save it. Be sure and save this new mission in your Far Gate\Missions folder so it will display in the single player mission list! It will only appear in the Single Player mission list if it is saved in the Missions folder.

Once you have done a "Save Current State As..." the mission will now START the way it was when you PAUSED it.

Now, hit the [Reset] button and notice what happens!

Your hub retains its Podbays, its Hangar, and the Shipyard at the START of the mission, and the player gets $5000 more dollars as soon as you hit [Play] button.

Ok. So we now have a mission where Player 1 (the user) starts with $5000 bucks, and they now have enough structures to get building quickly.

However, we still don't have a "title" for our mission, nor a "screenshot" for our Single Player load menu, so we're going to add these now, and then add in some enemies to make it interesting.

First, lets get a cool screenshot for our mission to display in the Single Player Mission load list.

Naviagate around your mission unitl you get a shot that looks cool. I'm going to use this angle as my "screenshot":

This angle looks OK, but I don't want all the panels, nor the Heads Up Display. So, I'm going to click my center mouse button (or hit the "I" key) twice to get rid of that stuff. Now, it looks like this:

Now, hit the [ESC] key to exit the main editor window, then click on the "Mission" menu, and the click on the "Mission Info" menu option. It will bring up this screen:

If you have a picture showing in the snapshot box, you can clear it with the [Clear Snapshot] button.

When I hit the [Take Snapshot] button, you'll see that the picture is the same as the camera angle shown above. Now my snapshot looks like this:

Once you have your snapshot taken, go ahead and close this window by hitting the [OK] button.

Next, we'll add a "Title" to our mission so the player will see it when they play the mission.

To add "text" to our mission (title, quote etc.) we're going to create 1 new trigger that will use the "timer" condition (same as our first trigger) to execute "Show: Text" action that will display some text on the screen.

Go ahead and open up your trigger window again off the Mission menu. It should look like it did before:

Now hit the [New Trigger] button to create a new trigger:

Now re-name "Trigger#2" to "Show Mission Name" like this:

Now add a "Timer" condition with [New] button under the Conditions section, but set it to 2 seconds like this:

Now, click the [New] button under the Actions section, and this time we're going to pick "Show: Text" from the actions drop-down list. You should get an action screen that looks like this:

The Location field dictates where the on-screen text will display, and the "Text" box dictates what text will display there.

You can include notes for yourself (is useful when you have a ton of triggers, but we'll skip it for now).

You can also attach a "*.wav" file to this text action which will pay a "sound" or "voice" or even a music *.wav file along with your text. We won't attach a *.wav file right now, but here are the rules for attaching a *.wav file to a text action:

1) The wav file MUST be located in your Far Gate\Sounds folder (or one of the subfolders). To make it easy on yourself, I'd recommend just putting the file in the Far Gate\sounds folder. That way you DON'T need to specify a "path" to the *.wav file.

2) The path MUST be specified in the sound file line IF the *.wav file is in located in a \sounds subfolder. For example, if you wanted to play a *.wav file located in the Far Gate\Sounds\Dialogue folder, your screen would need to look like this:

Remember that if you do add a *.wav file to your mission and you want to distribute it to others, you must also include your custom wave files - and some instructions on where to put them!!!)

For now we'll skip adding a wav file. Go ahead and change the "Location" Field to "Mission Name" and add in some text like this:

Then, click [OK] to close the window. Your triggers window will now look like this:

Now you have a new trigger called "Show Mission Name" which will show "My Cool Mission" (or whatever you typed...) in the "mission name" screen position, 2 seconds after the mission starts. That's a good start, but there's a problem. If we leave our trigger set like this, the on-screen text will never go away!

To get the text to go away, we're going to create a "Child" trigger that gets rid of the text after 10 seconds.

Click on your trigger called "Show Mission Name" and then click the [New Child] button. Your screen will now look like this:

Now let's rename the "child" trigger to "Clear Mission Name" like this:

A "Child" trigger will always execute after its parent. In our example, the "Show Mission Name" trigger will execute after 2 seconds (based on our timer condition) and then the "Clear Mission Name" trigger will execute.

We want to delay the "Clear Mission Name" trigger for another 10 seconds, so we'll add another "Timer" condtion and set it to 10 seconds, and then add another "Show: Text" action but we'll leave the "Text" field BLANK. When you have done that, your screen will now look like this:

Great! Go ahead and hit the [X] button to close the triggers window, and then hit the [Play] button to see what your new triggers do!

You should see your "Mission Name" appear in green letters 2 seconds after the mission starts, then stay on the screen for 10 seconds, then disappear. It should look something like this:

All right! Go ahead and save your mission, if you haven't already. (You should save often in case of a crash!)

Right now we have a mission with an on-screen Title, a fully fleshed out system, a screenshot that will display in the Single Player list (if the mission is placed into your Far Gate\Missions folder!!), a base for Player 1, and some money for the player to begin building stuff.

Now all we need to do is add in an enemy for the player to fight, and we'll be ready to play-test this mission!

First, we'll add in an Entrodii base (a Spire) for Player 2 (enemy of Player 1 by default).

Then we'll set up a new trigger which will set what units the enemy player can build, add some money to that player (player 2) so it can build those units, and then set the AI's aggressivness.

Go ahead and [Reset] your mission if its still playing and then click on Player 2, Squad 1 like this:

Then [Add] an Entrodii "Spire" from the "Entrodii" structures section like this:

Place the Entrodii Spire wherever you want in your mission. I'm going to place my spire fairly close to the Player 1's Station Hub, so we can get into a battle quickly. Here's what my battle zone looks like now:

You'll notice that now Player 1's units are RED, and Player 2's units are GREEN.

What's happened here is that now we're viewing the mission from Player 2's point of view. If we hit [Esc] and click back on Player 1, Squad 1 in our scene list, it will look like this:

The reason James made the editor work this way is for testing purposes.

If you want to view what any player's units are doing while the mission is playing, you can simply click Player X, Squad X in the scene list, and you will automatically switch to that player's point of view.

Ok, now we have an enemy, but it can't do much without some money to build, and some types of units to build.

We'll create our "AI" trigger now.

Open up the trigger editor window again, and create a [New Trigger] like this:

Re-name your new trigger something like "Set AI Stuff". (AI, for those who don't know, stands for "Artifical Intelligence"). Unlike the other triggers we created before, we're going to create our new trigger with 1 condition and MULTIPLE actions so that we only need 1 trigger to do several things for us at one time.

Now your triggers screen should look something like this:

Now we want the AI to start building immediately, so again, we're going to use a "Timer" condition set to zero seconds as the "Condition" for our AI trigger.

Go ahead and add a "Timer" condition and set it to zero seconds (just like we did before) to get this:

Now, we're going to add 3 "actions" for our "Set AI Stuff" trigger which will set parameters for Player 2. The 3 actions we'll add are:

1) "Game: Add Resources" to Player 2 (to give the AI some build money) Let's set our Player 2's cash to $5000 just like Player 1.

2) "Game: Set Available Units" (to set what types of units Player 2 can build, and how many of each it can build) and

3) "Game: Set AI Strategy" (to control how offensive/defensive the computer player will be.)

You've already done a "Game: Add Resources" action for player 1, so just repeat the above process for player 2 to get something like this:

Then click [New] under the Actions section again, but this time pick "Game: Set Available Units". You'll get a screen that looks like this:

First, be SURE and pick Player 2 from the spinner (otherwise you'll wind up RESTRICTING what Player 1 can build...). Then, scroll down to "Entrodii" units like this:

You can left-click on any of these items to incement each unit or structure, or you can [SHIFT]-left-click to decrement each unit or structure. The settings here have several meanings depending on what number they are set to, as well as what player you are setting them for, so let me go over that here:

- Setting PLAYER 1 units to "1" allows Player 1 (the user) to build ANY number of that type of unit.

- Setting PLAYER 1 units to "0" restricts Player 1 (the user) from building ANY of that type of unit.

- Setting PLAYER (2-6) units to "0" restricts the computer (or other human in multiplayer maps) from building any of that kind of unit.

- Setting PLAYER (2-6) units to "1" allows that player to build ANY number of that type of unit (unlimited).

- Setting PLAYER (2-6) units to a number other than "1" or "0" allows that player to build THAT NUMBER of units. For example, setting "Cabal" in our above example to "3" for Player 2, will allow Player 2 to build 3 Cabals, but no more than 3 at any one time.

Another VERY IMPORTANT NOTE: All normal "Build Rules" for the game apply here too. For example if you allow a computer player to build 3 Cabals, but you DON'T allow it to build any "Crystalizers" (i.e. an Entrodii Shipyard), then the computer will NOT be able to build any Cabals because it won't have a structure capable of building them. Likewise, if you try and set the computer player to build Proximan units, but it starts with a Spire, it will never be able to build anything because a Spire can't build Proximan units.

Most of this is common sense, but it deserved some explaination here because setting things wrong can cause some very weird things to happen (like not being able to build anything!) and I've made all these mistakes myself. ;)

Go ahead and set Player 2's units to "1" each for each Entrodii unit (except for "Conduits" which we will set to 12) so your screen looks like this:

The reason we set "Conduits" to "12" is to restrict the number of structures that our Entrodii base will be able to build. Each Entrodii structure needs a conduit to connect it to the Spire, so by setting this to 12, we limit the number of Entrodii structures on that base to 12. Bones and Connectors for the other two races do the same thing as Conduits.

Ok, we're done here, so let's click [OK] to get back to our main trigger window which should now look like this:

The last action we'll add to our "Set AI Stuff" trigger will be a "Game: Set AI Strategy" action for player 2. Click the [New] button under Actions, and then select it from the drop down list. You'll get a screen that looks like this:

Be sure and pick Player 2 from the spinner, and then select a strategy from the drop-down list like this:

Once you have picked a "Strategy" for player 2, hit [OK] to get back to the main trigger window which should now look like this:

Great!

Now you have a new trigger called "Set AI Stuff" which is initially enabled, so it will execute when you reset and play your mission. It will execute at zero seconds (via the "timer" condition), and then will do 3 things: It will add $5000 to player 2, set player 2's available units to build some Entrodii units, and set the AI strategy to be a certain aggressiveness.

Go ahead and click the [X] button to get out of the trigger editor, and then SAVE your mission.

Once you have saved your mission, click on [Reset] then hit the [Play] button then double click on Player 2, Squad 1 in your scene list to view your opponent building!

To switch back to Player 1, you can double click on Player 1, Squad 1, and your view will switch back to Player 1's view.

Now, go ahead and [Reset] the mission, then SAVE it.

There are 3 triggers left for us add to our Single Player mission in order to make it "fully functional":

1) A "Defeat" trigger to let us know if we fail the mission.

2) A "Success" trigger to let us know if we beat the mission.

3) An "Objective" trigger which will tell our player what they need to do to win the mission.

Go ahead and open up your trigger editor window again. Create 3 [New trigger]s and name them "Objective", "Success" and "Defeat" so your window looks like this:

First, we'll create an "Objective" trigger (condition and actions) which will execute at zero seconds, and display a mission objective in the Comm Panel.

First, click on your new "Objective" trigger to select it.

Again, we'll add a "Timer" condition to execute the trigger, but this time we'll set it to 13 seconds like this:

Why 13 seconds? Well, we have already created a "Show Mission Name" trigger that executes after 2 seconds, and then disappears after another 10 seconds. In other words, the mission name won't go away until 12 seconds after the mission starts.

So, we will display the mission objective at 13 seconds so our "Objective" trigger executes AFTER the mission name disappears from the screen.

You don't have to do it this way, but it will look better.

For the "Objective" trigger action, we'll create a [New] "Game: Objective" action and also a [New] "Toggle: Objectives" action.

- The "Game: Objective" action will set our new objective's text, and the

- The "Toggle: Objectives" action will display it on the screen in the Comm Panel.

First, create a new "Game: Objective" action and you'll get a screen that looks like this:

The "index" and "add" action sections we can leave as they are.

"Index" simply gives an "ID" to your objective so you can keep track of it, succeed it, fail it etc. Since we'll only have 1 objective in this mission, we'll leave the index as "1". Our player will only need to destroy all enemy units to "succeed" objective 1. We'll set that up in a minute.

The "Add" action "adds" the objective to the mission. For our mission we want to add this objective immediately when our "Objective" trigger executes. The other options here are success, fail and remove.

We don't want to "succeed" the objective before we "add" it, so we'll "add" it first here, then "succeed" it later with our "Success" trigger.

For the "text" section, let's type in "Destroy All Enemy Units!" as our player's objective so your screen looks like this:

Go ahead and click [OK] to get back to the Trigger window which should now look like this:

OK, so we've created an objective, but we still need to display it to the user. We can do that in our "Objective" trigger with a second action. Go ahead and create a [New] "Toggle: Objectives" action and set it like this:

This will display the Comm panel, animated, with our newly "added" Objective 1 displayed in it. Click [OK] to get back to the trigger window which should now look like this:

Now, our Objective trigger will execute 13 seconds after the mission starts, (or 1 second after the Mission Name disappears), and it will set Objective #1 to say "Destroy All Enemy Units!" and then display that objective on the screen in the Comm Panel at the same time.

Now, we don't want the "Comm" panel to stay up forever, so we'll add a [New] child trigger under our "Objective" trigger that will turn the Comm panel off after displaying it for 10 seconds.

Use another "Timer" condtion and set it to 10 seconds and then add another "Toggle: Objectives" action to turn the Comm panel off. Your child trigger (here listed as Trigger#9) will look something like this:

Notice this time that we are turning the Comm Panel OFF instead of ON.

OK. Now that we have our "Objective" trigger set up, we need to set our "Success" condition and actions so the user can actually "win" the mission.

To our "Success" trigger, we're going to add a new kind of conditon: "All Units Destroyed".

First, click on the "Success" trigger on the left, then create a [New] condition under the conditions section of that trigger. Select "All Units Destroyed" from the "Conditions" list and you'll get a screen that looks like this:

Now, we don't want to succeed the mission if all player 1 units are destroyed, so switch the player to player 2, and click the "All" radio button like this:

Now this condition is set to execute our "Success" trigger when "All of" "Player 2's" units are destroyed, which is what we want.

Go ahead and click [OK] to return to the trigger window which will now look like this:

So what should we do when all Player 2 units are destroyed???

Well, you could do anything you want! But for simplicity's sake we're just going to display a text message on the screen that Says "Mission Successful!" and then fade out the mission after 5 seconds and take the user back to the main Single Player menu.

To do this, we're first going to add another "Show: Text" action under our "Success" trigger and set it like this:

Click [OK] to get back to the triggers window which will now look like this:

We also need to "succeed and display" objective 1 (destroy all enemy units) at the same time as we succeed the mission, so we'll add a second action of type "Game: Objective" to our success trigger and set it like this:

Remember that we have already identified "Objective 1" in our Objective trigger, so we're just making it "Succeed" here.

And then we'll display it in the Comm panel with a 3rd action for our "Success" trigger like this:

Now our "Success" trigger should look like this:

Now, our "Success" trigger will execute when all of Player 2's units are destroyed. It will put Mission Successful! on the screen in the "Mission Name" field. It will also "Succeed" objective 1, and also display that to the user in the Comm Panel.

The last thing we need to do with our "Success" trigger is add a child trigger to "fade" the mission out, and return the user to the main Single Player menu after 5 seconds.

Go ahead and add a [New] child trigger to the "Success" trigger, and set its conditon to a Timer of 5 seconds like this:

Now, we'll add 2 new types of actions under this child trigger:

A "Toggle: Fade" action to fade the mission out like this:

And a "Flow: Goto Mission" action set like this:

The "Fade" action will fade the mission screen out.

The "Goto Mission" trigger with a blank mission name will return the user to the Single Player game menu when this is played in the game. If you specified a mission name here, such as MyCoolMission2.mis, then that mission would load instead of taking the user back to the Single Player menu.

Yes, you can create your own entirely new single-player game using these triggers!!

NOTE: The "Flow: Goto Mission" action will NOT work in the Campaign Editor. It will ONLY work when the mission is played from the Single Player menu in the actual game itself. This was done for editing purposes.

Now, your trigger window should look like this:

By now, adding triggers, conditions and actions should be fairly familiar territory, so I'm just going to show you two screenshots to show you what your "Defeat" conditions and actions should look like, and you can add them in on your own.

Hint: you have already added all of these same actions and conditions with the "Success" trigger, so see if you can spot what the differences are here:

And finally we'll add in another child trigger to our defeat trigger to reload this SAME mission if the user fails. The child trigger will look like this:

You did it!

Congratulations!

Now you have a fully functional Single Player mission with a Player 1 (user) vs. a Player 2 (computer enemy), and all the necessary triggers to fight your first custom space battle!

You can WIN the mission and you can also LOSE the mission, and it will act very similar to one of the single player missions shipped with the game. (albeit a much simpler one!)

Go ahead and play your new mission, and you will see that everything works just like you would expect a single player mission to work.

In the next section, we will cover Advanced Trigger Editing for creating things like cut-scenes, multiple mission objectives, interactive triggers, UI event triggers, using variables for tracking objectives, and some special rules for setting up triggers and variable for Multiplayer Missions.

You will find that going through the basics above is only the tip of the iceberg for what the Far Gate mission editor is capable of letting you create, and once you see how powerful the editor is, you'll be glad you went through the sections above.

If you want to see how we did things for any of the shipping Single Player missions, feel free to open any of them in the mission editor, and pay close attention to how the triggers are set up.

Happy Scripting!


>> GO TO >> Section 4 - Advanced Trigger Editing and Multiplayer Mission Scripting

<< BACK TO MAIN MENU <<