OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Terame on 07 Mar 2004, 08:05:48
-
Hi people,
just did a search on createunit and found a thread that ALMOST helped me ;) Almost...
I wanted to create a small group of enemy units (in this case members of the BIB Malitia) that would surprise the incoming friendlies.
I altered a script description from another thread here, but can't get it to work with a trigger set off by 'West'. I am assuming it needs to be in the activation field as in:
this exec "bib_malitia.sqs"But nothing happens... no error and no BIB units :(
The script I am using
_units2 = units east2
"_x setunitpos up" foreach _units2
"_x allowfleeing 0" foreach _units2
"bib_afr_militia_ldr" CreateUnit [getpos insert1, East1, "E1 = this", 1, "SERGEANT"]
"bib_afr_militia" CreateUnit [getpos insert1, East1, "E2 = this", 1, "CORPORAL"]
"bib_afr_militia4" CreateUnit [getpos insert1, East1, "E3 = this", 1, "CORPORAL"]
"bib_afr_militia3" CreateUnit [getpos insert1, East1, "E4 = this", 1, "PRIVATE"]
"bib_afr_militia4" CreateUnit [getpos insert1, East1, "E5 = this", 1, "PRIVATE"]
"bib_afr_militia2" CreateUnit [getpos insert1, East1, "E6 = this", 1, "PRIVATE"]
"bib_afr_militia" CreateUnit [getpos insert1, East1, "E7 = this", 1, "PRIVATE"]
~2
OBJ5 = True
Thanks in advance :D
-
I think it's :
[this] exec "bib_malitia.sqs"
But I don't see any _this in your script so I might be wrong...
-
I think it's :
[this] exec "bib_malitia.sqs"
But I don't see any _this in your script so I might be wrong...
So I have to have it in the script?
I thought only in the activation field?
Ah well I will give it a try and if it works I will solve the thread :)
-
Why do you think it needs to be executed with 'this'.
By the looks of the script you can execute it with just:
[] exec "bib_militia.sqs"
and it whould work fine.
Note that when you're creating units, you must have already defined a group, which you use in the createunit command. You have the group as East1, where you're creating the units into.
If you don't have the groupname defined, you can do this by inserting a unit in editor and typing in his init field:
East1 = group this; deletevehicle this
Doing this will add the East1 as a name of a group in the mission, and then delete the temporary unit.
-
Why do you think it needs to be executed with 'this'.
By the looks of the script you can execute it with just:
[] exec "bib_militia.sqs"
and it whould work fine.
Note that when you're creating units, you must have already defined a group, which you use in the createunit command. You have the group as East1, where you're creating the units into.
If you don't have the groupname defined, you can do this by inserting a unit in editor and typing in his init field:
East1 = group this; deletevehicle this
Doing this will add the East1 as a name of a group in the mission, and then delete the temporary unit.
OK good news and bad news.
The good news is that they appear now, the bad news only if I alter the unit classes to default types, ie not the bib_Malitia units.
the class names appear correct - unless someone knows something I am missing?
Cheers Artak! You got me a step closer with the deletevehicle tip ;)