OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 10 Jun 2005, 21:00:10
-
Hi all,
I'm trying to use a script that makes a group be spawned from a location to another location when a trigger is activated. But i've run into trouble. Heres what I have so far:
c1 setpos[getpos logic2 select 0, getpos logic2 select 1, +1]
c2 setpos[getpos logic2 select 0, getpos logic2 select 1, +1]
c3 setpos[getpos logic2 select 0, getpos logic2 select 1, +1]
c4 setpos[getpos logic2 select 0, getpos logic2 select 1, +1]
c1/c2/c3 etc being the member of the squad, and l2 being the gamelogic I want them to be spawned to. (I don't know how to just get the whole group to be setposed at once, if anyone could help with that that would be good)
When I activate it, the squad is moved correctly and everything, but I get this error:
'c4 setpos[getpos logic2 select|#| 0, getpos logic2 select 1, +1]': Error getpos: Type Number, expected Object
Unfortunatly I have no idea how to fix this. :-[
Does anyone know where I've screwed up? ;)
Thanks
-
To move the whole squad use something like:
{_x setpos [getpos l2 select 0, getpos l2 select 1, 0]} forEach units group c1
It is a bit ugly though - they will all land on top of each other.
On your error message - have you defined an l3?
Actually it looks like 13 not l3
-
Whoops, thats a typo. Its ment to be l2. I'll change it now. ;)
To save confussion, I'm renaming the logic 'logic2'
Anyway, thanks for the other line. I'll try that.
-
I don't usually bump topics, but I still really need this :-[
Does anyone know why I'm getting the error and how to fix it? :-[
-
i can do better ;)
see attached...
-
Thanks you, I will try that soonist ;D
-
Well, I tried it. It didn't work too well. :-[
It spawned the whole squad to the far corner of the map, either Aa00 or Zj99
Heres what I had in the activation line:
[able,logic2] exec "group_teleport.sqs"
Able being the group, and logic2 being the gamelogic destination.
I though copied the text you privided exactly though. :-[
Anyone know where i've screwed up, or another way of getting the job done? ;)
-
ah right.... well, firstly i can assure you it does indeed work. what it's looking for though is a positional array for the second parameter, so more like
[able,getpos logic2] exec "group_teleport.sqs"
that may do it ;)
-
Yep, that did the trick perfectly ;D
It works now
Thanks for the help Bedges ;)
-
's why we're all here :)