Home   Help Search Login Register  

Author Topic: Zonekiller's AI Vehicle Control System  (Read 1718 times)

0 Members and 1 Guest are viewing this topic.

Offline Zonekiller

  • Members
  • *
    • Zonekiller Page
Zonekiller's AI Vehicle Control System
« on: 29 Oct 2010, 22:46:37 »
This scrip is a big part of my battlefield missions
what it does is invite AI to use the vehicle the script is attached to
also respawn if you wish and it will delete once it is dead
if it gets left somewhere it will respawn or die in 5 min
if someone gets in it at 4 minutes it will rest the clock back and can be left
for 5 minutes again.

works for empty units and AI units as will as players

AI will pick up AI and players can pickup AI not in there group
AI will not pickup a player but you can still get in
sometimes the AI dont want you and will get pissed off and stop
the engine till you get out

even if a player is driving , a AI may get in as gunner

they are not forced into the vehicles so if they dont want to get
in they wont and will sometimes just change vehicles because that
one looks better

there will always be some cargo seats for left for players

how ever you create the vehicle thats how it will spawn
Flying, with crew , without crew , even full of cargo units

just have a group moveincargo into a truck or plane
and it will respawn with a group inside it every time after that

all you need to do is put a this in the init of the vehicle a
place a marker anywhere on the map,

the marker is used to turn off respawn for CTI missions
you can set i as many vehicles to one marker as you want

when not a CTI mission the marker is used to keep the respawn on

it also creates flares and a missle warning for planes and choppers

AI will pull out a dead person and take his place

the script works in ARMA 2 , OA
will work on servers and in single play
will also work with createvehicle

it should not upset waypoints or scripted move commands
they just get there faster

Yes it is a FSM script it works faster with less effort



the init line

nil = [this,west,1,"marker",0] execFSM "FSM\AI_Driver.fsm";

this -- leave as is,

west -- change to what ever side the vehicle is,

1 -- do respawn , 0 == dont,

"marker" -- name of the marker to use as a respawn switch "it works off of colour
change the colour and it will stop respawning,

0 -- used for planes to set there default airport

/*
ARMA 2 OA:
Takistan:
0 = Airport NorthWest
1 = Airport SouthEast
Planes approach all airports from South West

ARMA 2:
Utes:
0 = There is only one airport

chernarus:
0 = Airport NorthWest close to Grishno
1 = Airport NorthEast close to Kranostav
2 = Airport SouthWest close to Balota
3 = Nearest Airport
Planes approach all airports from South East
*/



it will work on all vehicles and addons


you can open a FSM file in notepad just looks very messy
near the top of the file you will see this
the only 5 things you need to adjust everything else it get the info it needs
from the vehicle


       "" \n
       "" \n
       "" \n
       "//    ADJUST SETTINGS BELOW HERE " \n
       "///////////////////////////////////////////////" \n
       "" \n
       "" \n
       "_Script_Diag = 0;" \n
       "" \n
       "" \n
       "" \n
       "_SpareSeats = .35;" \n
       "_lookdis = 80;" \n
       "_outtime = 300;" \n
       "_startdelay = 1;" \n
       "" \n
       "" \n
       "" \n
       "//    DONT ADJUST SETTINGS PAST THIS POINT " \n
       "/////////////////////////////////////////////////////////////" \n
       "_timeout = time;" \n
       "" \n
       "" \n
       "" \n



_Script_Diag = 0; change to 1 if you want to see hints as its working
used your testing

_SpareSeats = .35; that means the AI wont use about 1/3 rd of the cargo seats
so players have room to, set it to 0 and they will take all the seats, 1 and they will
not get in as cargo

_lookdis = 80; this is how far the vehicles will look for AI , choppers is *2 this setting
planes stop looking when they leave the ground, 80 is good for most maps as to big and the AI
dont have time to get in

all vehicles stop looking when full or no one in the _lookdis range

_outtime = 300; the time in seconds before a vehicle will start to die when left
away from its starting point without a driver or player gunner


_startdelay = 1; time in seconds before the script kicks in at mission start
1 or 2 is long enough for moveincargo commands to have kicked in if you
want to start a group in a vehicle

you can download the BIS FSM EDITOR if you want a look inside the script





Download the BIS FSM EDITOR here

http://community.bistudio.com/wiki/FSM_Editor


Download the Script here
http://zonekiller.ath.cx/Scripts/ARMA2_OA/AI_Driver.zip

Or Download the Script here
« Last Edit: 02 Nov 2010, 04:29:53 by Zonekiller »