OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mad Pup on 12 May 2010, 21:19:47
-
Hi OFPEC, I have a question about waypoints. Is there a way to create, and destroy waypoints for people, in scripts? Or maybe have travel to a certain gamelogic, or object?
Thanks!
~MadPup~ :cool2:
-
You can use the doMove or Move commands. The Move command will make a group move and the doMove command will make an individual unit move, if the unit is the leader, the group will end up following him. The formats are like this:
unit doMove [x,y]
group Move [x,y]
where [x,y] is the x and y map possitions, unit is an individual unit and group is the name of a group.
If you want a unit or group to move to a reference object substitute [x,y] with getPos obj; where obj is the name of the object you want them to move toward.
You cannot destroy editor placed waypoints, but you can use group lockWP true or group lockWP false.
If a unit or group already has editor waypoints that you want them to ignor use the group LockWP true command before you issue the Move or DoMove command. If you want them to resume following existing waypoints then use group LockWP false.
-
In OFP, it was not implemented. BUT, you can set way points at different locations by using the....
[groupOne, 1] setWPPos [x,y] command. By this you can have "MOVE" waypoints set in new locations. You can utilize the cycle waypoint with a switch trigger and have one group, patrol in hundreds of different locations with only a few waypoints. It takes some effort to grab positions to use but is a very effective way of using only a few groups to populate many bases with similar patrol routes. There are always workarounds, it just depends on how creative you can be AND how much time you're willing to invest in it.
-
Okay, I see, I've got to move the waypoint, OKAY :yes:, Another queston: is there a way to tell the cordinates of where I am standing, in a hint form, or something?
Thanks,
~Mad Pup~ :cool2:
-
hint format ["%1", getpos player]
For each additional form of information you add a percent and the command such as...
hint format ["%1""%2", getpos player, getdir player]
-
AHH I see, thanks savedbygrace! Much appreciated! :good:
~Mad Pup~ :cool2: