OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: myke13021 on 22 Jan 2004, 05:12:12
-
hay folks...it's me the noob.... ;)
i think this is some very basic stuff but i don't get it to work...
I want to put a trigger, when someone hit it, he will setpos immediately to somewhere else...target will be a marker.
I already tried it with trigger itself and also with script
trigger i set anyone present repeatedly, on activation: this setpos getmarkerpos "markername"
tried this also with a script, using the same syntax but none of this worked...m8 be a problem that i dunno how to access the info's the trigger reveals from the activating unit.
i'm sorry if i waste your time with such a basic crap...but...when i can't get help from here...where else?
-
Try putting a Game Logic right under the marker and call it GL1,
Then write;
This SetPos GetPos GL1
Edit: In the On Activation field of the trigger, of course.
Beware the GrimMonkey
-
neg...no workee...did i said i work with 1.46.....and yes, i know resi is better ;D
-
Place a marker and name it as markername
Place a trigger with the following
Type: anyone, repeatedly
In the on activation field of the trigger:
"_x setpos getmarkerpos {markername}" foreach units thislist
would that work?
-
I was writing a reply when I noticed Artak had just beaten me to it.
Note that at the moment, if you're moving anything at all, you're moving the trigger.
-
still not working...i'm getting a error, saying:
"_x setpos getmarkerpos {markername}" foreach units thislist#"Error type array, expected Object,Group
when i read the line correctly, this needs an additional trigger, named "thislist"...how do i use this...putted one inside and named it "thislist" but still no workee.
I hope i do not annoying you and i'm very happy you try to help me, even whn it's such a noobish crap :)
thx to all who replied till now...you're really cool guys
-
"_x setpos getmarkerpos {markername}" foreach units thislist
Just remove the 'units' in the line above and everything will be fine. 'thislist' is NOT a group so units cannot be put in front of it.
Corrected line:
"_x setpos getmarkerpos {markername}" foreach thislist
Cheers
-
hmmm....thx for the hint alimag...
but still no workee....now getting another error:
'_x setpos getmarkerpos ¦#¦{target2}': Error Invalid number in Expression
i tried to replace the {} with [] and () but didn't helped.
but thx for your time....didn't thought this could be that complicated.
And just to remember...i'm usin 1.46 ;D
-
Umm.. Try this time without the 'units', like
"_x setpos getmarkerpos {markername}" foreach thislist
-
umm...this is the same line as alimag said...tried this...read post above to see what i got
-
Try
"_x setpos getmarkerpos {"target2"}" foreach thislist
:beat: *Gets Shot* :beat:
-
Oh, right ;D
Well, all I can say is that it should work.
'_x setpos getmarkerpos {target2}'
You didn't type it like that in the trigger did you? That's just what the error message makes the line look like, right? Because it's ment to be exactly like we wrote it, with the quotation marks.
-
unknown operator....thats what i get when i insert your line in it, Armstrong
but thx for tryin
-
I note that the line you were trying has ' instead of "
'_x setpos getmarkerpos ¦#¦{target2}'
Planck
-
ehm...this line
'_x setpos getmarkerpos ¦#¦{target2}': Error Invalid number in Expression
is what the error message said on top of the screen....the ¦#¦ isn't part of the line i inserted into the triggers onActivation field...i always used copy paste on every possible solution posted in here to make sure there'll be no typo from my part ;-)
actually it looks like this:
"_x setpos getmarkerpos {target2}" foreach thislist
but not working
-
Aye ok........try:
"_x setpos getmarkerpos target2" foreach thislist
Try everthing......experiment.....then write a novel.
Planck
-
# indicates where in the code the error as occurred.
-
Try everthing......experiment.....then write a novel.
oh believe me itried all sorts of combinations with "" [] {} () ' '
but no workee at all
if someone has an idea which parameters a triggers get and how can i access them...then i m8 be able to do it with a script...i hope
all i need to know is, which parameter reflects the unit which activated the trigger
-
Another experiment for you:
_yourman = list triggername
_yourman setpos (getmarkerpos "target2")
Planck
-
Ok ok ok, this has gone to totally guessing the matter.
I have attached a very small example mission of how to do it, which is btw the way adviced to you many times in this thread.
Create a trigger
Activation by Anyone and Repeatedly
Condition: this
On activation: "_x setpos getmarkerpos {target2}" foreach thislist
Create a marker
name it as target2
walk into the trigger and you WILL be setpossed to the marker. I refuse to accept that version this won't work with 1.46. ::) ;D
G'daem I can't attach the file. I'll open up a http for you.
The zip is named as setpostriggerlist.intro.zip
http://ofptf.kicks-ass.net:23000/pub/
User: guest
Password: guest
-
hmmm...if i read this correctly the upper line goes into Condition and lower line into onActivation field...
Local variable in global space
is the error i get and it points me to _yourman into the condition field
-
aye .....remove the _
Planck
-
Plank ment for you to put it in a script, just left that part unmentioned ;)
-
walk into the trigger and you WILL be setpossed to the marker. I refuse to accept that version this won't work with 1.46. ::) ;D
i'm afraid you had to accept that it wont work with 1.46
opened your sample mission on 1.46...NO WORKEE....closed 1.46, started 1.91...opened your sample mission...guess what...it worked
But thx a lot for the time you spent ( not meant sarcastic, truly thankful)....good idea, wrong version ;)
:edit:
i'll try this right now with the script
-
Artak is right .....my mind was on script...........think I will retire from this thread........just as soon as I finish this beer.
Planck
-
Damn. It's got to be the ForEach command which was then propably added later than 1.46 :-\
-
uhm...nothing helps...i tried with the script...got some error messages like "error type array, expected object" and some others....tried to play around with syntax...replaced " " with any sort of () [] {}...left them away....nothing helps...
i guess it's quite not possible to do what i like to do in 1.46
I thank you all a lot for your help, you're great mates.
I hope i didn't wasted your time too much.
Not solved the way i hoped, but i'll close anyway.
thx again
-
Why the **** do you wanna play with 1.46 if you have 1.91?
:beat: *Gets Shot* :beat:
-
uhm...because my friends do play 1.46?
forgot to press the solved button
:edit:
reopened...someone said he has a solution?
-
Someone has written you should place a gamelogic near the marker...
I definetely agree!!!
on activation:
"_x setPos getPos gamelogicname" forEach thislist
-
Ah you got my message :D
Well then here we go:
It's not the forEach command, which doesn't work in
1.46, it's the {} brackets, that don't work.
You need to do it that way:
"_x setpos getmarkerpos ""target2""" forEach thislist
Or, as gundernak already pointed into the right direction:
Use an object (like a gamelogic) instead of a marker, then you wouldn't need the quotation marks inside the forEach string:
"_x setpos getpos gamelogic" forEach thislist
~S~ CD
-
UNBELIEVABLE......IT WORKS ! ! ! ! !
you guys are great...putted GL and did as you said....
thank you all so much.
it was gettin me mad with all these probs but you showed me the solution
(note for myself: name the peeps in the credits)
ok...now solved...thx again mates