Get SaintAxe&Ror SpeechMaker Now And build your conversations easily ! |
This is a page that displays some short How-To to help using OFDR Mission Editor for basic mission editing.
These How-To are not the "best way" or are not endorsed by CodeMasters in any way. They are just the result of the long time I spent coding a lot of Single Player / Coop missions with simple and complex scripting (+ 115) .
Link : Official LUA Documentation
HOWTO 7 : Naming convention
This is a habit I made about naming the elements while using the OFDR Mission Editor.
By default, the ME set an autogenerated name to the elements you put on the map. Then , you have a ton of stuff called vp08type92 , vp11type95 , ip28pleng , em71lg3l , ip03plmtpldr , triggerzoneI2 , particlesysteI1 , and so on...
If you make a mission and your Level script contains 1000 lines of code, it may simply be unreadable ! And it will be very hard to search something in the code.
So, here is how I work. This is my way, but keep in mind that your way should be the best for you. The goal is that you find something in the code , even several month after, without any lose of time and avoiding an entire analysis of what you wrote previously...
Say we create a mission based in the village called "Madlenka".
In this location , we set some PLA units and vehicles. So, I'll use "mad " prefix for the names of the units because these are the three letters that begin Madlenka.
1. I put several sentries in Wooden gun emplacements :
- Wooden gun emplacements will be called "madWge1 ", "madWge2 ", "madWge3 ", etc (mad : Madlenka / Wge : Wooden gun emplacement)
- Sentries will be called "madSentry1 ", "madSentry2 ", "madSentry3 ", etc
2. There are 3 Spec Ops fireteams that are patrolling in the village :
- Each echelon is called "eMadSo1 ", "eMadSo2 ", "eMadSo3 " : (e : echelon / Mad : Madlenka / So : Spec Ops)
I ever use the letter "e " as prefix for the name of an echelon.
I also set 2 chained waypoints for each echelon. (for patrolling).
Only the first waypoint of each chain is named : "wpMadSo1 ", "wpMadSo2 ", "wpMadSo3 "
(wp : waypoint / Mad : Madlenka / So : Spec Ops)
3. I also put 3 tanks with their crew :
- Tanks are called "madTank1 ", "madTank2 ", "madTank3 "
- Then as I said before, each tank crew will be called : "eMadTank1 ", "eMadTank2 ", "eMadTank3 "
4. I put a gunship that is intended to patroll around Madlenka, following circular path :
- The helo is called "madHelo "
- The crew is called "eMadHelo "
- The first waypoint of the circular path is called "wpMadHelo " (wp : waypoint / Mad : Madlenka / Helo : Helo)
5. I also put 2 triggerzones :
- One big circular triggerzone around Madlenka called "trigMadlenka "
- One squared triggerzone around the big house (HQ) called "trigMadHq "
Look at the MSSN file to see how I named units in Skoje or the boats near White Fang.
The important thing is that you choose a naming convention that fits your needs and that is logical for you. But most important thing is that you use the same naming convention along the building of all your maps.
The choice of appropriate names will save you a lot of time when debugging or simply building your mission. Believe me. And personally, I hardly do not comment the code as it is easily readable
Be creative
If I set several echelons inside the town of Mologa, I'd call them like that :
- eMologaSentry1 , eMologaSentry2 (sentries are not moving)
- eMologaPatrol1, eMologaPatrol2 (patrols are .... patrolling)
- eMologaSo1, eMologaSo2 (These are Special Ops)
- eMologaMg1, eMologaMg2 (These are machinegunners)
- eMologaSn1, eMologaSn2 (These are snipers)
- eMologaAt1, eMologaAt2 (These are anti-tank team)
BEWARE : a name cannot contain the "_ " underscore sign.
(Underscore sign is used to separate parameters in events.)
BEWARE : For some reason, a Dev at CM staff decided that variables that were passed to an event become to lower string. For a better readability , I prefer continue writing names with capitals. I have just to be more attentive when working with events.
If you are not aware of this or in doubt, just write all names in lowerstring.
TIP:
Select an entire echelon (the echelon icon + the units) and rename it.
For example, if you select a entire echelon and you rename it "eMologaSentry1 ", each unit will be renamed "eMologaSentry1I1 " ,"eMologaSentry1I2 " , "eMologaSentry1I3 " etc.
Download
Download MSSN file : SAR_HT7_Naming.zip
