Tracking waypoints

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Tracking waypoints

Post 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
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Post 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

User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

waypoint

Post 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".
Tom Trude,

Image
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Post by Waylander76 »

Thanks Tom...works a treat :)
Post Reply