OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Hauk on 12 Aug 2004, 18:53:39

Title: Units in my group get in after I get in
Post by: Hauk on 12 Aug 2004, 18:53:39
Hi everyone,

Just a small problem here that I know one of you out there will be able to answer in seconds ;D

What I'm trying to achieve is that when I get into the 5t truck (westtruck) my units get in after me into the cargo hold so that I dont have to order them in with the "Mount" command.

I know this sounds simple but I can't think of a solution and any input would be greatly appreciated. ;D

Cheers,

Hauk
Title: Re:Units in my group get in after I get in
Post by: Mud_Spike on 12 Aug 2004, 19:03:29
Make a repeating trigger, or a script-snippet with a loop, with the following condition:
Code: [Select]
vehicle playerUnit != playerUnitAnd put the following in OnActivation(/or later in the script):
Code: [Select]
"_x assignAsCargo vehicle playerUnit" foreach units group playerUnit ; units group playerUnit orderGetin true
(Syntax not guaranteed)

What it does is first check if the player's vehicle is not itself, and if so, assigns everyone in the players group as cargo (including the player, but that probably wont be a problem, probably. . . ), and finally orders them to get in.
Title: Re:Units in my group get in after I get in
Post by: Hauk on 12 Aug 2004, 19:06:43
Cheers Mud_Spike I'll give it a shot

Thanks,

Hauk
Title: Re:Units in my group get in after I get in
Post by: h- on 12 Aug 2004, 19:08:14
Why use playerUnit??
Simply player would be enough...

Unless this is MP... ::)
Title: Re:Units in my group get in after I get in
Post by: Hauk on 12 Aug 2004, 19:22:40
No it's a SP mission, why does that affect the game?

Hauk
Title: Re:Units in my group get in after I get in
Post by: Mud_Spike on 12 Aug 2004, 19:26:53
In multiplayer, the 'player' command may obviously return different players depending on which client the script is run on.
Whilst in a SP game, there is only one client, and thus, only one possible result from the 'player' command.

It's up to the mission designer to decide who is considered the "main" player and not.
Title: Re:Units in my group get in after I get in
Post by: Hauk on 13 Aug 2004, 00:08:53
Right I've tested the script and I made an external script with the following syntax:

Code: [Select]
#Vehicle

vehicle player != player

~0.1

goto "Vehicle"

exit

Everything seems ok there, and I typed the following code in the On Activation field of a Repeatedly trigger:

Code: [Select]
"_x assignAsCargo vehicle player" foreach units group player; units group player orderGetin true

Yet when I get in my vehicle they don't get in and just walk around as normal..

Any more suggestions?

Cheers,

Hauk
Title: Re:Units in my group get in after I get in
Post by: h- on 13 Aug 2004, 16:14:58
Put the vehicle player != player in the triggers condition field...
Should work then...