OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CopyrightPhilly on 29 Apr 2004, 03:26:09

Title: Adding A Waypoint By Scipt
Post by: CopyrightPhilly on 29 Apr 2004, 03:26:09
dose anyone know how to add a waypoint by script?

I'm wanting the script to create a BMP then to give it a way point.

I have made the script so that it makes the BMP so all i need now is the part to tell it where to go.

i have had a look round the forms but could not see nothing so i would be gratful as normal for anyhelp

cheers
Philly
Title: Re:Adding A Waypoint By Scipt
Post by: Kammak on 29 Apr 2004, 04:22:25
AKAIK there is no way to create a waypoint...you have to use doMoves, @unitReady, doMove, etc...through scripting

If there IS a way to create waypoints I would love to know about it too.
Title: Re:Adding A Waypoint By Scipt
Post by: CopyrightPhilly on 29 Apr 2004, 04:28:32
Yo Kammak,

could u explane how to use the doMoves commands for me, i only want it to move to one place and thats it...

i could get it to move to a marker..

cheers, Philly
Title: Re:Adding A Waypoint By Scipt
Post by: Kammak on 29 Apr 2004, 05:33:35
Marker named "markerOne"
BMP named "vBMP1"

Code: [Select]
vBMP1 doMove getMarkerPos "markerOne"

or, with a Game Logic or other non-marker object on the map:

Code: [Select]
vBMP1 doMove getpos glOne

where glOne is any object name assigned in the editor.

To do multiple moves,
Code: [Select]
vBMP1 doMove getpos glOne
@unitReady vBMP1
vBMP1 doMove getpos glTwo
@unitReady vBMP1
etc....

Make sense?

Title: Re:Adding A Waypoint By Scipt
Post by: General Barron on 29 Apr 2004, 07:11:42
Actually, you can make a waypoint, but only of type "move" (not seek&destroy, etc).

Instead of using the "domove" command, you should use the "move" command. It's syntax is the same as the "domove" command:

group or unit move position

"Domove" only moves a single unit in a group, whereas "move" actually creates a 'move' waypoint for the group. It doesn't matter if there is only one unit in the group, but if you add more units to a group later, you're going to need to switch stuff anyway.
Title: Re:Adding A Waypoint By Scipt
Post by: Kammak on 29 Apr 2004, 07:37:14
Ah!  Good to know, thanks General Barron.  I've been doing the {_x doMove pos} foreach units group .... thing all the time.  My eyes have completely skipped over the "Move" command in the reference until now.  Time to redo some scripts!  :)

Thanks
Title: Re:Adding A Waypoint By Scipt
Post by: CopyrightPhilly on 29 Apr 2004, 20:43:18
Thanks Guys, Got It Sorted Now...

They Both Work 100% For Me

Cheers, Philly
Title: Re:Adding A Waypoint By Scipt
Post by: General Barron on 02 May 2004, 07:05:01
Ah!  Good to know, thanks General Barron.  I've been doing the {_x doMove pos} foreach units group .... thing all the time.  My eyes have completely skipped over the "Move" command in the reference until now.  Time to redo some scripts!  :)

Thanks

Lol... I know the feeling. I used to be in the exact same boat as you. :)