Home   Help Search Login Register  

Author Topic: !HELP! supply drop script not working since Operation Arrowhead.  (Read 2391 times)

0 Members and 1 Guest are viewing this topic.

Offline PartyHead

  • Members
  • *
Hi everyone,
Ive got a problem with a supply drop script i use and have been using for quite awhile.
Since Operation Arrowhead it doesent seem to work anymore, and my scripting skills are still very limited as im still learning. So i thought i would post it here to see if someone, can tell me what has changed in Operation Arrowhead in regards to this script no longer working.
Code: [Select]
_droppoint = "dropzone";
_dropzone = createMarkerLocal ["dropzone", [0,0,0]];
_dropzone setMarkerShapeLocal "ICON";
"dropzone" setMarkerTypeLocal "Destroy";
"dropzone" setMarkerText "Ammo Dropzone";
"dropzone" setMarkerColor "ColorRed";
mapclick = true;
hint "Click on the map to designate a dropzone.";
onMapSingleClick "'dropzone' setMarkerPosLocal _pos,mapclick = false";
waitUntil{!mapclick};
onMapSingleClick "";
waitUntil{!visibleMap};
amo = true;
_pos = getmarkerpos "dropzone";
spawntype0 = "USSpecialWeaponsBox";
spawntype1 = "USVehicleBox";
spawntype2 = "USSpecialWeaponsBox";
_dir = 90;
_airtype = "C130J";
_type = "GUE_Soldier_Pilot";
mygroup = creategroup side player;
_target = createVehicle  ["testsphere2",[_pos select 0,_pos select 1,-10], [], 0, "FLY"];
_target setpos [_pos select 0,_pos select 1,200];
_target setDir _dir;
_vdir = vectorDir _target;
_target setpos [(_pos select 0) + (_vdir select 0) * 26, (_pos select 1) + (_vdir select 1) * 26,200];
_apos = getposasl _target;
_npos = [(_pos select 0) + (_vdir select 0) * -1500, (_pos select 1) + (_vdir select 1) * -1500, 300];
_vehicle = createVehicle  [_airtype,_npos, [], 0, "FLY"];
_vehicle setpos _npos;
_vehicle setDir _dir;
_vehicle setvelocity [(_vdir select 0)*50,(_vdir select 1)*50, 5];
_type createUnit [_npos, mygroup,"pilot=this;"];
_pilot = pilot;
_pilot moveindriver _vehicle;
_pilot reveal _target;
_pilot doMove _npos;
_pilot dotarget _target;
_pilot dowatch _target;
_pilot FlyInHeight 400;
_vehicle FlyInHeight 400;
while {_vehicle distance _target > 40} do
{
sleep 0.1;
if(_vehicle distance _target < 600) then
{
  _pilot FlyInHeight 100;
  _pilot doMove _npos;
 };
};

_bpos = _vehicle ModelToWorld [0,-12,-5.5];
_bomb = spawntype0 createVehicle _bpos;
_bomb setpos _bpos;
_bomb setDir direction _vehicle;
_chute = "ParachuteMediumWest" createVehicle getpos _bomb;
_chute setpos (_bomb ModelToWorld [0,0,3]);
_bomb attachTo [_chute,[0,0,2.5]];

sleep 0.2;

_bpos = _vehicle ModelToWorld [0,-12,-5.5];
_bomb = spawntype1 createVehicle _bpos;
_bomb setpos _bpos;
_bomb setDir direction _vehicle;
_chute = "ParachuteMediumWest" createVehicle getpos _bomb;
_chute setpos (_bomb ModelToWorld [0,0,3]);
_bomb attachTo [_chute,[0,0,2.8]];

sleep 0.2;

_bpos = _vehicle ModelToWorld [0,-12,-5.5];
_bomb = spawntype2 createVehicle _bpos;
_bomb setpos _bpos;
_bomb setDir direction _vehicle;
_chute = "ParachuteMediumWest" createVehicle getpos _bomb;
_chute setpos (_bomb ModelToWorld [0,0,3]);
_bomb attachTo [_chute,[0,0,2.4]];

