Jump to content
Sign in to follow this  
jandrews

spawn objects/wrecks on ocean floor AND trigger sync ??'s

Recommended Posts

I don't see much in way to define this, anyone have a easy answer? I want to spawn a wreck in random location ocean floor, not float down b/c I have black box attach to it and detaches after sleep; I also want to have a trigger sync to blackbox so once its grabbed by nato, the trigger pops and ends task, (I know in editor when you sync trigger to object you get "VEHICLE" for activation), so would I do something similar?

// spawn target

_rndPos = [getMarkerPos _marker,50,100,20,2,-45,0,[],[]] call BIS_fnc_findSafePos;

_wipeout = createVehicle ["B_Plane_CAS_01_F",[((_rndPos) select 0), ((_rndPos) select 1),0],[], 2, "NONE"];
_wipeout setDir random(360);
_wipeout setDammage 0.85;
_blackbox = createVehicle ["Land_SurvivalRadio_F", getPos _wipeout, [], 0, "CAN_COLLIDE"];
_blackbox addAction ["Secure blackbox", "scripts\blackbox.sqf"];
_blackbox attachTo [_wipeout,[0,15,.5]];
_chemblue = createVehicle ["Chemlight_blue", getPos _wipeout, [], 0, "CAN_COLLIDE"];
_chemblue attachTo [_wipeout, [0, +10, .5]];
sleep 2;
detach _blackbox;

_trg = createTrigger["EmptyDetector",getPos _wipeout];
_trg setTriggerArea[10, 10, 0, false];
_trg setTriggerActivation["VEHICLE", "NOT PRESENT", false];
_trg setTriggerStatements["this","",""];

Edited by JAndrews1

Share this post


Link to post
Share on other sites

you could spawn it on the floor by using getTerrainHeightASL as the height value for the position and it will return the ocean depth at that location. (you'll need an X and Y value to send to this command, then the Z can be replaced by this using the set command). Ripped from an old project that never got completed back in beta so it might not work as it did then now. For the other part you could simply use a

waitUntil{myVariableIsTrueSoBlackboxWasActivated};  //the variable will need to be set to false inside init.sqf before this and the blackbox script are ran.

then inside blackbox.sqf just set the variable to true.

Edited by austin_medic

Share this post


Link to post
Share on other sites
you could spawn it on the floor by using getTerrainHeightASL as the height value for the position and it will return the ocean depth at that location. (you'll need an X and Y value to send to this command, then the Z can be replaced by this using the set command). Ripped from an old project that never got completed back in beta so it might not work as it did then now. For the other part you could simply use a

waitUntil{myVariableIsTrueSoBlackboxWasActivated};  //the variable will need to be set to false inside init.sqf before this and the blackbox script are ran.

then inside blackbox.sqf just set the variable to true.

Ok I will take a stab at this, basically I need to place this

{blackboxActivatedFalse}; 

into the InitServer.sqf AND then place at end of objective

// WAIT UNTIL
waitUntil {blackboxActivatedTrue};

if (blackboxActivatedTrue) then {

hint "blackbox recovered!";

};

blackBox.sqf

{blackboxActivatedTrue}; 
blackbox removeAction myaction; 
deletevehicle blackbox;
hint "";
exit

Regards to the vehicle, I suppose I could just let it float to sea floor, would

_blackbox attachTo [_wipeout,[0,20,0]];

be better to use so blackbox stays close to wipeout and then player can just take once they find it?

Edited by JAndrews1

Share this post


Link to post
Share on other sites

If you attach the box you run the risk of it being sunk into the terrain.

Share this post


Link to post
Share on other sites
If you attach the box you run the risk of it being sunk into the terrain.

well I am open to suggestions, I know there are several ways to do it. I suppose I could spawn it separate and see how it falls. lol.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×