Jump to content
Sign in to follow this  
VonNexus

Converting an ARMA 2 script to ARMA 2 Operation Arrowhead, need some help

Recommended Posts

So, basically I'm editing a map to be used in MP and I need an addon-free fastrope script. I found one script made by General Carver for ARMA 2. The problem is, that this script has all set for A2 choppers so I need to modify something and add OA choppers. The script is made of of three files, lot of stuff, so you'll have to read a bit.

This is the first one it's meant to be put in the init and contains all the choppers that can use the script, as you can see I added at the end the vehicle classname of the OA Blackhawk:

gcrsrope1 = "none";
gcrsrope2 = "none";
gcrsrope3 = "none";
gcrsrope4 = "none";
gcrsrope5 = "none";
gcrsrope6 = "none";
gcrsrope7 = "none";
gcrsrope8 = "none";
gcrsrope9 = "none";
gcrsrope10 = "none";
gcrsrope11 = "none";
gcrsrope12 = "none";
gcrsrope13 = "none";
gcrsrope14 = "none";
gcrsrope15 = "none";
gcrsrepelvehicle = "none";
gcrsropedeployed = "false";
gcrsdeployropeactionid = 0;
gcrsdropropeactionid = 0;
gcrsplayerrepelactionid = 0;
gcrsplayerveh = "none";
gcrspilotvehicle = "none";
gcrsrapelvehiclearray = ["MH60S", "MV22", "Mi17_Civilian", "Mi17_Ins", "Mi17_CDF", "Mi17_RU", "Mi17_rockets_RU", 

"Mi24_D", "Mi24_P", "Mi24_V", "UH1Y","UH60M_EP1"];
gcrsrapelheloarray = [];
gcrsplayerveharray = [];

Then , this is the second part of the script that actually deploys the rope. I skipped the first part that only checks the player velocity and defines three variables.

if (_playervehclass == "MH60S") then
{
gcrsrope1 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope1 setFlagTexture "";
gcrsrope1 attachto [gcrsrepelvehicle,[-1.25,2,-3]];
gcrsrope2 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope2 setFlagTexture "";
gcrsrope2 attachto [gcrsrepelvehicle,[-1.25,2,-10]];
gcrsrope3 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope3 setFlagTexture "";
gcrsrope3 attachto [gcrsrepelvehicle,[-1.25,2,-17]];
gcrsrope4 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope4 setFlagTexture "";
gcrsrope4 attachto [gcrsrepelvehicle,[-1.25,2,-24]];
gcrsrope5 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope5 setFlagTexture "";
gcrsrope5 attachto [gcrsrepelvehicle,[-1.25,2,-31]];
gcrsrope6 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope6 setFlagTexture "";
gcrsrope6 attachto [gcrsrepelvehicle,[-1.25,2,-38]];
gcrsrope7 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope7 setFlagTexture "";
gcrsrope7 attachto [gcrsrepelvehicle,[-1.25,2,-45]];
gcrsrope8 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope8 setFlagTexture "";
gcrsrope8 attachto [gcrsrepelvehicle,[-1.25,2,-52]];
gcrsrope9 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope9 setFlagTexture "";
gcrsrope9 attachto [gcrsrepelvehicle,[-1.25,2,-59]];
gcrsrope10 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope10 setFlagTexture "";
gcrsrope10 attachto [gcrsrepelvehicle,[-1.25,2,-66]];
gcrsrope11 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope11 setFlagTexture "";
gcrsrope11 attachto [gcrsrepelvehicle,[-1.25,2,-73]];
gcrsrope12 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope12 setFlagTexture "";
gcrsrope12 attachto [gcrsrepelvehicle,[-1.25,2,-80]];
gcrsrope13 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope13 setFlagTexture "";
gcrsrope13 attachto [gcrsrepelvehicle,[-1.25,2,-87]];
gcrsrope14 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope14 setFlagTexture "";
gcrsrope14 attachto [gcrsrepelvehicle,[-1.25,2,-94]];
gcrsrope15 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope15 setFlagTexture "";
gcrsrope15 attachto [gcrsrepelvehicle,[-1.25,2,-101]];
gcrsropedeployed = "true";
hint "Rapel Rope Deployed";
};if (_playervehclass == "UH60M_EP1") then
{
gcrsrope1 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope1 setFlagTexture "";
gcrsrope1 attachto [gcrsrepelvehicle,[-1.25,2,-3]];
gcrsrope2 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope2 setFlagTexture "";
gcrsrope2 attachto [gcrsrepelvehicle,[-1.25,2,-10]];
gcrsrope3 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope3 setFlagTexture "";
gcrsrope3 attachto [gcrsrepelvehicle,[-1.25,2,-17]];
gcrsrope4 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope4 setFlagTexture "";
gcrsrope4 attachto [gcrsrepelvehicle,[-1.25,2,-24]];
gcrsrope5 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope5 setFlagTexture "";
gcrsrope5 attachto [gcrsrepelvehicle,[-1.25,2,-31]];
gcrsrope6 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope6 setFlagTexture "";
gcrsrope6 attachto [gcrsrepelvehicle,[-1.25,2,-38]];
gcrsrope7 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope7 setFlagTexture "";
gcrsrope7 attachto [gcrsrepelvehicle,[-1.25,2,-45]];
gcrsrope8 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope8 setFlagTexture "";
gcrsrope8 attachto [gcrsrepelvehicle,[-1.25,2,-52]];
gcrsrope9 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope9 setFlagTexture "";
gcrsrope9 attachto [gcrsrepelvehicle,[-1.25,2,-59]];
gcrsrope10 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope10 setFlagTexture "";
gcrsrope10 attachto [gcrsrepelvehicle,[-1.25,2,-66]];
gcrsrope11 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope11 setFlagTexture "";
gcrsrope11 attachto [gcrsrepelvehicle,[-1.25,2,-73]];
gcrsrope12 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope12 setFlagTexture "";
gcrsrope12 attachto [gcrsrepelvehicle,[-1.25,2,-80]];
gcrsrope13 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope13 setFlagTexture "";
gcrsrope13 attachto [gcrsrepelvehicle,[-1.25,2,-87]];
gcrsrope14 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope14 setFlagTexture "";
gcrsrope14 attachto [gcrsrepelvehicle,[-1.25,2,-94]];
gcrsrope15 = createVehicle ["FlagCarrierUSA", [0,0,0], [], 0, "NONE"];
gcrsrope15 setFlagTexture "";
gcrsrope15 attachto [gcrsrepelvehicle,[-1.25,2,-101]];
gcrsropedeployed = "true";
hint "Rapel Rope Deployed";
};

