Jump to content
Sign in to follow this  
1para{god-father}

Distance from dropzone advice

Recommended Posts

I am dropping a ammo crate attached to a parachute, and I need to know when It lands if it is close to where the smoke has been popped, if not delete it and place it back where it started.

I am using this in a trigger, but how can I tell if it is outside this zone?

Ammo_1 distance MHQ_SAFE) < 100

I presume i will need to script ? if so some advice would be great

Many thanks

Share this post


Link to post
Share on other sites

OK guys should this work ? when baf_ammo touches the ground I need it to show the correct hint depending if it is within range.

waitUntil {(getPos baf_ammo select 2) < 1};

If ((baf_ammo distance MHQ_SAFE) < 50) then
{
hint "Drop on Target"
}
Else
{
hint "Drop to far away"
}


Share this post


Link to post
Share on other sites

do not seem to get any hint once the ammo box is on the ground

baf_ammo = createVehicle ["BAF_BasicWeapons", getMarkerPos "Cargo", [], 0, "NONE"];
baf_ammo setvehiclevarname "baf_ammo";

//// Mission variables
ammo_Loaded = false;
ammo_Unloaded = false;
ammo_Near = false;
ammo_End = false;
ps_smoke=false;
//// Mission flow

waitUntil {ammo_Loaded};
///////////////////Make Marker////////////////////
ammo_marker = createMarker["ammo_marker",[getPos ammo_can select 0, getPos ammo_can select 1]];
ammo_marker setMarkerShape "ICON";
ammo_marker setMarkerText "Drop Off area";
ammo_marker setMarkerType "DOT";

waitUntil {ammo_Near};
/////Create Smoke make it loop
ps_smoke=true;
sleep 1;
while {ps_smoke} do
{
 _smoke="SmokeShell" createVehicle [getPos ammo_marker select 0,getPos ammo_marker select 1, .2];
 sleep 25;
};

waitUntil {ammo_Unloaded};
/////check when on ground and if withing distance of drop point

waitUntil {(getPos baf_ammo select 2) < 2};

If ((baf_ammo distance MHQ_SAFE) < 30) then
{
hint "Drop on Target well done"
}
Else
{
hint "Drop to far away "
};

Edited by psvialli

Share this post


Link to post
Share on other sites

_smoke="SmokeShell" createVehicle [getPos ammo_marker select 0,getPos ammo_marker select 1, .2];

should be getMarkerPos

Share this post


Link to post
Share on other sites

Hmmm i get the smoke ok but ill change it thanks.

but i get no hint, it like the following does not work i do not even get the hint "ground hit"


waitUntil {(getPos baf_ammo select 2) < 2};
hint "Ground Hit ";  // to see if it fires
If ((baf_ammo distance MHQ_SAFE) < 30) then
{
hint "Drop on Target well done"
}
Else
{
hint "Drop to far away "

};

I know that the crate is called baf_ammo as i can delete if via a trigger so it is 100% called baf_ammo.

Any suggestions on how i can work out when the crate hits the ground ?

Thanks

Share this post


Link to post
Share on other sites

ah yes, saw it now:

after each hints you are missing ;

should be

hint "Drop to far away";

Edit: something still wrong with your code, my trigger wont accept it in a spawn...

nvm, trigger did not accept comment fields in spawn.

code works fine when you apply ; at end of the hints.

Edited by Demonized

Share this post


Link to post
Share on other sites

it should be 'drop too far away.'

this will not solve your problem.

Grammar nazi to the rescue!

Good luck,

nic

Share this post


Link to post
Share on other sites

Err thought it worked but still no hint comes up ?

waitUntil {(getPos baf_ammo select 2) < 2};

this should fire when it touched the ground ?

Edited by psvialli

Share this post


Link to post
Share on other sites

i tested with player instead of baf_ammo and it worked fine, (height of object is below 2 meters) and player distance to a man called MHQ_SAFE was below 30 meter

I think then your problem is the name of the crate, try comment out the setVehicleVarname line in your script.

Is all your variables done properly when loading unloading, how do you do that, if you post the whole process of the drop from creation to land it would be easier to debug, also try running the scripts through squint to check for errors.

Since you say you get the smoke, then this line is your problem then i asume:

waitUntil {ammo_Unloaded};

script never recives the ammo_Unloaded variable, try adding a hint after waituntil line or at the end of the script to check that it goes past the waituntil or the hint lines.

Edited by Demonized

Share this post


Link to post
Share on other sites

Thanks have been playing around, and this is a strange one!

I replaced the hints with vehicle spawn just to test it as it should work , and guess what the vehicles spawn in as they should a merlin if I miss and a apache if I am on target !

But no hint comes up, any idea why a hint would not show ?

Share this post


Link to post
Share on other sites

maybe you are testing on dedi server only and i think ive heard that hints dont work on dedis, maybe try switch out hint with unitname sidechat

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  

×