deletevehicle _target;
sleep 0.05;
_plane FlyInHeight 250;
sleep 1;
_plane FlyInHeight 450;
_pilot doMove [(_pos select 0) + (_vdir select 0) * 800, (_pos select 1) + (_vdir select 1) * 800, 500];
sleep 15;
amo = false;
deletevehicle _vehicle;
deletevehicle _pilot;
deletemarker "dropzone";
Whats happening is that everything works as it should, except now the C130J wont drop its cargo, it just flys over the droppoint and nothing.
Sorry if this code is too long, i wasnt sure how much of a script can be posted.
Ive also posted on the BIS forum but havent got any help as yet.
So im hopeing someone here might have the solution.
Anyway any help would be greatly appreciated.
« Last Edit: 24 Oct 2010, 13:34:32 by PartyHead »


Offline PartyHead

  • Members
  • *
Re: !HELP! supply drop script not working since patch 1.54.
« Reply #2 on: 24 Oct 2010, 10:08:15 »
Are there any errors in the rpt?
http://community.bistudio.com/wiki/arma.RPT

Thanks kju for your responce.
I looked in the rpt file and it was full of different errors, so i cleared it and ran the supply drop script, and then re-checked the rpt file. There was no errors reported relating to the script.

The one thing im thinking it might be is something to do with the creation of the "testsphere2" object.
I still dont know what it is, i havent been able to locate the object in the editor and i carent find it on the Armaholic objects library website.

Have you got anymore suggestions mate. I found the original mission that i got the script from, which was "lkscriptsv08.utes" and it works no more also.
It seems really wierd because its a very simple script :confused:

If anyone has the time could you maybe try the script yourself and see if it works for you, maybe someone who is only running arma2, not A2OA and BAF like im running.
Cheers.
UPDATE:
I have uninstalled and reinstalled arma2 and patched it to v1.07 and the script worked perfectly.
So i then installed Operation Arrowhead and the script stops working.
So something in A2OA is causing the problem.
If anyone has any suggestion as to what that difference might be, please post it.
Cheers.
UPDATE:
After reinstalling A2OA and BAF the script does still work, but only if i start the game using the arma2 exe. and just run arma2, as soon as i run the game with Operation Arrowhead the script works but like i said in my original post the C130J dosent drop its cargo. :confused:
« Last Edit: 24 Oct 2010, 14:08:00 by PartyHead »

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Do you run OA or CO?

Offline PartyHead

  • Members
  • *
Im running Combined Operations.

Is it possible that the "testsphere2" object is either, not available in combined operations or maybe renamed or something ? its the part of the script that if changed would cause the C130J to not drop its cargo on the target.

Maybe its got something to do with _Pos or the "onMapSingleClick": http://forums.bistudio.com/showthread.php?t=108087

Im just struggleing to understand how it can work when i just run arma2 and not work when im running combined operations.
« Last Edit: 25 Oct 2010, 05:14:13 by PartyHead »

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
testsphere2 is part of CO.

Just from looking at it, it seems fine.

Can you attach a simple demo mission to try it please.

Offline PartyHead

  • Members
  • *
Here you go mate.

Ive put an Supply drop and an Vehicle drop in the players action menu.

Run the mission in arma2 and the cargo will drop. :good:
Run the mission in combined operations and the cargo wont drop. :dunno:

Ive also noticed that the approach height of the C130J in CO is much lower then in A2 even though the script is the same script.

Thanks again for taking an interest in this. I hope a solution can be found.

Cheers.

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
I have checked the script. This seems to be the problem:

Code: [Select]
while {_vehicle distance _target > 40} do {
This is never true in OA. As the script makes the plane fly higher past you.
Maybe in A2 the height difference was not yet checked by distance.

Will try to fix it later (maybe tomorrow) myself.
In any case improve the check and it will work again.

Offline PartyHead

  • Members
  • *
Hey thats great kju. :good:

Did you get it to work in CO ?

If you dont mind mate, i'll wait and see if you can fix it, im not quite good enough at scripting as yet, to know how to start playing around with the check like you discribed. I'll have ago though, now that i know which part is causeing the problem.

Thanks very much for checking it out for me. :good:

I'll keep checking this topic in case you post a fix.

Cheers.

Offline PartyHead

  • Members
  • *
Still havent got this to work yet kju :dunno:

Any chance you've had some time to write a fix mate ? :D

Please, Please, Please :)

Im still ??? about what changeing the check part means :dunno:

Learning about what this means and changeing it would also help my scripting skills.