Home   Help Search Login Register  

Author Topic: Waypoint sequences & data storage  (Read 1296 times)

0 Members and 1 Guest are viewing this topic.

CareyBear

  • Guest
Waypoint sequences & data storage
« on: 29 Sep 2002, 17:58:32 »
Is it possible to set a particular waypoint as the current waypoint? I was wondering if waypoints could be used like subroutines or loops, and selected as appropriate by the game logic. I know this sort of effect can be achieved by using doMove, or even getting co-ords and using group move position, but I've got a lot of them, and can't figure a convenient way to store that many co-ords.

Are there any external data sources in OFP that can be used? I know the stringtable.csv is there - can you define your own .csv?

Cheers if anyone can help.

Chudley

  • Guest
Re:Waypoint sequences & data storage
« Reply #1 on: 30 Sep 2002, 00:07:25 »
Have you tried using Markers? ???

If not, here's how.

OK, create 2 markers on the mission editor screen.
Set TYPE to empty. (So they don't show on the map during your missions.) :D
Set NAME to "WP1" and "WP2" respectively.

With that done, place a group of soldiers/tanks/whatever.

In the INIT field of the group leader, type this...
Group1 = group this; [Group1,1] exec "Patrol.sqs"

The first defines the group as 'Group1'.
The next command calls a script called 'Patrol.sqs"

OK, open notepad and copy this...
------------------------------------------------------------
_Group = _this select 0
_NextWP = _this select 1

?(_Next WP == 1): _WP = getMarkerPos "WP1"
?(_Next WP == 2): _WP = getMarkerPos "WP2"

(units _Group) commandMove _WP

@(unitReady (units _Group))
(leader _Group) sideChat "In position, sir."

------------------------------------------------------------

Now, you can make as many waypoints (markers) as you like.

And, you don't need to start at waypoint #1.
If, instead, you want to start at waypoint #3, in the argument for the script put [Group1,3]

Hope this helps
:D

CareyBear

  • Guest
Re:Waypoint sequences & data storage
« Reply #2 on: 30 Sep 2002, 05:59:52 »
Thanks Chudley, but I'm trying to steer clear of a marker solution, as implementing it that way means I have to define over a hundred markers to do what I want  :-\

Not elegant at all. Still, neither are WPs. At least if I use markers rather than WPs to define a (eg: convoy route) I can use the same route definition for another group to have them travel the same road. Guess I will have to do it like that & define arrays of markers for particular actions...

Wanted to use WPs cos that would also make it easy to synchronise actions and also to ensure actions completed before moving to next WP (see below)

Thx neway.

One other thing with that approach - once you use something like

[group1, montignacMarker] exec "moveto.sqs"

----------moveto.sqs----------

_group = _this select 0
_marker1 = _this select 1
_leader = leader units _group select 0

_dest = getPos _marker1
_group move _dest

@unitReady _leader

But the @unitReady never triggers... It definitely doesn't work with doMove or orderGetIn - they never report being ready, which puts me back in guessing how long it takes (eg) the convoy to load up the trucks. Don't want to send them off early, but I don't want to have to write a stack of conditional code for every single marker - esp if I'm going to use them for different purposes..

PS: I know the _leader = leader units _group select 0 line is dodgy - anyone know a better way to return a leader object from a group object?

Any thoughts anyone? Cheers

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Waypoint sequences & data storage
« Reply #3 on: 30 Sep 2002, 06:16:05 »
You can use a switch type trigger to get your unit to go to any waypoint they have (even one they've already been to).

Just sync the switch type trigger with the waypoint one before the waypoint you want your unit to move to and activate the trigger.
If you had enough of these triggers, you could get your unit moving to any of it's waypoints depending on which trigger had activated last ;)

Chudley

  • Guest
Re:Waypoint sequences & data storage
« Reply #4 on: 01 Oct 2002, 03:01:18 »
Hmm, tell you what....

Why don't you send me a .sqm file - completely blank except for markers.

The markers should be defined like this...
[abbreviation of groupname, waypoint number, purpose]

For example the marker for waypoint #5 on Group1's route is a battle station.

markerName = "Gp1_05_BS".

If you can do this, and tell me exactly what you want, I'll make you a script and I GUARANTEE it'll work.
(I hardly ever use waypoints now :D)

Chudley  ;)

Offline uiox

  • Contributing Member
  • **
Re:Waypoint sequences & data storage
« Reply #5 on: 07 Oct 2002, 13:14:35 »


[attachment deleted by admin]

CareyBear

  • Guest
Re:Waypoint sequences & data storage
« Reply #6 on: 07 Oct 2002, 13:57:35 »
Thanks all, but I think I'm giving up on using WPs at all for this. The problems are too great, so I'm going to use co-ords defined in init.sqs as variables instead. Doesn't get *too* messy if I use arrays of them, then just suffer with the move command.

The biggest problem is that I hope to use created groups / units, so obviously, I can't define WPs for them in the editor..   ;D

Thx for the assistance. Going to Solve this topic..

Cheers,

CareyBear  8)