Jump to content
Sign in to follow this  
frattonstation

Vehicle drop from C130

Recommended Posts

Sorry for being thick (im not good at these things but trying to learn). But i used this in a invisible H:

nul=[getPos drop1,"HMMWV_TOW",getDir drop1] execVM "vehdrop.sqf";
and also added the script to the mission folder made by you Tajin. Called it vehdrop.sqf instead (dropspawn.sqf originally). The problem is the C130 does come flying in, but doesnt drop anything. What am i doing wrong? And sorry for having you reply -again-.

EDIT: And it really doesnt fly over the "H", but breaks away before. That might be the values in the script that needs tweaking though?

Alex

Edited by Alex72

Share this post


Link to post
Share on other sites
Sorry for being thick (im not good at these things but trying to learn). But i used this in a invisible H: and also added the script to the mission folder made by you Tajin. Called it vehdrop.sqf instead (dropspawn.sqf originally). The problem is the C130 does come flying in, but doesnt drop anything. What am i doing wrong? And sorry for having you reply -again-.

EDIT: And it really doesnt fly over the "H", but breaks away before. That might be the values in the script that needs tweaking though?

Alex

did you name the Heli Pad "drop1" without the quotes?

Share this post


Link to post
Share on other sites
did you name the Heli Pad "drop1" without the quotes?
Its probably that, but also, you didn't change any of the values in the script, I had a similar problem when I changed the starting distance of the C-130.

Share this post


Link to post
Share on other sites

Yep its named drop1

Im not that noobish. ;) And nope i didnt change anything at all. I even changed the scriptname back to dropspawn.sqf so all would be original as you posted it here.

The C130 will just come towards the helipad and then break away without dropping anything.

Look at this sreenshot if you can see the problem. Appreciate it! :)

Link: SCREENSHOT

Alex

Edited by Alex72

Share this post


Link to post
Share on other sites
Almost, the code you quoted is SQS code but my script is SQF.

You'll need this:

if (!isServer) exitWith {}

I'm pretty sure I read somewhere that exitWith is not meant to be used to exit a script. It's supposed to be used to exit out of a while block or something IIRC, and its behaviour becomes unpredictable when not used that way. I know it usually works, but it's still wrong and people should stop using it. It's just as easy to do "if(isServer)then{<entire script>}".

Edited by Big Dawg KS

Share this post


Link to post
Share on other sites

Good to know. I usually rely on if-blocks anyway, this just seemed easier at the moment.

I've not had the problem with the c130 turning away yet, I'll try to recreate it and see if it can be fixed. Guess the AI is beeing an asshole once again.

Share this post


Link to post
Share on other sites

Tajin. Did you see my screen? Wonder if you can see what i did wrong. :)

Alex

Share this post


Link to post
Share on other sites

Have you tried the same script, but from a trigger? So it doesn't fire from the init of an object, but when something is triggered. Or, even a true trigger, just delay its effect by 5 seconds. There might be trouble running it from an objects init.

Share this post


Link to post
Share on other sites

Nope will test that. Thaught this would work as others say it does.

But i test set a trigger up. Thanks. :)

EDIT: Argh what does POSITION mean in this line? nul=[position,"classname",dir] execVM "dropspawn.sqf"; i gues i have to use that one for a trigger yeah?

Alex

Edited by Alex72

Share this post


Link to post
Share on other sites

The position is where the C-130 will drop the goods. But using the invisible H should still work, the method you were using should be the same, getpos drop1.

Share this post


Link to post
Share on other sites

Hmm i still dont follow. You mean that what i did first should work (screenshot) and i need not to change anything (even though it doesnt work - for me lol). Remember im not that good with these things. Need pointers.

EDIT: Depending on wich way im turning the "H" the C130 will fly around like mad. Turn and turn to then fly away - nothing dropped. Can anyone of you post an example mission with the H and script only? Would be nice thanks.

EDIT2: When i look high up in the sky i can see a black dot... Seems maybe its that USOrdnance haning very high up in the air stuck. Or maybe a bird shit. not sure.

