Doolittle 0 Posted October 9, 2002 Hi guys! Â I really liked DeaDMeaT's respawn code. Â I was looking for something simpler though and couldn't find it. Â So I wrote one. Â Here's the code, and there's no need to name the vehicles, make and name a respawn pad, or make a trigger! Â This is as easy as it gets! Â Just set the Init of the vehicle you want to respawn as [this] exec "respawn.sqs". respawn.sqs ;Basic Vehicle Respawn ;By Doolittle ;Thanks to DeaDMeaT ;Set a vehicle's Initialization to ;[this] exec "respawn.sqs" ;That's it! _delay = 50 _vehicle = _this select 0 _dir = getDir _vehicle _pos = getPos _vehicle _weapons = weapons _vehicle _count = count _weapons #alive @!alive _vehicle ~_delay _i = 0 #rearm _weaponname = _weapons select _i _vehicle removeMagazine _weaponname _vehicle addMagazine _weaponname _i = _i + 1 ? _i < _count : goto "rearm" _vehicle setDir _dir _vehicle setPos _pos _vehicle setDammage 0.5 ~0.1 _vehicle setDammage 0 _vehicle setFuel 1 goto "alive" Share this post Link to post Share on other sites
Chris Death 0 Posted October 9, 2002 doolittle, have you already tested it? I remember, telling you that adding the weapon names as magazines could cause problems, because weapon name and magazine name is a different thing. _vehicle addmagazine "G36A" wouldn't add a magazine to the unit, because the correct magazine name is: "G36Amag" :edit - OK, i've just taken a look at the comref, and i think your script should work with official vehicles, because vehicle's weapon and ammo names are equal Problem could occur, if somebody's using your script with unofficial vehicles, where those two names (in some cases) aren't equal. ~S~ CD Share this post Link to post Share on other sites
Hit_Sqd_Maximus 0 Posted October 9, 2002 Does it make it damage slowly till it dies? or just every 55 seconds if the vehicle is empty it will respawn. Share this post Link to post Share on other sites
Doolittle 0 Posted October 9, 2002 If left alone for 55 seconds it will blow up and then respawn in 40. That is of course what happens in the Ultimate Vehicle Respawn, not this earlier one above. Doolittle Share this post Link to post Share on other sites
<COPPERHEAD) => 0 Posted October 21, 2002 It doesn't work. Â I made a vehicle and did not name it, put [this] exec respawn.sqs in the init field, made a file called respawn.sqs and put your code into it, and when I start the level it says on the top left of the screen '_weapons = weapons |#|_vehicle': Â error unknown operator _vehicle EDIT: Oh, it does work. But how do I keep it from putting that annoying text up there? Share this post Link to post Share on other sites
Doolittle 0 Posted October 22, 2002 You have it as >> [this] exec "respawn.sqs" << right? Â Try and retype that _weapons = weapons _vehicle line by hand. Â Maybe some character is in there that came over from the cut & paste that we can't see. Â Actually I haven't a clue! Â Make sure _vehicle = _this select 0 is actually working. Â Try ~5 hint format ["%1", _this] at the very top and make sure the vehicle object is being passed in. No actually that wouldn't work. You'd be hit will a whole bunch of stuff when the level loaded. Doolittle Share this post Link to post Share on other sites