OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: myke13021 on 22 Jan 2004, 05:12:12

Title: Setting trigger to warp to a specific marker
Post 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?
Title: Re:Setting trigger to warp to a specific marker
Post by: GrimMonkey on 22 Jan 2004, 05:20:07
Try putting a Game Logic right under the marker and call it GL1,
Then write;
Code: [Select]
This SetPos GetPos GL1
Edit: In the On Activation field of the trigger, of course.


Beware the GrimMonkey
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 05:24:24
neg...no workee...did i said i work with 1.46.....and yes, i know resi is better  ;D
Title: Re:Setting trigger to warp to a specific marker
Post by: Artak on 22 Jan 2004, 11:00:13
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?
Title: Re:Setting trigger to warp to a specific marker
Post by: macguba on 22 Jan 2004, 11:04:30
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.

Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 17:37:03
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
Title: Re:Setting trigger to warp to a specific marker
Post by: alimag on 22 Jan 2004, 18:21:32
"_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
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 18:32:49
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
Title: Re:Setting trigger to warp to a specific marker
Post by: Artak on 22 Jan 2004, 19:24:43
Umm.. Try this time without the 'units', like
"_x setpos getmarkerpos {markername}" foreach thislist
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 19:26:26
umm...this is the same line as alimag said...tried this...read post above to see what i got
Title: Re:Setting trigger to warp to a specific marker
Post by: dmakatra on 22 Jan 2004, 20:04:52
Try

"_x setpos getmarkerpos {"target2"}" foreach thislist

:beat: *Gets Shot* :beat:
Title: Re:Setting trigger to warp to a specific marker
Post by: Artak on 22 Jan 2004, 20:23:37
Oh, right  ;D
Well, all I can say is that it should work.

Quote
'_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.
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 20:24:03
unknown operator....thats what i get when i insert your line in it, Armstrong

but thx for tryin
Title: Re:Setting trigger to warp to a specific marker
Post by: Planck on 22 Jan 2004, 20:28:36
I note that the line you were trying has ' instead of "

'_x setpos getmarkerpos ¦#¦{target2}'



Planck
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 20:38:26
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
Title: Re:Setting trigger to warp to a specific marker
Post by: Planck on 22 Jan 2004, 20:41:24
Aye ok........try:

"_x setpos getmarkerpos target2" foreach thislist


Try everthing......experiment.....then write a novel.



Planck
Title: Re:Setting trigger to warp to a specific marker
Post by: macguba on 22 Jan 2004, 20:45:08
# indicates where in the code the error as occurred.
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 20:49:26
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
Title: Re:Setting trigger to warp to a specific marker
Post by: Planck on 22 Jan 2004, 20:57:25
Another experiment for you:

_yourman = list triggername

_yourman setpos (getmarkerpos "target2")



Planck
Title: Re:Setting trigger to warp to a specific marker
Post by: Artak on 22 Jan 2004, 21:01:32
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
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 21:02:11
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
Title: Re:Setting trigger to warp to a specific marker
Post by: Planck on 22 Jan 2004, 21:04:36
aye .....remove the _


Planck
Title: Re:Setting trigger to warp to a specific marker
Post by: Artak on 22 Jan 2004, 21:05:04
Plank ment for you to put it in a script, just left that part unmentioned  ;)
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 21:11:22
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
Title: Re:Setting trigger to warp to a specific marker
Post by: Planck on 22 Jan 2004, 21:11:56
Artak is right .....my mind was on script...........think I will retire from this thread........just as soon as I finish this beer.


Planck
Title: Re:Setting trigger to warp to a specific marker
Post by: Artak on 22 Jan 2004, 21:13:29
Damn. It's got to be the ForEach command which was then propably added later than 1.46  :-\
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 21:21:56
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
Title: Re:Setting trigger to warp to a specific marker
Post by: dmakatra on 22 Jan 2004, 21:22:29
Why the **** do you wanna play with 1.46 if you have 1.91?

:beat: *Gets Shot* :beat:
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 21:28:23
uhm...because my friends do play 1.46?

forgot to press the solved button

:edit:

reopened...someone said he has a solution?
Title: Re:Setting trigger to warp to a specific marker
Post by: gundernak on 22 Jan 2004, 22:31:40
Someone has written you should place a gamelogic near the marker...

I definetely agree!!!

on activation:
"_x setPos getPos gamelogicname" forEach thislist
Title: Re:Setting trigger to warp to a specific marker
Post by: Chris Death on 22 Jan 2004, 22:37:03
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
Title: Re:Setting trigger to warp to a specific marker
Post by: myke13021 on 22 Jan 2004, 22:43:05
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