Home   Help Search Login Register  

Author Topic: get the activated waypoint's number? (to use with getWPPos)  (Read 447 times)

0 Members and 1 Guest are viewing this topic.

wamingo

  • Guest
hey guys.

I would like to use getWPPos [group, x] and would like to know if there is some dynamic-ish way to get the number "x" of the next waypoint a group is heading to or from ?
x is 1 at the first wp, 2 and the second, etc.

not too fond of the idea of variables, it's too messy...

Offline Razorwings18

  • Contributing Member
  • **
  • I'm NOT a llama. I checked.
Re:get the activated waypoint's number? (to use with getWPPos)
« Reply #1 on: 17 Mar 2004, 08:38:20 »
Hi wamingo. I can think of a few ways to do that, depending on the level of "dynamism" you're aiming at.
Will you like any of them? For what you're saying, no.

The simplest one:

- In the editor, in player's "Initialization" enter "Group1NextWpt = 1;"

- Now go to each of your waypoints for Group1 in the editor, and in the "On Activation" field enter "Group1NextWpt = Group1NextWpt + 1;"

That's it; now the variable Group1NextWpt will hold the number for the next waypoint for Group1. Of course, this has the limitation of being able to keep track of only a single group's next waypoint.
In order to keep track of several groups, you should use an array, applying the basic principle I just described. I'll leave it at that for the time being; just holler if you really want to go there.

wamingo

  • Guest
Re:get the activated waypoint's number? (to use with getWPPos)
« Reply #2 on: 17 Mar 2004, 14:59:25 »
Hey, thanks for responding.
Your idea will probably work. I'll have to reset the number when reaching restarting cycles and switches... but at least it's better than the variable hell I had in mind before.
Thanks mate, much appreciated. :)