OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: futurehornetdriver on 19 May 2004, 16:37:44
-
I'm finishing up a hostage rescue mission and I wanted to know how do you get an ai unit to join the player unit with a trigger? thanks in advance...
-
Taken from the online comref:
unitArray join group
Operand types:
unitArray: Array
group: Object or Group
Type of returned value:
Nothing
Description:
Join all units in the array to given group. Note: total number of group members must not exceed 12. Note: This function is unsupported in MP in version 1.33 and before.
Example:
[unitOne, unitTwo] join player
:beat: *Gets Shot* :beat:
-
Group your trigger to your unit
Condition: this
On activation: hostage join mygroup
If you have a group of hostages, then: units hostagegroup join mygroup
Initialisation of your unit: mygroup=group this
-
This comes up from time to time. Use the forum search function and have a good hunt if you need to know more - it's all here somewhere.
Remember to use square brackets:-
[loon1] join grpLoon
-
unitOne, unitTwo] join player
Uldics is quite correct, except for the fact that even if you have only one person (hostage) joining the player, you still have to make it into an array, as so:
[hostage] join Player
;D Happy editing.
Wolfrug out.
-
thanks guys..I'll give those a try