Return to GTAzz Front Page
       

SENDTO Command

Yeah that's right folks, SENDTO is a perfectly solid command... bear in mind it uses the same AI as the Fire Trucks and Ambulances and you realise that it's the best vehicle AI the mission file has to offer.

The key to SENDTO is setting the map up. To make the vehicle drive from one place to another you will need to make sure that the road is continuous, if you have missed any vehicle directions it won't work.

You must make sure you're slopes are defined correctly too. Also something to note is at junctions it can sometimes be prudent to remove traffic that may create a crash with your bus. If you have the bus coming out of a 2-laner at full pelt across a 6-lane freeway there's a high chance it will get clouted by cross traffic.

Therefore leave the vehicle direction for the bus route across, but remove the vehicle arrows for 5-8 cubes to each side. Of course, this means you won't be able to use this stretch as a SENDTO route now - you either chance a crash or limit the routes I'm afraid.

It's a good idea to start the vehicle in an area defined as PLAYER ONLY but with traffic directions, this will prevent your car being spawned on top of a citizen vehicle and also prevent it crashing into something when the first SENDTO fires it off - it does tend to lurch off with the first SENDTO command. Another feature is that to set the performance of your car in SENDTO mode, use GTACars in the 'specs' tab.

The max speed (multiply by 3 for mph top speed) acceleration and braking all effect the AI. As does the tail slide in the steering tab.

The car will accelerate at the SAME rate to it's top speed; if this is high it's a good idea to set the acceleration low.

Once the map is set up ready, now you have to put in you waypoints/checkpoints or whatever you want to call them.

Using DUM_MISSION_TRIGs with a radius of 1 are your bet bets for this as they define the vehicle you are using directly.

It's also worth noting here that the vehicle has to be defined BEFORE the waypoints - that's just the way GTA1 associates objects.

The trick to you waypoints is that the Z-coord has to be 1 above the logical level.

So if your car is on level 4 and you want it to drive along a flat road at that level to a waypoint, that waypoint has to be defined at level 3.

Now to get the vehicle started there's one of two methods:

  1. Make the PLAYER get in and make the car drive like it's being chauffer-driven.
  2. Use DUMMYON to create a driver. I prefer not to use DUMMY_DRIVE_ON.

Remember to REMAP the player at the end of the route if you are chauffer-driving it!

I'll publish the code I use here:

[1]
Guided Tour, 22, Pacific.cmp, 0,
100 1 1 1 1 0

0 1 (1,1,1) TRIGGER 30 255 'level start trigger
1 1 (9024,2880,192) PARKED_PIXELS 66 520 'PLAYERs car

100 1 (139,47,3) PARKED 9 512 'Tour Bus
110 1 (132,43,2) DUM_MISSION_TRIG 60 1 100 'First waypoint
118 1 (117,26,3) DUM_MISSION_TRIG 100 1 100 'second waypoint
122 1 (117,26,3) DUM_MISSION_TRIG 100 1 100 'final waypoint

32100 1 (146,46,2) PLAYER 1 768

-1

0 DONOWT 0 -1 0 0 0

30 STARTUP 0 28000 -1 0 0 '28000 DISABLEs all the triggers
44 ARROWCAR 100 0 0 0 0 'car 100 is used for this
50 STEAL 100 0 0 0 0
52 SPEECH_BRIEF 0 0 0 0 1002 'once stolen inform player
54 ENABLE 110 0 0 0 0
56 DUMMYON 100 0 0 0 0 'DUMMYON prevents PLAYER interfering
58 SENDTO 100 -1 0 110 0 'Begin route

60 DISABLE 110 0 0 0 0 'disable this waypoint
64 ENABLE 120 0 0 0 0 'enable next waypoint
68 SENDTO 100 -1 0 120 0 'proceed to next

70 DISABLE 120 0 0 0 0 'disable this waypoint
72 ENABLE 122 0 0 0 0 'enable next waypoint
74 SENDTO 100 -1 0 122 0 'proceed to next

120 DISABLE 122 0 0 0 0 'disable this waypoint
122 MESSAGE_BRIEF 0 0 0 0 2500 'MISSION COMPLETE
124 SPEECH_BRIEF 0 0 0 0 1009 'Explain mission over
128 REMAP_PED 32100 0 0 0 0 'Change PLAYERs clothes back to normal 398
DONOWT 0 -1 0 0 0 'Finish procedure

That's what's being used in Pacific City and it's working every time now. I haven't expanded this code yet but these are some things you may like to use as belt and braces: CARSTUCK_TRIG - so that if the vehicle crashes and gets wedged against a fence or such you allow the player to get out, or the AI driver gets out and fights on foot. DESTROY - if the vehicle drives off a cliff and lands in the sea, the hospital respawn engine doesn't intervene as you aren't the PLAYER, you're the DUMMYON.

Therefore detect the vehicle being destroyed, remap the player and do PED_OUT_OF_CAR or something to kill the ped manually. Or EXPLODE the car/PLAYER... depends what you want I guess. 8D

Tutorial by cerbera
MSN identity: cerbera@gtahq.com

Site design and all contents Copyright 2001 Simon Marshall & Nick Jones. Grand Theft Auto, GTA2, GTA3 and all related trademarks are the property of Rockstar Games, no challenge to their status is intended or inferred.