OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: chills on 13 Jan 2003, 01:07:04
-
This is a script which respawns vehicles and its the best by Doolitle! But I need to have my crew of tanks/Helicopter crew respawn inside the vehicles instead of telling them to enter the vehicles. I added some coding but it doesnt seem to work.
If any of you script experts can have a look and tell me where i am going wrong?
;Script by Doolittle, dbircsak@earthlink.net
? not local Server : exit
_obj = _this select 0
_pos = getPos _obj
_dir = getDir _obj
_type = typeOf _obj
_
#clear
_t = 0
_vcl = _this select 0
_driver = _this select 1
_gunner = _this select 2
_commander = _this select 3
_driver moveindriver _vcl
_gunner moveingunner _vcl
_commander moveincommander _vcl
#alive
~3
? not alive _obj : _delay = 10; goto "notalive"
? fuel _obj == 1 : goto "clear"
? count crew _obj != 0 : goto "clear"
? _t == 0 : _t = _time + 22
? _t > _time : goto "alive"
"_obj removeMagazine _x" forEach magazines _obj
_obj setFuel 0
_obj setDamage 1
_delay = 10
#notalive
~_delay
deleteVehicle _obj
~1
_obj = _type createVehicle _pos
_obj setDir _dir
goto "clear"
-
What are the arguments you pass to the script:
I see that u use two time _this select 0, and is this the complete script ???
-
Yes this is the whole script, ecxept I put this in
_vcl = _this select 0
_driver = _this select 1
_gunner = _this select 2
_commander = _this select 3
_driver moveindriver _vcl
_gunner moveingunner _vcl
_commander moveincommander _vcl
All i want is my crew spawn into the newly spawned vehicle.
Any Ideas? ???
-
Question,
do you create the crew with a createUnit or is the crew already created and do you call the script in the following manner:
[vehicle, driver, gunner, commander] exec "veh_respawn.sqs"
If not you have to create the crew of the vehicle.
-
What i do is use it in multiplayer. The crew are part of my group, so they are already made. It works when we first join the game but when the new vehicle spawns we do not move in the vehicle.
[vehicle, driver, gunner, commander] exec "veh_respawn.sqs" I use that in the vehicle.
Have you any ideas? I have tried to solve this one for along time and I'm getting frustrated :-[