OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: futurehornetdriver on 19 May 2004, 16:37:44

Title: ai join player's team?
Post 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...
Title: Re:ai join player's team?
Post by: dmakatra on 19 May 2004, 17:26:30
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:
Title: Re:ai join player's team?
Post by: Uldics on 19 May 2004, 17:32:58
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
Title: Re:ai join player's team?
Post by: macguba on 19 May 2004, 19:29:16
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
Title: Re:ai join player's team?
Post by: Wolfrug on 19 May 2004, 19:29:51
Quote
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.
Title: Re:ai join player's team?
Post by: futurehornetdriver on 19 May 2004, 21:52:37
thanks guys..I'll give those a try