SOFTACT 10 Posted March 25, 2014 Hey Guys, Working on a MHQ project, and im having some "Morals" problems. Basically, because i dont have a working script for vehicle re-spawning "Tophe's" I need to be able to keep the name & init of the vehicle, but that script does not work properly with that. So theres the morals: Either i have the MHQ un-destructible, or let it blow up, and never recover it. So i was thinking if there is a way to prevent it from exploding, keeping it at the border line from Exploding and being completely damaged. Having the vehicle rendered use-less until recovered. If there is a setting for this, i would love to hear about it. Thanks Share this post Link to post Share on other sites
chessmaster42 11 Posted March 25, 2014 If you want to keep the original object it gets pretty tricky. But if you're okay with using the art assets that are already wreckage then it's pretty easy. In order to keep it from going to a damage value of 1.0 (totally destroyed) you have to setup a damage handler script on the object to capture and process the damage so that you can restrict how damage it can get. Share this post Link to post Share on other sites
SOFTACT 10 Posted March 25, 2014 Do you know of any good ones, im searching the database right now for something similar to restricting it. Unless i have a loop script waiting for the vehicle to re-heal after it finds it !alive. If {!alive mhq1} then { mhq1 setdamage 0.9; }; Something like that maybe? Share this post Link to post Share on other sites
tpw 2315 Posted March 25, 2014 (edited) Try a handledamage eventhandler: mhq1 addEventHandler ["HandleDamage", { private ["_veh","_dmg","_overalldamage"]; _veh = _this select 0; _dmg = _this select 2; _overalldamage = (damage _veh) + _dmg; if (_overalldamage > 0.95) then { _veh setDamage 0.9; }else { _veh setDamage _overalldamage; }; } ]; Edited March 25, 2014 by tpw Share this post Link to post Share on other sites
Tajin 349 Posted March 25, 2014 You could reassign the name and init upon respawn. Check out these commands: https://community.bistudio.com/wiki/setVehicleVarName https://community.bistudio.com/wiki/vehicleVarName It largely depends on how flexible your init-script is but its a much cleaner solution than trying to keep the old object. Share this post Link to post Share on other sites