Jump to content
Sign in to follow this  
Killy_McMurder

attachTo, C130 Spectre, Spookey and other stories

Recommended Posts

Basically, i'm trying to put together an improvised AC130 Spooky Gunship, i've got a C130 with an M2 Minitripod, Mk19, and M119 attached to the right side of the aircraft and positioned pretty good (not an entirely accurate set up, i know. But, meh :P). They're all offset to 90 degrees right so they have a 180 degree field of fire along the side of the aircraft, but they can't aim lower than zero degrees, i.e. they don't point any further down than 'level' in relation to the aircraft. What i need is someway of having the three guns Set at something like -50 degrees downwards or something like that whilst staying attached and in position on the aircraft

This is what i have on the guns init at the moment and it works well:

thunder1 attachTo [saviour6, [2.5,6,-3.5]]; thunder1 setDir 90;

thunder1 being the M119 and saviour6 being the C130. i also have hail1 for the Mk19 and rain1 for the M2 Minitripod, just swapping the names and position co-ordinates where necessary.

Basically i want them to be able to fire almost straight down whilst the aircraft is flying level, at the moment i'm not sure how to do this... Any takers?

Share this post


Link to post
Share on other sites

Yea, should be left, but i couldn't be bothered with the negative values for the position co-ordinates when i first started lol

I'll probably switch it around once i get the bugs worked out

Thanks for the help

Share this post


Link to post
Share on other sites

I tried this for a while and gave up on it. The biggest problem is not that the guns don't point down, because you should have enough angle when the C-130 is banking like the real spooky. The biggest problem is that once the C-130 is running or in motion, when you rotate the cannon it collides with the "railing" in the center of the cargo area of the C-130 and both go flipping up into the air and explode. The only way I can see to do it is mount the cannon unrealistically on the outside of the C-130.

BTW, If you need a better view, press '0' for the optics view for the cannon.

Share this post


Link to post
Share on other sites

Ahhh, i wondered why i kept kerploding...

I've done a quick test with just Mk19's grouped to the pilot, with the pilot under a High Command Subordinate GL with me in command and they actually do the trick (more or less) So when its AI controlled and too high in the air to see its not too bad.

But i'm quite stubborn so i'll probably keep at it for a while :D

Share this post


Link to post
Share on other sites
Ahhh, i wondered why i kept kerploding...

I've done a quick test with just Mk19's grouped to the pilot, with the pilot under a High Command Subordinate GL with me in command and they actually do the trick (more or less) So when its AI controlled and too high in the air to see its not too bad.

But i'm quite stubborn so i'll probably keep at it for a while :D

There is something funny about the C130, I tried a bit of script to taxi it at Utes and it worked even though the code needs more work.

The point is this and I don't know if it's related, the second time it takes off it gets airborne and then explodes.

I've also been trying to get the static Gunner to look down by using vectors but I can only make it lean left and right.

You might be able to get them to look down by plotting a game logic under the plane but I don't like that idea as they don't like to target other stuff at the same time.

I've also tried it with the search light attached just inside the front of a chopper and it isn't bad but would be better angled down a touch.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

You can use "deleteCollection" to make the attached M119 invisible.

Share this post


Link to post
Share on other sites

Don't know if that's the same thing but would that turn off the collision detection aswell? or would it just actually make it invisible?

Turning off the collision detection would actually be quite useful if it could be done

Share this post


Link to post
Share on other sites

I've had some good results but one big snag, first the good news I've got a gunner who can point down about 40deg's above normal.

But now the bad news if the plane or helicopters plus the angle of the gunner becomes to great the gunner dismounts and falls to earth.

I love that delletecollection command.

Share this post


Link to post
Share on other sites

I had the same problem, i was messing with the setVectorDir line and ended up with the camera ata 90 degree angle to the world. The pilot didn't like that and kept making me get out at about 100 feet off the ground :D

I ungrouped the player from everything though, seemed to solve the problem.

What did you use to get the gunner to point down more?

Share this post


Link to post
Share on other sites

I carn't seem to vector the gunner Directly at least not at a downwards angle.

First I used setpos to suspend a pallet a few meters off the gound.

I then apply SetVectorUp

pal1 setvectorUp[0,1,0.9];

