OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Kotp on 20 May 2007, 16:16:13
-
Hi guys , in the middle of making my 1st mission for ARMA , and its going ok .. but seem to be getting a problem with a Group walking thru the Gate. For some reason they get to the entrance and even though the Gate Arm is Up , they decide to walk round the whole base. As you can imagine this is extremely frustrating but I came up with a sneaky cheat so to speak , but not entirely sure how to implement it.
When they get to the gate , I want to run a Command that basicly teleports the whole group about 10 feet inside the gate , Ive created a Marker and called it Teleport and have a trigger on the entrance of the gate that is Synchronised with the Group.
So my question basicly is what would i need to put in the Trigger to move the whole group to the allocated Marker called Teleport which is 10ft inside the Gate.
Many thanks for any help.
-
{_x getpos setmarkerpos Teleport} foreach units thislist
Try that. If it gives an error try putting " " around Teleport.
-
Get this error when trying :- foreach Type String, Expected Code >:(
# - quote removed - bedges
-
please don't quote the post to which you're replying.
-
There is a way to force them through "naturally" without teleporting them:
{_x setdir 35; _x playmove "AmovPercMwlkSnonWrflDf"} foreach units thislist
Use setdir to point them in the direction you want them to go, and then execute the walk animation via playmove. AmovePercMwlkSnonWrflDf means "Move-Erect-Walk-?-weaponRifle-DirectionForward (I forget what the S part means).
They will walk a few steps for each playmove, so you may want a loop to execute it X many times until they are far enough inside the base.
Here's the link to Wiki Move list:
http://community.bistudio.com/wiki/Armed_Assault:_Moves_List
I use this technique to get units to walk down sidewalks instead of their preferred path down the middle of streets.
-
Kotp, did you try with and without the " " around Teleport?
{_x getpos setmarkerpos Teleport} foreach units thislist
and
{_x getpos setmarkerpos "Teleport"} foreach units thislist
???
-
Maybe this works:
{_x getmarkerpos "Teleport"} foreach units thislist
-
Jason, getPos setMarkerPos doesn't make sense. What you want is what -h posted, getMarkerPos. And yes, the quotes are always necessary when you're dealing with markers.
-
How exactly would i get that {_x getmarkerpos "Teleport"} foreach units thislist working ?
I mean when i put it in a trigger , i get an error. Is there anything i need to put before it ?
-
getmarkerpos returns the coordinates of a marker, so what the command you've asked about actually does is say
get the coordinates of the marker called "Teleport" for each of the loons inside the trigger
which is of course why arma doesn't like it. what you want to say in fact is
for each of the loons inside the trigger, set the loon's coordinates to the same as the coordinates for the marker called "Teleport"
and the way to write that is
{_x setpos getmarkerpos "Teleport"} foreach units thislist
you might need brackets () around the getmarkerpos and "Teleport", but i doubt it. it's been a while since i was in the editor...