OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Captain Crunch on 26 Jan 2004, 23:56:42
-
Hi!
I try to teleport a group of troops to a marker. I get an error message that says:
"Type group, expected object"
In the "Init" field of the group leader I typed this:
"Police01 = Group This"
And in an "On Activation" field of a waypoint, I have typed this:
Police01 SetPos GetMarkerPos "PoliceM01"
Looking at the error message, (Type group, expected object) I suppose it is possible. (Because of the "Type group" part)
What am I doing wrong? Well, if it's even possible!!
Thanks a lot!!!
crunch
-
try changing
Police01 SetPos GetMarkerPos "PoliceM01"
to
"_x setpos setpos getmarkerpos "PoliveM01"" Foreach units group Police01
its probably wrong, you could always put
This setpos setpos getmarkerpos "PoliveM01"
in each of the units init field :P
-
"_x setpos getmarkerpos {policem01}" forEach police01
:edit - yeah hammy u were faster but wrong if there hasn't
been changed anything lately.
"_x setpos getmarkerpos "policem01"" forEach police01
doesn't work, as it should be:
"_x setpos getmarkerpos ""policem01""" forEach police01
:note - watch the dbl-quotation marks
np. anyway - and no offense meant in anyway :D
~S~ CD
-
Never mind...
:beat: Got beaten by many before me :beat:
-
The underlying points is that some commands take a group as an argument, and other commands take a unit. Some commands take either. The comref usually makes it clear.
The error message in this case is very helpful: the game found a group when it was expecting an object. When you get a message like this look through your code to find a group - and there's your problem.
The proposed solution should work just fine.
-
errm - scripts are always useful and handy, but in this case,
i would suggest the one-liner ;)
Maybe you could use a script, if u don't want them to get
beamed into the very same spot, but even that wouldn't
be a problem, as they would imidiately step back into the right
place of their formation, once needed.
:what the hell is goin on in this thread??
one types a reply, just to edit it, because others already
started typing a reply :o ;D
~S~ CD
-
pfft i never knew it had to be double quotes ;)
-
:what the hell is goin on in this thread??
one types a reply, just to edit it, because others already
started typing a reply :o ;D
~S~ CD
;D
Guilty... :D
I'm alawys too slow on replying... same info ten times won't do any good ;)
-
Thanx guys!!
Though neither syntax actually worked!!
I played around with You guys' ideas and mixed a little of Your responses.
Here is the correct syntax:
"_X SetPos GetMarkerPos ""PoliceM01""" ForEach Units Police01
And to MacGuba:
Hi! I remember having such problem (even just recently) :-[ You had actually told me the same thing!!! I'm sorry! :-[
I'll watch myself, I'll think about my problem longer before posting next time!
Many thanks again!!
-
Though neither syntax actually worked!!
I played around with You guys' ideas and mixed a little of Your responses.
Here is the correct syntax:
"_X SetPos GetMarkerPos ""PoliceM01""" ForEach Units Police01
So what's then been wrong with the syntax, i posted in my
2nd reply?
Anyway, if my first suggestion didn't work for you, i suppose
you're using pre-resistance then - don't you?
If not, suggestion 1 should work aswell, if yes, {} brackets
were not supported by OFP engine before one of the
patches after 1.75
~S~ CD
-
no, I have version 1.91
The part missing was the "Units" word!! between "ForEach" and "Police01".
And about Your syntax, sorry, I made a mistake and didn't typed the right brakets in!!
I had used [] instead of {}!
But thanx!! ;D
-
Ah yeah, i can see now :D
I might have been working too much with arrays
the last days then.
Ya know: "_x dosummit" forEach ARRAY
"_x dosummit" forEach units group/unit
you see forEach array doesn't require the units, but
forEach group/unit does.
That's because: units group/unit represents an array of
units aswell, while the name of a group just represents
an object.
hmm - will this accusation get me out of ma typo ::)
;D
~S~ CD