GeneralTofu 0 Posted March 29, 2017 Hi! I am making a mission where you need to destroy a vehicle and if you don't before it lands then the mission fails. How would I do this? I already used !alive and set task to succeed if you destroy the vehicle but I am not sure how to fail the task if you don't before it lands. Thanks Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted March 29, 2017 Depends on how you set up the mission. You could use 2 triggers set to anybody, first one checking if the chopper is dead and mission is set to win. Condition of Trigger 1 named MyWinCondition1: !alive YourChopperName onAct: _task = ["YourTaskName", "SUCCEEDED",true] spawn BIS_fnc_taskSetState; deleteVehicle MyLoseCondition1; Condition of Trigger 2, checking if chopper is on ground and alive, named MyLoseCondition1: alive YourChopperName AND isTouchingGround YourChopperName onAct: _task = ["YourTaskName", "FAILED",true] spawn BIS_fnc_taskSetState; deleteVehicle MyWinCondition1; Cheers Share this post Link to post Share on other sites
killzone_kid 1326 Posted March 29, 2017 I have also replied but this piece of shit forum software ate my reply. So here is goes again: Condition isTouchingGround heli On activation if (alive heli) exitWith {failMission "fail"}; endMission "win"; 2 Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted March 29, 2017 Two birds with one condition. I like it. Cheers Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 29, 2017 For some reason the script makes the heli explode when touching the ground... I only used this: alive YourChopperName AND isTouchingGround YourChopperName because i want the trigger to activate a lose through the menu. Share this post Link to post Share on other sites
R3vo 2652 Posted March 29, 2017 28 minutes ago, killzone_kid said: I have also replied but this piece of shit forum software ate my reply. So here is goes again: Condition isTouchingGround heli On activation if (alive heli) exitWith {failMission "fail"}; endMission "win"; ...and it shat it out here :P 1 Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 29, 2017 Ok so now I tried this:ConditionisTouchingGround heli ------ It works and fails the mission but it still blows up the heli... Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted March 29, 2017 Very unlikely that a trigger condition will blow up any game object. What do your onAct fields look like? Is the chopper touching anything with its rotor? Could be anything causing the chopper to be destroyed, the trigger condition most certainly isn't the cause for that. Cheers 1 Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 29, 2017 I don't have anything written in onAct and moments before touch down i used camera to zoom and see if it was hitting objects, it wasn't. and now even if the trigger is deleted it still blows up even though it used to work before Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 29, 2017 This is so weird, without changing any triggers or anything 1 time it landed and 1 time the heli just exploded Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 29, 2017 pls do not that the heli is carrying something but it has a drop cargo waypoint and that is where everything explodes Share this post Link to post Share on other sites
killzone_kid 1326 Posted March 29, 2017 1 hour ago, R3vo said: ...and it shat it out here magic Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 30, 2017 Guys i still cant fix the heli exploding, im using a drop cargo waypoint and it goes down and explodes, anything i can check? Share this post Link to post Share on other sites
sarogahtyp 1105 Posted March 30, 2017 what I dont get is why r you using the drop cargo waypoint? Is the heli carrying another vehicle and tries to drop it and the mission should fail if that vec touches the ground? Or is it just the heli which tries to land somewhere and if the heli touches the ground then the mission should fail? I m not a pro with waypoint usage. Maybe there is a simple answer for my questions. Maybe you could try WP Unload or WP Transport Unload if you dont carry anything. Share this post Link to post Share on other sites
Guest Posted March 30, 2017 2 hours ago, GeneralTofu said: Guys i still cant fix the heli exploding, im using a drop cargo waypoint and it goes down and explodes, anything i can check? Why does it explode ? Is it just magically exploding while in the air or does it crash into a building or smthg ? Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 31, 2017 18 hours ago, sarogahtyp said: what I dont get is why r you using the drop cargo waypoint? Is the heli carrying another vehicle and tries to drop it and the mission should fail if that vec touches the ground? Or is it just the heli which tries to land somewhere and if the heli touches the ground then the mission should fail? I m not a pro with waypoint usage. Maybe there is a simple answer for my questions. Maybe you could try WP Unload or WP Transport Unload if you dont carry anything. yes the heli is carrying a drone Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 31, 2017 18 hours ago, harmdhast said: Why does it explode ? Is it just magically exploding while in the air or does it crash into a building or smthg ? as the drone touches the ground it explodes Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted March 31, 2017 What's happening at that waypoint? Is the chopper landing on top of the drone? You're being very vague here. Try this in the drones init: _test = [this] spawn { params ["_drone"]; _drone allowDamage false; waituntil {isTouchingGround _drone}; sleep 10; _drone allowDamage true; }; Cheers Share this post Link to post Share on other sites
GeneralTofu 0 Posted March 31, 2017 1 hour ago, Grumpy Old Man said: What's happening at that waypoint? Is the chopper landing on top of the drone? You're being very vague here. Try this in the drones init: _test = [this] spawn { params ["_drone"]; _drone allowDamage false; waituntil {isTouchingGround _drone}; sleep 10; _drone allowDamage true; }; Cheers It works, the drone doesn't blow up but even when the player shoots the pilot of the heli carrying it the drone is invinclible, is there a way maybe: If the heli pilot is dead then the drone becomes destroyable but if the heli pilot is alive the drone is invincible? Share this post Link to post Share on other sites
Guest Posted March 31, 2017 _test = [this] spawn { params ["_drone"]; _drone allowDamage false; waituntil {isTouchingGround _drone || !alive driver YourChoperName}; sleep 10; _drone allowDamage true; }; Should do the trick Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted March 31, 2017 You could also use this inside the chopper and/or drone init: this allowdamage false; this addEventHandler ["Hit",{ params ["_vehicle"]; _vehicle allowdamage true; }]; Will have the vehicle undestroyable unless it's being fired upon. Kinda wonky solution if the first hit is from an AA missile it won't do any damage. Cheers Share this post Link to post Share on other sites
killzone_kid 1326 Posted March 31, 2017 1 hour ago, Grumpy Old Man said: You could also use this inside the chopper and/or drone init: this allowdamage false; this addEventHandler ["Hit",{ params ["_vehicle"]; _vehicle allowdamage true; }]; Will have the vehicle undestroyable unless it's being fired upon. Kinda wonky solution if the first hit is from an AA missile it won't do any damage. Cheers Would Hit EH work at all? Asking because vaguely remembering disabled damage not triggering any damage EHs 1 Share this post Link to post Share on other sites
GeneralTofu 0 Posted April 1, 2017 7 hours ago, Grumpy Old Man said: You could also use this inside the chopper and/or drone init: this allowdamage false; this addEventHandler ["Hit",{ params ["_vehicle"]; _vehicle allowdamage true; }]; Will have the vehicle undestroyable unless it's being fired upon. Kinda wonky solution if the first hit is from an AA missile it won't do any damage. Cheers 9 hours ago, harmdhast said: _test = [this] spawn { params ["_drone"]; _drone allowDamage false; waituntil {isTouchingGround _drone || !alive driver YourChoperName}; sleep 10; _drone allowDamage true; }; Should do the trick Ok Thanks Guys! It worked! Here is the finished mission if you guys are interested to play it. (Sorry If I am not allowed to post links)http://steamcommunity.com/sharedfiles/filedetails/?id=895621994 Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted April 1, 2017 3 hours ago, killzone_kid said: Would Hit EH work at all? Asking because vaguely remembering disabled damage not triggering any damage EHs Just tested it, Hit EH does not fire when allowDamage is set to false. Kinda weird, since the object is still being hit (you'll get impact sounds and visuals). Cheers Share this post Link to post Share on other sites