Home   Help Search Login Register  

Author Topic: AI Respawn,,,HELP< HELP!!!!!!!!  (Read 525 times)

0 Members and 1 Guest are viewing this topic.

Paco454

  • Guest
AI Respawn,,,HELP< HELP!!!!!!!!
« on: 02 Dec 2003, 19:51:36 »
I have a script that spawns vehicles for me and is very simple. I have edited it to my liking however I'm having trouble with just spawning AI.  Is there a small script to allow 0ne AI unit, a soldier to respawn to it's starting waypoint leaving it's dead body behind where it died. I've got my vehicles script to do just that. I also need to set the number of times it respawns for both scripts. Here is my vehicle script which requires only a timer or switch to set the number of respawns or the amount of time it can respawn. I need help making the AI single soldier respawn script.

----requiredVersion "1.91"
? not local Server : exit
_obj = _this select 0

_pos = getPos _obj
_dir = getDir _obj
_type = typeOf _obj
_group = group _obj
_crew = []
"_crew = _crew + [typeOf _x]" forEach crew _obj
"_x addEventHandler [""Killed"", {(_this select 0) removeAllEventHandlers ""Killed""; deleteVehicle (_this select 0)}]" forEach crew _obj

#clear
_t = 0

#alive
~3
? not alive _obj : _delay = 9; goto "notalive"

? fuel _obj == 1 : goto "clear"
? count crew _obj != 0 : goto "clear"


? _t == 0 : _t = _time + 9
? _t > _time : goto "alive"

"_obj removeMagazine _x" forEach magazines _obj
_obj setFuel 0
_obj setDamage 1
_delay = 1

#notalive
~_delay

~1
_obj = _type createVehicle _pos
_obj setDir _dir

? count _crew < 1 : goto "clear"
Soldier = []
_crew select 0 createUnit [_pos, _group, "Soldier = this"]
Soldier moveInDriver _obj
Soldier doMove getWPPos [_group, 1]
Soldier addEventHandler ["Killed", {(_this select 0) removeAllEventHandlers "Killed"; deleteVehicle (_this select 0)}]

? count _crew < 2 : goto "clear"
Soldier = []
_crew select 1 createUnit [_pos, _group, "Soldier = this"]
Soldier moveInGunner _obj
Soldier doMove getWPPos [_group, 1]
Soldier addEventHandler ["Killed", {(_this select 0) removeAllEventHandlers "Killed"; deleteVehicle (_this select 0)}]

? count _crew < 3 : goto "clear"
Soldier = []
_crew select 2 createUnit [_pos, _group, "Soldier = this"]
Soldier moveInCommander _obj
Soldier doMove getWPPos [_group, 1]
Soldier addEventHandler ["Killed", {(_this select 0) removeAllEventHandlers "Killed"; deleteVehicle (_this select 0)}]


goto"clear"



----------------------------------------------------------------------------------
this script needs a timer or switch to tell it when to quit.

I then need an AI simple script, simular to the one above to respawn AI at there starting waypoint leaving their dead body behind and it too needs a switch or timing to turn it off. Any help with this would be great.


PACO454

Paco454

  • Guest
Re:AI Respawn,,,HELP< HELP!!!!!!!!
« Reply #1 on: 03 Dec 2003, 04:41:40 »
Bump with update. I have been looking throughout the net for this simple Ai soldier respawn script. Most scripts are advanced with advnced features including various addtional scripts for movment and other orders. Could someone help me fix the one I have, which is posted above or help me create one. I just want my Ai soldier to respawn at his first waypoint leaving his body behind and some cotrol over how long they can respawn. Please help. I got the vehicles to do this with no help and I'm sort-a new at this. Oh please with sugar on TOP!

THX Paco454

Paco454

  • Guest
Re:AI Respawn,,,HELP< HELP!!!!!!!!
« Reply #2 on: 04 Dec 2003, 10:24:18 »
Bump.

Just a simple one soldier AI respawn script. Need help.. THX