Jump to content
Sign in to follow this  
Chairborne

paradrop question

Recommended Posts

Hi, i've been editing for 2 weeks only so don't get too upset if my questions are stupid. :)

So i am creating my first mission through the editor and i want to learn how to use it in a decent way.

I know there are many threads about dropping stuff out of an airplane (which i read already) and here is how i solved this (i tried by myself because there's no point in learning something if you just copy a wall of text from someone else).

First i created a C130 (not really important, any type of vehicle would work), then set two waypoints.

In the first in the OnAct module i wrote this:

veh1 = createVehicle ["HMMWV_M2", [(getMarkerPos "dropzone1") select 0,(getMarkerPos "dropzone1") select 1, 200], [], 0, "none"];

par1 = createVehicle ["ParachuteBigWest", [(getMarkerPos "dropzone1") select 0,(getMarkerPos "dropzone1") select 1, 200], [], 0, "none"];

par1 setdir 90;

veh1 attachto [par1]

And in the second WP a script to delete the airplane because once the drop is done i have no use for it any longer.

Everything works fine, the parachute opens and the humvee is attached to it in the right direction (same as C130 for the sake of realism :rolleyes:) and they fall to the ground at the chute' speed.

Now i want to drop 2 vehicles/ammo crates or whatever, i tried to add another waypoint next to the first one with the same script (obviously changing parameters accordingly) and another marker next to the one already existing but here is the problem.

While the first vehicle is created normally, the second one is created with some "lag". I think this is because of the detection system for the second waypoint, the airplane completes the first waypoint normally and then takes a few seconds to set the new one (that by the time has already been completed since it's close to the first one and on the path of the airplane). I tried to use only one waypoint combining both dropped objects with the sleep command but it doesn't work and says "Error Generic Error in Expression" with a |#| before the sleep command. Here is the script i used in the OnAct:

veh1 = createVehicle ["HMMWV_M2", [(getMarkerPos "dropzone1") select 0,(getMarkerPos "dropzone1") select 1, 200], [], 0, "none"];

par1 = createVehicle ["ParachuteBigWest", [(getMarkerPos "dropzone1") select 0,(getMarkerPos "dropzone1") select 1, 200], [], 0, "none"];

par1 setdir 90;

veh1 attachto [par1];

sleep 0.5;

veh2 = createVehicle ["HMMWV_M2", [(getMarkerPos "dropzone2") select 0,(getMarkerPos "dropzone2") select 1, 200], [], 0, "none"];

par2 = createVehicle ["ParachuteBigWest", [(getMarkerPos "dropzone2") select 0,(getMarkerPos "dropzone2") select 1, 200], [], 0, "none"];

par2 setdir 90;

veh2 attachto [par2]

I read the sleep voice on the wiki but couldn't figure out what was wrong.

Also is there any difference between activating this through an in-game waypoint rather than an execVM command and an external .sqf script file? Is there any difference in the language between the in-game scripting and .sqf scripting? I tried to put the script in an sqf file in the mission folder and added the line "paradrop.sqf" in the waypoint'script module but nothing happens, there isn't even any error report with the showerror command. It's like the script isn't even running. Can someone help me?

Share this post


Link to post
Share on other sites

it would be better to call a script because sleep won't work in the editor unless you wrap the code and spawn the script.

null=[] spawn {
veh1 = createVehicle ["HMMWV_M2", [(getMarkerPos "dropzone1") select 0,(getMarkerPos "dropzone1") select 1, 200], [], 0, "none"];
par1 = createVehicle ["ParachuteBigWest", [(getMarkerPos "dropzone1") select 0,(getMarkerPos "dropzone1") select 1, 200], [], 0, "none"];
par1 setdir 90;
veh1 attachto [par1];
sleep 0.5;
veh2 = createVehicle ["HMMWV_M2", [(getMarkerPos "dropzone2") select 0,(getMarkerPos "dropzone2") select 1, 200], [], 0, "none"];
par2 = createVehicle ["ParachuteBigWest", [(getMarkerPos "dropzone2") select 0,(getMarkerPos "dropzone2") select 1, 200], [], 0, "none"];
par2 setdir 90;
veh2 attachto [par2];};

This should work now work from within the on act but I didn't test it.

Share this post


Link to post
Share on other sites

Yes it's working. Thanks a lot mate!

Share this post


Link to post
Share on other sites

Hi, I'm new here and quite new at editing and scripting as well.

I adapted what AlphaSixtyOne wrote to my misson and it worked just fine. But I want to know if there's a way to create a vehicle next to an object or player, not on a marker. That would help me alot.

Thank you.

Share this post


Link to post
Share on other sites

The second part is where the location is, the red part here:

veh2 = createVehicle ["HMMWV_M2", [b][color="#FF0000"][(getMarkerPos "dropzone2") select 0,(getMarkerPos "dropzone2") select 1, 200][/color][/b], [], 0, "none"]; 

So instead of the red part you'd replace it with something like this:

veh2 = createVehicle ["HMMWV_M2", [b][color="#FF0000"]position unit1[/color][/b], [], 0, "none"]; 

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  

×