OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Kotp on 20 May 2007, 16:16:13

Title: Gate Bug ?
Post 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.
Title: Re: Gate Bug ?
Post by: JasonO on 20 May 2007, 16:33:17
Code: [Select]
{_x getpos setmarkerpos Teleport} foreach units thislist
Try that. If it gives an error try putting " " around Teleport.
Title: Re: Gate Bug ?
Post by: Kotp on 20 May 2007, 16:43:54
Get this error when trying :- foreach Type String, Expected Code  >:(



# - quote removed - bedges
Title: Re: Gate Bug ?
Post by: bedges on 20 May 2007, 17:23:04
please don't quote the post to which you're replying.
Title: Re: Gate Bug ?
Post by: johnnyboy on 20 May 2007, 19:06:34
There is a way to force them through "naturally" without teleporting them:

Code: [Select]
{_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.
Title: Re: Gate Bug ?
Post by: JasonO on 21 May 2007, 20:36:40
Kotp, did you try with and without the " " around Teleport?

Code: [Select]
{_x getpos setmarkerpos Teleport} foreach units thislist
and

Code: [Select]
{_x getpos setmarkerpos "Teleport"} foreach units thislist
 ???
Title: Re: Gate Bug ?
Post by: Cheetah on 21 May 2007, 20:38:31
Maybe this works:

Code: [Select]
{_x getmarkerpos "Teleport"} foreach units thislist
Title: Re: Gate Bug ?
Post by: DucusSumus on 22 May 2007, 18:55:38
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. 
Title: Re: Gate Bug ?
Post by: Kotp on 23 May 2007, 15:29:29
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 ?
Title: Re: Gate Bug ?
Post by: bedges on 23 May 2007, 15:35:03
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

Code: [Select]
{_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...