Page 1 of 1

Tracking waypoints

Posted: Mon Feb 19, 2007 10:13 am
by Waylander76
If I have a set of waypoints that a vehicle drives along
called $wap1 $wap2 etc is it possible to track which waypoint
the vehicle is at as it drives along?

If so how?

Thanks

Posted: Tue Feb 20, 2007 10:38 am
by Waylander76
The idea is to use this for a repairable vehicle.
The vehicle, in this case a tank, starts off in it's
destroyed state.
The allies can repair it and it drives off following
the waypoint path.

This I have mapped and scripted and it works.
Now I want to expand on this so the tank can be blown up
whilst in transit.

Well I have a partial soultion...over each waypoint I placed
a vehicle_trigger.When the tank hits this the trigger fires.

Now I have a variable called level.waypoint that increments when
each trigger is hit.

Code: Select all

tankdrive_trigger1:
$waypoint1_trigger waittill trigger
level.waypoint++
print "Waypoint 1 trigger fired"
print (levle.waypoint)
end

tankdrive_trigger2:
$waypoint2_trigger waittill trigger
level.waypoint++
print "Waypoint 2 trigger fired"
end

tankdrive_trigger3:
$waypoint3_trigger waittill trigger
level.waypoint++
print "Waypoint 3 trigger fired"
end
when the tank is destroyed it stops the destroyed model is spawned and
can be repaired.Once repaired it carries on it's journey to the
next waypoint.
This is the bit that's not working...the tank doesn't move to the
next waypoint.
Is there a way to tell the tank to drive to $wapX
with X being equal to level.waypoint + 1??
E.g $wap3

Code: Select all


tank_drive:
level.waypoint++
$tank drive $("wap" + (level.waypoint))
thread tank_death
$tank waittill drive
goto tank_drive
end


waypoint

Posted: Tue Feb 20, 2007 1:09 pm
by tltrude
Try this:

$tank drive $("wap" + level.waypoint)

In the waittill line, shouldn't it have the word "done" somewhere?

Also, there is a spelling error in the "tankdrive_trigger1" thread -- "levle.waypoint".

Posted: Mon Feb 26, 2007 7:13 pm
by Waylander76
Thanks Tom...works a treat :)