OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: minimilo on 23 Jul 2004, 21:27:01
-
Im thinking of a mission to take place on Nogova, where i am the leader of a squad of 12 men, andc i go around the island destroying convoys, tank columns etc, but i dont know how to "create" units mid-mission, if there is a guide for this, could someone please give me a link to it, thanks in advance for any help
edit: also, i dont want the units to re-spawn, i just want units to be rendomly created every now and again, pref at the airport, if that makes any difference
-
got the following from the Command Reference
Operand types:
type: String
unitInfo: Array
Type of returned value:
Nothing
Description:
Create unit of given type . Format of unitInfo is: [pos (Position),group (Group), init (String), skill (Number), rank (String)] Note: init, skill, and rank are optional, default values are "", 0.5, "PRIVATE".
Example:
"SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha]
that will make a unit
hope this helps a little
cheers, Philly
-
to be honest, i dont understand s**t about that, is there any tutorials for it, or ne thin like that, in the meantime, ill try to get an understanding of it
-
i couldnt find a tut for this so i will try to explane it best i can...
ok look at this
"SoldierWB" createUnit [getpos object, player]
ok soldierWB is the name of the soldier class,now the next part
getpos object
this is where it will place the soldier, object can be a name of a soldier or a name of a object.
now the last part
player
this is the name of the soldier that you it to join
here the soldier class's that i know of
West Soldiers:
SOLDIERWLAW
SOLDIERWSNIPER
SOLDIERWMG
SOLDIERWAT
SOLDIERWAA
OFFICERW
SOLDIERWMINER
SOLDIERWG
SOLDIERWMEDIC
SOLDIERWSABOTEURPIPE
East Soldiers:
SOLDIERELAW
SOLDIERESNIPER
SOLDIEREMG
SOLDIEREAT
SOLDIEREAA
OFFICERE
SOLDIEREMINER
SOLDIEREG
SOLDIEREMEDIC
SOLDIERESABOTEURBIZON
I Hope This Helps
Cheers, Philly
edit: rewrote because Artak was right...
-
If you do a 'quicksearch' with keywords 'createunit' and 'createvehicle' you'll get some hits and at least one tutorial too. Also, these commands have been dealt with numerous times in the forums, you should find some very good threads about them with the forum search function.
The best advantage in creating the units has to do with reducing cpu strain. That's why they're mostly used in MP missions I think. If you're not struggling with performance issues I'd suggest to insert the units in editor and if needed use the setpos command to move them around. The create spells will require you some effort if you're not that familiar with scripting.
/edit
Just noticed the above example. It won't work because the command is missing some parameters. Mainly the group which the unit will be created in.
-
thanks for point that out Artak i rewrote it...
cheers, Philly