OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Lt.Ryan on 05 Feb 2005, 15:52:26

Title: Moveing objects with Trigger
Post by: Lt.Ryan on 05 Feb 2005, 15:52:26
Hi, Im having some trouble with this, I need a maker and some other objects to move to different points on the map using a trigger. I any one could help me out that would be great.
:help:
Thanks

Title: Re:Moveing objects with Trigger
Post by: Terox on 06 Feb 2005, 12:20:19
have the trigger run a simple script that setpos's the items you need moved

On activation: [] exec "movestuff.sqs"

and the script
;;;;movestuff.sqs
_location = getpos (object)
"Mymarker" setmarkerpos _location
objectname setpos _location
[groupname, (groupwaypoint number)] setWPpos _location


object is the item that you are using to setpos things too
objectname is the name of the object/vehicle/player you want moving
groupname is the name of the group the unit is in
groupwaypoint number is the specific waypoint number for the group that you want moving

the only thing you cant move is a guard waypoints and built in island objects

you can even move triggers


without more info thats all i can offer


amended forum colour code correction
Title: Re:Moveing objects with Trigger
Post by: Lt.Ryan on 08 Feb 2005, 01:12:40
Thanks but im having some troble with that last line
Quote
[groupname, (groupwaypoint number)] setWPpos _location [/color]






Title: Re:Moveing objects with Trigger
Post by: Wadmann on 08 Feb 2005, 01:23:42
Lt. Ryan

Delete the [/color] portion as that is a YaBB code for make the line appear in a certain color (red in other lines). I think that he forgot to add [color] at the beginning and that is why that line did not appear red as did the others.

Other than that, you should be able to change the groupname and groupwaypoint number to the appropiate group and waypoint and the script will work fine.


                                                      Wadmann
Title: Re:Moveing objects with Trigger
Post by: Lt.Ryan on 11 Feb 2005, 00:07:09
Thank you, I will have to do that when i get home to my computer right now im at school. thanks  ;)
Title: Re:Moveing objects with Trigger
Post by: Lt.Ryan on 19 Feb 2005, 05:59:16
Ok I have tryed and played around with it but i cant find what i am doing wrong.

lets say i want to move a M2 from posA(being where it started) to posB(a pos being marked by a marker) the M2 name=m2 how would i enter this into the script?

also i want to exec this from the action menu how would i do this...
I have tryed a simple flare script but it dosnt work from action menu, it says "flare.sqs not found" now i know the flare sqs is in the folder and does work
this is how i attepted it
this addaction [Fire Flare,{exec "flare.sqs"}]
but it comes up with that "flare.sqs not found" message
what am i doing wrong?

I am still learning so thanks for the help...
Title: Re:Moveing objects with Trigger
Post by: Terox on 19 Feb 2005, 15:51:30
Ok I have tryed and played around with it but i cant find what i am doing wrong.

lets say i want to move a M2 from posA(being where it started) to posB(a pos being marked by a marker) the M2 name=m2 how would i enter this into the script?

CODE Template =
objectname setpos (getmarkerpos "markername")

Actual code =
M2 setpos (getmarkerpos "posB")
NB>>> if posB is a marker


also i want to exec this from the action menu how would i do this...
I have tryed a simple flare script but it dosnt work from action menu, it says "flare.sqs not found" now i know the flare sqs is in the folder and does work
this is how i attepted it
this addaction [Fire Flare,{exec "flare.sqs"}]
but it comes up with that "flare.sqs not found" message
what am i doing wrong?

I am still learning so thanks for the help...
this addaction [Fire Flare,{exec "flare.sqs"}

if it is displaying an error message .sqs not found.
There can only be 3 reasons
a) flare.sqs[/ doesnt exist
b) you have made a typo error somewhere, either filename or any script line that refers to it
c) you have not specified the correct path for the flare.sqs

what i mean by "C" is that if you placed it in a folder within your mission folder, lets say you placed it in a folder named "Client"

then

exec "flare.sqs"

should be

exec "client\flare.sqs"