The X,Y coords seem to be either + or - 1 ie Xup=1 Xdown=-1 Yup=1 Ydown=-1, Z seems to be from -0.9 to +0.9 I stand to be corrected I haven't read about it yet.

I then simply attach the gunner to the pallet and then the pallet to the plane/chopper.

You can remove the pallet with the deletecollection command and the gunner too if you want.

If you mounted an empty gun maybe you wouldn't need the pallet and could just vector that, then move the gunner in later. The gun could remain visible and just deleteCollection the man.

Share this post


Link to post
Share on other sites

It looks good up to the point where i attach it to the aircraft, i've applied the setVectorUp and its angled down pretty much perfectly and attaches correctly, but it faces the same direction as the plane; it seems to be ignoring the setDir line now, like before i had that set as "setDir 90;" so the weapon pointed straight out the side of the aircraft. Now its just facing the same way... i have the pallet like:

"this attachTo [saviour6, [2,10,-3.7]]; this setDir 90; this setvectorUp[0,1,0.9];"

Don't know what i'm doing wrong, i am quite tired though lol

---------- Post added at 09:54 PM ---------- Previous post was at 09:30 PM ----------

Hang on, cracked it:

Had to change the orientation of the pallet first, changed that to;

"this setvectorUp[0.9,0,1]" This made it angle down on its Y axis so the left side dipped instead of the front. Then i just set the "setDir 90" to the gun instead of the pallet and it works fine now, both look like this now (switched the gun to Mk19-Thunder2- for now btw):

Mk19 "thunder2 attachTo [pallet, [0,-0.2,0]]; this setDir 90;"

and the pallet looks like: "pallet attachTo [saviour6, [2.4,10,-3.5]]; this setvectorUp[0.9,0,1];"

(saviour6 being the name of the aircraft)

The gunner does that bail out thing aswell when the aircraft banks too far over... can't explain that. Everything else seems to work ok though.

Now, i just need to make the pallet invisible but i don't know how to use the deleteCollection command. What do i need to put/where in the code line should i put it?

Edited by Killy_McMurder
stupid

Share this post


Link to post
Share on other sites

It's easy, it's just

deleteCollection objectname 

no brackets or anything.

I've done a little more testing and you carn't seem to kill a deletedCollection object so it may have disabled collision detection.

I just tried without the pallet and it seems to work if the object is empty at least where I was placing it worked. I then move gunner in later.

Share this post


Link to post
Share on other sites

Any ideas what the deal is with the gunner just diving out when the aircraft banks though? Could cause problems on a CAS sortie haha

Found a slight workaround, if i group all the units and set the pilot as the leader/player, the gunners stay seated when i turn steeply, but if i take control of the gunner position the pilot/leader orders the group to disembrk when banking... rather odd

Edited by Killy_McMurder

Share this post


Link to post
Share on other sites

Nothing really other than keep doing a loop in script that keeps moving the man in as gunner if he's not in the gun, it my keep him inside the plane at least until it levels out a bit.

Edit that won't work it just refuses to put him back in the gun until the angle has reduced, what would work is moving the gunner somewhere safe until he can get back in the gun.

I did a small test it it works but I don't know how to check if he's exited the gun.

I had ago at scripting it but the while command line isn't correct.

_man =  _this select 0;// soilder moving into gun
_gun  = _this select 1;// empty machine gun name
_safe = _this select 2;// game logic safe place 

while {!(gunner (vehicle  _man))} do
{ 
_man setpos getpos _safe;
_man moveingunner _gun;
};

I'm sure that would at least stop him falling even if it's not perfect I just carn't get it to work.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Bump.

I'm a total noob at scripting tbh, i have no idea when it comes to this.

Is there a way of getting the gunner to ignore any changes in his attitude/angle? Or maybe a way of having the gun set angled on the side of the aircraft and having the actual gunner positioned somewhere else, maybe at a safer angle/level as opposed to parallel with the gun?

Share this post


Link to post
Share on other sites
Bump.

I'm a total noob at scripting tbh, i have no idea when it comes to this.

Is there a way of getting the gunner to ignore any changes in his attitude/angle? Or maybe a way of having the gun set angled on the side of the aircraft and having the actual gunner positioned somewhere else, maybe at a safer angle/level as opposed to parallel with the gun?