The first chopper is the MH60S as the string says, the second string is what I added using the Blackhawk classname.

Then there's a third .sqf file which I'll not post as it simply deletes the rope(actually the "rope" is made of flagpoles attached one to the other) once the player starts to move or selects the action.

Then , to use this script, three triggers are required. Here is what they have in their fields :

First trigger
Condition: local player && alive player && damage vehicle player < 1 && vehicle player in gcrsrapelheloarray && driver vehicle player != 
On Act: gcrsplayerveh = vehicle player; gcrsplayerrepelactionid = gcrsplayerveh addAction ["Rappel from Chopper", "scripts\gcrs\gcrsrepelscript.sqf", "", 0, false, false, "", ""];
On disact: gcrsplayerveh removeaction gcrsplayerrepelactionid

This one checks if the player is alive, if his vehicle is not damaged and if he is in a chopper that is in the gcrsrapeheloarray (that thing in the init)

Another trigger issues the action to drop the rope as soon as it has been deployed and another one forces to drop the rope if the chopper moves too fast.

This is the trigger that actually permits to deploy the rope(checks if the chopper is in the array and if the player and his vehicle sastifie certain conditions):

Condlocal player && alive player && damage vehicle player < 1 && gcrsropedeployed == "false" && typeof vehicle player in gcrsrapelvehiclearray && driver vehicle player == player

On act: local player && alive player && damage vehicle player < 1 && gcrsropedeployed == "false" && typeof vehicle player in gcrsrapelvehiclearray && driver vehicle player == player[

On Deact: local player && alive player && damage vehicle player < 1 && gcrsropedeployed == "false" && typeof vehicle player in gcrsrapelvehiclearray && driver vehicle player == player/CODE]

So this is it, kind of a long post , I know, but I need to figure out how to make this script OA compatible. As you can see I added classnames for the OA in all the files needed, but the action for fastrope doesn't show up, simply.

Thanks in advice for any help you'll give me, please be kind :)

Share this post


Link to post
Share on other sites

Always post entire scripts, never just snippets. :) You're missing the part where the action is added to the vehicles. Can you post a link to the source of this script, since Google and Armaholic are showing nothing but Norrin's rope addon.

Share this post


Link to post
Share on other sites

Your trigger condition seems to be different than what's in that demo mission:

local player && alive player && damage vehicle player < 1 && gcrsropedeployed == "false" && typeof vehicle player in gcrsrapelvehiclearray && driver vehicle player == player

Share this post


Link to post
Share on other sites

Actually I merged the demo mission with my mission and the trigger condition is correct, I just copied and pasted it wrong on the forum.

Your trigger condition seems to be different than what's in that demo mission:

local player && alive player && damage vehicle player < 1 && gcrsropedeployed == "false" && typeof vehicle player in gcrsrapelvehiclearray && driver vehicle player == player

---------- Post added at 07:46 PM ---------- Previous post was at 05:50 PM ----------

Have you tied doing what I did (adding classnames of OA choppers) in the script's files Kylania? Does it work to you?

Share this post


Link to post
Share on other sites

Not yet, work has been too busy to boot my game up other than over lunch real quick. After my next meeting I'll try. :)

Share this post


Link to post
Share on other sites

Thanks Kylania! You're an angel!

Not yet, work has been too busy to boot my game up other than over lunch real quick. After my next meeting I'll try. :)

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  

×