Page 1 of 1

AI Driving Perfect only by using a command list and script!

Posted: Wed Jun 25, 2008 1:18 pm
by BrainEater
LoL I can has script that works! :D

btw: Had it for a while, didnt realize anyone would still need it >_<

Code: Select all

(script continuous omfghax
(object_create_anew elite)
(object_create_anew wraith)
(unit elite)
(unit wraith)
(unit_enter_vehicle elite wraith "wraith-driver")
(sleep_until (= (vehicle_test_seat_list wraith "wraith-driver" elite) true) 5)
(ai_attach elite wraith-driving/pwnage)
(ai_command_list wraith-driving/pwnage haxdriver)
(sleep_until (= (and (= (unit_get_health elite) 0) (= (unit_get_health wraith) 0)) true)))
This script means:

It makes a elite biped and a wraith. The script makes them both units, and the elite biped enters the wraith. This script waits untill that seat for the wraith is filled by the elite biped, then continues. From there, it attaches it to a encounter, and gives it a command list. Then it sleeps untill both of them die, which makes it start all over again. They perfectly drive the entire command list.

Why/How this happens:

When the biped goes into the vehicle, it doesn't have it's AI yet, so it thinks its still on the ground, not in a vehicle. When the script attaches the biped to the encounter and gives it the command list, the ai believes its on the ground still, not in the vehicle.

The result? A elite in a wraith that perfectly follows the command list and attacks people.

The command list is just a figure eight around the bloodgulch bases, lol.

Posted: Wed Jun 25, 2008 1:57 pm
by L0d3x
Cool I'll definitely experiment with this.
I'll try it on a warthog :P

Posted: Wed Jun 25, 2008 1:59 pm
by BrainEater
Damn, just figured out, this doesnt seem to work with a warthog >_<

Sorry

Posted: Wed Jun 25, 2008 2:01 pm
by L0d3x
BrainEater wrote:Damn, just figured out, this doesnt seem to work with a warthog >_<

Sorry
Maybe not with the default hog, I'll do some experimenting and post any progress.

Posted: Sat Jun 28, 2008 2:15 am
by L0d3x
Ugh I've tried messing with the hog's tags a bit, I did get it to move, but not in any decent way...

Basically I just made it behave like the ghost :roll:
A hideous sight indeed...

Posted: Wed Jul 16, 2008 11:12 am
by Frak
Check the flag AI Flying in the vehicle tag for the warthog. Then it will be able to drive.

Posted: Wed Jul 16, 2008 11:28 am
by L0d3x
Yes, but not in a controlled fashion. You can't tell it to go to point A, wait a few seconds, then go to point B etc.

Posted: Wed Jul 16, 2008 11:51 am
by Cryticfarm
Some where in the tutorial resource there is one where you edi tags to make them drive good.