OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: zinco on 28 Mar 2003, 03:44:01

Title: ai in veh respawn (terox or anyone)
Post by: zinco on 28 Mar 2003, 03:44:01
Boy u really got into this.  come along way.  i am still a noob when it come to scripting.......so i thought u may have run across this one.
i want to resawn a uaz with an ai in it as driver.  my uaz moves back and forth and if i hit it with a law it will respawn but it will respawn empty because i just have a standard vrespawm.sqs acting on it.  it seems i would just need to add another variable or operator or whatever it is called like:

[this, "UAZ", 15, "EAST"] exec "vrespawn.sqs"
to go with this in the script:

_vcl = _this select 0
_class = _this select 1
_delay = _this select 2
_side = _this select3

it didn't seem to like my _this select3
i am sure there is a simple way to do this but i do not know all the commands that well.
any help would be appreciated.  i searched and searched for an answer to this but didn't have much luck.
Title: Re:ai in veh respawn (terox or anyone)
Post by: Terox on 28 Mar 2003, 18:59:10
this answer comes from Daywalker, he's more into ai and coops than me


unitname moveindriver vehiclename

eg
ai1 moveindriver uaz1

hope this helps,


he also mentioned to have an ai get into a respawned vehicle you have to create a new ai using an ai create script


ai's cant respawn


additionally he mentioned using a game logic to getpos setpos the ai and warp him to the vehicle using assigndriver.


Hope this helps,  coops and ai is something i have never played with
Title: Re:ai in veh respawn (terox or anyone)
Post by: zinco on 29 Mar 2003, 10:31:44
thanks terox.  actually i figured it out today doing exactly what you said with some help from plaz.

;uaz1
?!(local Server): exit
_vcl1 = _this select 0
_class = _this select 1
_delay = _this select 2
_es1 = _this select 3
_respawnpoint = getpos _vcl1
_azimut = getdir _vcl1
~0.5
#start
@(!canmove _vcl1)
~(_delay - 1)
_vcl1 setfuel .9
_vcl1 setdammage 0.01
deleteVehicle _vcl1
~1
_vcl1 = _class createVehicle _respawnpoint
_vcl1 setdir _azimut
~1
_es1 createUnit [ep1, eo1,"es1 = this"]
~1
es1 moveInDriver _vcl1
~1
[es1]exec "es1move.sqs"
goto "start"