OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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
-
Make a repeating trigger, or a script-snippet with a loop, with the following condition:
vehicle playerUnit != playerUnitAnd put the following in OnActivation(/or later in the script):
"_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.
-
Cheers Mud_Spike I'll give it a shot
Thanks,
Hauk
-
Why use playerUnit??
Simply player would be enough...
Unless this is MP... ::)
-
No it's a SP mission, why does that affect the game?
Hauk
-
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.
-
Right I've tested the script and I made an external script with the following syntax:
#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:
"_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
-
Put the vehicle player != player in the triggers condition field...
Should work then...