EDIT3: This is what i get when running the script/helipad. What was in the air i saw was not the ammo box...

hanging.jpg

A hanging "ball" hmm...? Seems its hanging mid air right above the "H" pad. Maybe this is the drop point. Got no idea why this isnt working for me. An example mission from one of you would make my day.

Alex

Edited by Alex72

Share this post


Link to post
Share on other sites

This is getting weird. Right, I'll try and get a working example.

Share this post


Link to post
Share on other sites

Your telling me :D

Thanks mate. Appreciated.

Alex

Share this post


Link to post
Share on other sites

http://rapidshare.com/files/253839102/TEST-c-130drop.Chernarus.zip.html

Ok, there it is. Its a US ordinance ammo box, so the script has been altered slightly in 2 places. One for the attach to the parachute, ammo boxes need to be slightly higher attached, else they sink into the ground when they land, and the planes takes longer to be deleted, I felt it was too short, you could noticeably see and hear it just vanish.

Something did occur to me too about yours, you haven't got any AA or enemy in the area you are dropping into, have you? That seemed to cause strange behaviour when I was messing around with this script a week ago.

Share this post


Link to post
Share on other sites

No enemies - only me - helipad and the script.

Thanks will give the mission a go.

However i did it on Utes. Is that the problem?

EDIT: Ok that worked. You had a trigger and a H pad though. something i didnt have. Also - look carefully and youll see the BALL in your example as well hehe. It seems to be the drop point.

Alex

Edited by Alex72

Share this post


Link to post
Share on other sites

Yeh, I think you just need to delay the dropspawn.sqf. In an init it must not run correctly. The trigger condition can just be 'true' with a 1 second timer if you want the C-130 at the beginning. Off to work now, good luck.

Share this post


Link to post
Share on other sites

Heh you're the first one noticing the ball :P

I use it as target for the AI to focus on, so it flies properly.

I guess I should make it invisible. ;)

I think the problem was as uzii mentioned that u put the script in an init, instead of a trigger.

Update:

if (isServer) then {
_pos = _this select 0;
_spawntype = _this select 1;
_dir = _this select 2;
_airtype = "C130J";
_type = "GUE_Soldier_Pilot";
mygroup = creategroup side player;

_target = createVehicle  ["testsphere2",[_pos select 0,_pos select 1,-10], [], 0, "FLY"];
deleteCollection _target;
_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.5;
    if(_vehicle distance _target < 600) then {
        _pilot FlyInHeight 400;
        _pilot doMove _npos;
    };
};

    _bpos = _vehicle ModelToWorld [0,-12,-5.5];
    _bomb = _spawntype 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,0]];
    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;

deletevehicle _vehicle;
deletevehicle _pilot;
};

servercheck added, flying ball is now invisible ;)

Share this post


Link to post
Share on other sites

I have two vehicle drops occuring within approximatley 1-2min, when i have one vehicle drop setup (trigger, heli pad, etc) it works perfectly however when i do the second one only the one triggered first seems to work...is there anything specific i need to do to make them work? Like a specific time interval or something?

Edited by Brute

Share this post


Link to post
Share on other sites

I have been troubleshooting this all night and simply cant get it to work :(

Edited by Brute

Share this post


Link to post
Share on other sites

Hmm, that doesn't really make sense to me.

Share this post


Link to post
Share on other sites

The placing of the heli pad seems to have made a lot of difference, i moved it by approx 10m and not it seems to work...interesting lol

Edited by Brute

Share this post


Link to post
Share on other sites

The create also seems to glitch in the air when descending

Share this post


Link to post
Share on other sites

Is it possible to load the dropped vehicles with weapons & ammo? I'd like to drop a couple of HMMWVs pre-loaded with a Javelin and spare mags. I can set this up for units placed in the editor in no time, but my scripting/editing skills don't stretch to doing it for units spawned during the mission.

Also, can you create a mobile respawn using a vehicle created via this script? So far I can only get mobile respawn working if the vehicles is in the mission from the start, if I could use this script it would be fantastic.

Edited by UnknownSoldier

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  

×