Post by Freedom-Fighter on Apr 30, 2006 7:57:25 GMT
I have actually brought this up before, but it wasn't as detailed as this one, so I've decided to make up my own thread.
Introduction
Writing scripts is an optional thing to do after the making of your scenario . It lets you to do more extra things such as creating some objectives for the player(s) to follow. You can also set your own victory conditions in the script. Other important stuffs such as the ending epoch must also be written in here.
The script is written in a "half English half computer" language. Note that any text that are written after "//" are not understandable to the computer. So you can put anything behind "//". This is designed to help you for organising you script.
The script is dived into different section. The most important ones are Rules , Definitions , Intilizations and Runs After Cinematic . These are very important and cannot be missed out. If you want to make custom objectves, rules, actions, cinematics, etc. You will need to make seperate sections for them.
First what you need is an ies. document, so go to C:\Program Files\Sierra\Empire Earth II\Scripting Docs and find the file called Boston(IES FILE) or Scriptexampletutorial1, copy any of them and paste it somewhere you can work on(ie. Desktop, unzipped folders, etc.). Open the ducument with either word pad or note pad. Now you should see a completed script. Delete everything in it.
Title of the scenario
First of all, you need to have a title for your scenario, here is the format you should write in:
////////////////////////////////////////////////////////////
// YOUR SCENARIO NAME.ies
//
// Author: YOU
// Copy Right: what, when
////////////////////////////////////////////////////////////
RULES Section
This section is for you to write the objectives, introductions, history hints, etc.
The title:
////////////////////////////////////////////////////////////
// All rules are for the WORLD entity.
////////////////////////////////////////////////////////////
RULES FOR WORLD
Notice that the format of titles for all sections look about the same. The text inside the "/"s are only for you to read, while the text below(RULES FOR WORLD) are for the computer to read.
You can leave this out if you want to, but I think it is nice to fill them in. If you want to do so, here is what you need to write:
SCENARIO
name = "YOUR SCENARIO NAME"
brief = "BRIEF"
//victory = "You are victorious!"
//loss = "You have lost."
hints = "HINTS FOR YOUR SCENARIO"
historicalInfo = "HISTORY OF YOUR SCENARIO"
//description = "DESCRIPTION(This is only for you to read)"
//date = "TIME OF YOUR SCENARIO(Only for you to read)"
To end the Rules section write:
END_SCENARIO
DEFINITIONS Section
This is where you write everything that you will later call in the script(players, groups, units, areas, etc.). The names in here are writen in script language.
Title:
////////////////////////////////////////////////////////////
// DEFINITIONS
////////////////////////////////////////////////////////////
DEFINITIONS
The most important thing is to name the players. For example, if you want to make a scenario with 2 players, the first player will be the human player, which is you. The second is the computer AI. Let's say we will call that player's name "Aliens". Here is what you need to do:
//PLAYERS
constant int HUMAN_PLAYER
constant int ALIENS_PLAYER
Writing groups and areas are similar. Remember you must create the groups and areas in the Map Editor first before you can write in the script. Here is a few examples:
// AREAS
constant string AREA_HELMSDEEP
constant string AREA_ISENGARD
// GROUPS
constant string GROUP_CAPTAINFARAMIR
To end the Definitions section write:
END_DEFINITIONS
INTILIZATIONS Section
You can do most anything you'd like in this section to set the scene for when the scenario starts. Anything set here is evaluated while the the mission loads(Such as weather/seasons, ending epochs, special effects, etc.).
Title:
////////////////////////////////////////////////////////////
// INITIALIZATION
////////////////////////////////////////////////////////////
INITIALIZATION
Again the most important thing in here is the players. Let's use the example we did in the definitions section. Remember, the informations in here needs to be the same as in the definition section Here is what it should look like:
//PLAYERS
HUMAN_PLAYER = 1;
ALIEN_PLAYER = 2;
If you have set up groups and areas in the definitions section, you need to mention them in here too. Here is what they should look like:
// AREAS
NAME OF AREA IN DEFINITIONS = "REAL AREA NAME IN THE MAP EDITOR";
// GROUPS
NAME OF GROUP IN DEFINITIONS = "REAL GROUP NAME IN THE MAP EDITOR";
Here is a few examples:
// AREAS
AREA_HELMSDEEP = "areaHelmsDeep";
AREA_ISENGARD = "areaIsengard";
// GROUPS
GROUP_CAPTAINFARAMIR = "groupCaptainFaramir";
Now if you want to set the ending epoch, you also need to write this in this secion. Let's say all the players ending epoch wil be 12 (Atomic):
SetMaxEpochUI(12);
SetTechEnabled(HUMAN_PLAYER, "Main13", false);
SetTechEnabled(ALIENS_PLAYER, "Main13", false);
The top line only display the ending epoch.
The second line set the human player's ending epoch to 12. "Main13",false means the player cannot go to epoch 13.
The third line set the Aliens player's ending epoch to 12. "Main13",false means the player cannot go to epoch 13.
To end the Intilization section, write:
END_INITIALIZATION
Runs after cinematic section
This section is for you to create cinematics and movies before the scenario starts, unfortunately I couldn't figure out how to, mainly because of the lack of examples in the Scripting Doc. But hopefully someone will discover this soon! Here is what I normally write for this section:
// ////////////////////////////////////////////////////////////
// //RUNS AFTER CINEMATIC, BEFORE OBJECTIVES OPEN
// ////////////////////////////////////////////////////////////
ACTION PreScenInfoPanelHook
SCRIPT WORLD
//nothing here
END_SCRIPT
END_ACTION
To end the script, simply write:
////////////////////////////////////////////////////////////
// EOF
////////////////////////////////////////////////////////////
When you have finished making your script, you can go to the EEII map editor and attach the script to the scenario. First paste you script in here:
My Documents\Empire Earth II\Scripts
Now you need to go to the EEII map editor and go to mission properties. Click on the IES. button and you should be able to find the name of your script. Load it and click accept. You may see an error message once you exit the mission properties. This is because you have made some mistakes in the script. The error will tell you what to do so don't worry.
I do know how to make custom objectives and triggers. But I won't write anymore, because there are already enough stuffs in this thread! Perhaps I'll make another thread about custom objectives later.
If you have any questions, just post them in here, I'm ready to answer them(I hope).
Introduction
Writing scripts is an optional thing to do after the making of your scenario . It lets you to do more extra things such as creating some objectives for the player(s) to follow. You can also set your own victory conditions in the script. Other important stuffs such as the ending epoch must also be written in here.
The script is written in a "half English half computer" language. Note that any text that are written after "//" are not understandable to the computer. So you can put anything behind "//". This is designed to help you for organising you script.
The script is dived into different section. The most important ones are Rules , Definitions , Intilizations and Runs After Cinematic . These are very important and cannot be missed out. If you want to make custom objectves, rules, actions, cinematics, etc. You will need to make seperate sections for them.
First what you need is an ies. document, so go to C:\Program Files\Sierra\Empire Earth II\Scripting Docs and find the file called Boston(IES FILE) or Scriptexampletutorial1, copy any of them and paste it somewhere you can work on(ie. Desktop, unzipped folders, etc.). Open the ducument with either word pad or note pad. Now you should see a completed script. Delete everything in it.
Title of the scenario
First of all, you need to have a title for your scenario, here is the format you should write in:
////////////////////////////////////////////////////////////
// YOUR SCENARIO NAME.ies
//
// Author: YOU
// Copy Right: what, when
////////////////////////////////////////////////////////////
RULES Section
This section is for you to write the objectives, introductions, history hints, etc.
The title:
////////////////////////////////////////////////////////////
// All rules are for the WORLD entity.
////////////////////////////////////////////////////////////
RULES FOR WORLD
Notice that the format of titles for all sections look about the same. The text inside the "/"s are only for you to read, while the text below(RULES FOR WORLD) are for the computer to read.
You can leave this out if you want to, but I think it is nice to fill them in. If you want to do so, here is what you need to write:
SCENARIO
name = "YOUR SCENARIO NAME"
brief = "BRIEF"
//victory = "You are victorious!"
//loss = "You have lost."
hints = "HINTS FOR YOUR SCENARIO"
historicalInfo = "HISTORY OF YOUR SCENARIO"
//description = "DESCRIPTION(This is only for you to read)"
//date = "TIME OF YOUR SCENARIO(Only for you to read)"
To end the Rules section write:
END_SCENARIO
DEFINITIONS Section
This is where you write everything that you will later call in the script(players, groups, units, areas, etc.). The names in here are writen in script language.
Title:
////////////////////////////////////////////////////////////
// DEFINITIONS
////////////////////////////////////////////////////////////
DEFINITIONS
The most important thing is to name the players. For example, if you want to make a scenario with 2 players, the first player will be the human player, which is you. The second is the computer AI. Let's say we will call that player's name "Aliens". Here is what you need to do:
//PLAYERS
constant int HUMAN_PLAYER
constant int ALIENS_PLAYER
Writing groups and areas are similar. Remember you must create the groups and areas in the Map Editor first before you can write in the script. Here is a few examples:
// AREAS
constant string AREA_HELMSDEEP
constant string AREA_ISENGARD
// GROUPS
constant string GROUP_CAPTAINFARAMIR
To end the Definitions section write:
END_DEFINITIONS
INTILIZATIONS Section
You can do most anything you'd like in this section to set the scene for when the scenario starts. Anything set here is evaluated while the the mission loads(Such as weather/seasons, ending epochs, special effects, etc.).
Title:
////////////////////////////////////////////////////////////
// INITIALIZATION
////////////////////////////////////////////////////////////
INITIALIZATION
Again the most important thing in here is the players. Let's use the example we did in the definitions section. Remember, the informations in here needs to be the same as in the definition section Here is what it should look like:
//PLAYERS
HUMAN_PLAYER = 1;
ALIEN_PLAYER = 2;
If you have set up groups and areas in the definitions section, you need to mention them in here too. Here is what they should look like:
// AREAS
NAME OF AREA IN DEFINITIONS = "REAL AREA NAME IN THE MAP EDITOR";
// GROUPS
NAME OF GROUP IN DEFINITIONS = "REAL GROUP NAME IN THE MAP EDITOR";
Here is a few examples:
// AREAS
AREA_HELMSDEEP = "areaHelmsDeep";
AREA_ISENGARD = "areaIsengard";
// GROUPS
GROUP_CAPTAINFARAMIR = "groupCaptainFaramir";
Now if you want to set the ending epoch, you also need to write this in this secion. Let's say all the players ending epoch wil be 12 (Atomic):
SetMaxEpochUI(12);
SetTechEnabled(HUMAN_PLAYER, "Main13", false);
SetTechEnabled(ALIENS_PLAYER, "Main13", false);
The top line only display the ending epoch.
The second line set the human player's ending epoch to 12. "Main13",false means the player cannot go to epoch 13.
The third line set the Aliens player's ending epoch to 12. "Main13",false means the player cannot go to epoch 13.
To end the Intilization section, write:
END_INITIALIZATION
Runs after cinematic section
This section is for you to create cinematics and movies before the scenario starts, unfortunately I couldn't figure out how to, mainly because of the lack of examples in the Scripting Doc. But hopefully someone will discover this soon! Here is what I normally write for this section:
// ////////////////////////////////////////////////////////////
// //RUNS AFTER CINEMATIC, BEFORE OBJECTIVES OPEN
// ////////////////////////////////////////////////////////////
ACTION PreScenInfoPanelHook
SCRIPT WORLD
//nothing here
END_SCRIPT
END_ACTION
To end the script, simply write:
////////////////////////////////////////////////////////////
// EOF
////////////////////////////////////////////////////////////
When you have finished making your script, you can go to the EEII map editor and attach the script to the scenario. First paste you script in here:
My Documents\Empire Earth II\Scripts
Now you need to go to the EEII map editor and go to mission properties. Click on the IES. button and you should be able to find the name of your script. Load it and click accept. You may see an error message once you exit the mission properties. This is because you have made some mistakes in the script. The error will tell you what to do so don't worry.
I do know how to make custom objectives and triggers. But I won't write anymore, because there are already enough stuffs in this thread! Perhaps I'll make another thread about custom objectives later.
If you have any questions, just post them in here, I'm ready to answer them(I hope).