I think it's the way the guns and things are setup ie if angle is greater than xx eject man, it would make sense to do it that way.

Share this post


Link to post
Share on other sites
Any ideas what the deal is with the gunner just diving out when the aircraft banks though? Could cause problems on a CAS sortie haha

Have you tried locking the gun ?

Share this post


Link to post
Share on other sites

Seems to work when the player flies the aircraft and the AI handles the guns. When i take over the gun though and the AI banks the plane over it issues a disemark command again and the gunners (including me) disembark, fall to earth and go splat... it issues an order to get in the plane straight away though so it must be because they're grouped i guess...

Share this post


Link to post
Share on other sites

Well for what it's worth the motorcycle can hang near vertical without him falling out, I thought I would use him to illuminate the inside of the hanger only to find the hanger won't reflect the light.

Tajin I have tried locking the gun, removing animation,dostop ect.

Share this post


Link to post
Share on other sites
Seems to work when the player flies the aircraft and the AI handles the guns. When i take over the gun though and the AI banks the plane over it issues a disemark command again and the gunners (including me) disembark, fall to earth and go splat... it issues an order to get in the plane straight away though so it must be because they're grouped i guess...

Have you tried making the gunner group leader instead of the pilot?

Share this post


Link to post
Share on other sites

As F2k Sel suggested, on land vehicles or static weapons its likely BIS has hardcoded "eject crew" when vehicle rolles over.

I've certainly seen evidence of this in the ArmA2 demo and ArmA2 youtube videos.

The Collision and "roll" problems could likely be solved by a custom addon similar, but not the same as the static guns.

i.e. change the weapon to a class that doesnt eject its crew (bikes and planes? ) and reduce or drop the GEO Lod from the model.

Share this post


Link to post
Share on other sites

You're probably right actually, i never thought of that... i can see why people have given up on this idea in the past now!

I'll probably keep at it though

Assuming there is/will be a way to work around the "eject crew" attribute as Gnat mentioned, another issue i'm having is the collision detection when i add large guns to the aircraft. Is there anything similar to deleteCollectio that will disable the collision detaction without making the actual model disappear?

I'm starting to get the feeling that if i ever get this to work someone will have already modelled one from scratch anyway!

Share this post


Link to post
Share on other sites

I gave it another try.

Download links to the demo mission:

http://www.sendspace.com/file/lmnr1s

http://d01.megashares.com/dl/f3b0883/DEMO.zip

Contents of the README:

Introducing Crowd Pleaser: an AC-130 Spectre Gunship demonstration.

C-130 custom actions: generally use these once, though there are checks that will not let you do anything bad.

Prepare Spectre - Immediately outfits the C-130 into an AC-130

Add Gun Crew - Mans the AC-130 guns with AI gun crew

Remove Gun Crew - Dismounts and removes AI gun crew

Radio Triggers: You may use these repeatedly

Radio Alpha - Target and fire

Radio Bravo - Target

Radio Charlie - Scan for human targets

Radio Delta - Scan for tanks

Radio Echo - Scan for technicals

The laptop object is for using human players to man the guns. The laptop only appears at the base near the runway when the AI gun crew is not manning the guns.

The _AIR mission is for singleplayer fun with an AI gun crew, and the _GROUND mission is for multiplayer testing.

The targeting routines need to be more fine-grained and allow for cycling of targets.

Quick Start:

1.Run CROWD_PLEASER_AIR.chernarus

2.Choose custom action "Prepare Spectre"

3.Choose custom action "Add Gun Crew"

4.When approaching target choose radio 3 "Scan for human targets"

5.When within weapons range choose radio 1 "Target and fire"

Share this post


Link to post
Share on other sites
I gave it another try.

Download links to the demo mission:

http://www.sendspace.com/file/lmnr1s

http://d01.megashares.com/dl/f3b0883/DEMO.zip

Contents of the README:

Introducing Crowd Pleaser: an AC-130 Spectre Gunship demonstration.

great! great job and thanx you very mach!!))

==

i'm not understand in scripting clear/but what about implement for Spookey some UAV scripting logic(from bis original scripts) with dinamic waypoints and ai pilot and give to player only terminal or radio communication

Edited by nikita320106

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  

×