Ajira 10 Posted October 29, 2009 :confused:Ok.. here's the situation.. i spawn a vehicle using the following code: HMMWV = "HMMWV_Armored" createVehicle (position HMMWVSpawner); HMMWV setdir 45; HMMWV setVehicleInit "[""HMMWV""] execVM ""scripts\vehicle-bluefor_init.sqf"""; the init script is as following: scriptName = "vehicle-bluefor_init.sqf"; _unit = (_this select 0); [West,"HQ"] sideChat _unit + " is now available on base."; waitUntil {!alive _this}; // Vehicle died, clean it up. [West,"HQ"] sideChat _unit + " died."; deleteVehicle _unit; //- all works as planned, and CROSSROAD tells me "HMMWV is now available on base." as it spawns. The problem however is... once the thing blows up, nothing happens. I should be getting a message, and it should be cleaning up after itself; but nothing happens. It's as if the waitUntil {!alive _this}; doesn't trigger. I've tried it with: waitUntil {!alive _this}; waitUntil {!alive this}; waitUntil {!alive _unit}; but it never triggers. Any ideas ? :confused: Share this post Link to post Share on other sites
shuko 59 Posted October 29, 2009 "[""HMMWV""] execVM You're passing a string instead of an object to the script? Share this post Link to post Share on other sites
Ajira 10 Posted October 29, 2009 *facepalm* :banghead: nevermind, fixed.. thanks :blush: Been staring at the init script for so long, not thinking about the actual spawn script, hehe :p Share this post Link to post Share on other sites
Ajira 10 Posted October 29, 2009 funny how "vehicleVarName" always returns empty in MP... anybody got an idea how to get that to show ? Share this post Link to post Share on other sites
IndeedPete 1038 Posted October 29, 2009 hint format ["My vehicle is the %1",myVehicle]; Share this post Link to post Share on other sites
Ajira 10 Posted October 29, 2009 Yeah, that gives the name of the vehicle, but not the description/vehicleVarName.. it's different :( Share this post Link to post Share on other sites
shuko 59 Posted October 29, 2009 Description is not the vehiclevarname either. ;) Share this post Link to post Share on other sites
Big_Daddy 10 Posted October 30, 2009 didn't have it listed there, but you do have the processInitCommands, right? Share this post Link to post Share on other sites
Ajira 10 Posted October 31, 2009 Yes, but i forgot to post it on the forum. by the way, if i use this in MP on a dedicated server: _unit = format ["%1", _this]; [West,"HQ"] sideChat _unit + " is now available on base."; it gives a load of crap like like "#<number> <number> AV8B.P3D is now available on base." :confused: Share this post Link to post Share on other sites
shuko 59 Posted October 31, 2009 ("HMMWV_Armored" createVehicle (getpos HMMWVSpawner)) spawn { _this setdir 45; [West,"HQ"] sideChat "HMMWV is now available on base."; waitUntil {!alive _this}; [West,"HQ"] sideChat "HMMWV died."; deleteVehicle _this; }; Share this post Link to post Share on other sites
Ajira 10 Posted October 31, 2009 hmm.. i prefer to use an SQF for the init, because we want to put in access control as well later on (e.g. only pilots can enter a plane, etc ) Share this post Link to post Share on other sites
shuko 59 Posted October 31, 2009 (edited) And what is stopping you putting all the init stuff after this? [West,"HQ"] sideChat "HMMWV is now available on base."; It's irrelevant in what script you run the commands. Edit: heck, you can just do this in it: _this execvm "myhmmwvinit.sqf"; You dont need to run init as init just for the sake of it. All init does it run commands affecting the unit. Those commands can be issued directly to the created unit without unnecessary passing of init. Edited October 31, 2009 by Shuko Share this post Link to post Share on other sites
Ajira 10 Posted October 31, 2009 ah you mean make the trigger say it and then spawn the vehicle ? hmm... Share this post Link to post Share on other sites
shuko 59 Posted October 31, 2009 You can run this from script/trigger/whatever. It creates a hmmwv, passes the created object to the spawn (same as execvm but without a separate file). In it you can do whatever you like to the created hmmwv. nul = ("HMMWV_Armored" createVehicle (getpos HMMWVSpawner)) spawn { _this setdir 45; [West,"HQ"] sideChat "HMMWV is now available on base."; // // put the access control stuff etc here // waitUntil {!alive _this}; [West,"HQ"] sideChat "HMMWV died."; deleteVehicle _this; }; Share this post Link to post Share on other sites
Ajira 10 Posted October 31, 2009 (edited) sweet, thanks man :D Edited October 31, 2009 by Ajira Share this post Link to post Share on other sites