PDA

View Full Version : Movable guns on ai ships in CFS2



Shessi
May 7th, 2012, 03:11
Hi Colin/Crash,
Could you give me some info on how to build in ai movable guns, that use the cfg/DP to react to enemies, ie auto-trainable enemy following/firing guns.

I'm ok with the building and animation of things (FSDS), it's the last part.

Now, I've re-read Flerk's 'bible', interesting and useful but not specific.

I scasm'd the CFS2 default SHA_MAHAN to see how it's done. And you get
;0x98 gun5
;0x9A gun6
;0x9C gun0
;0x9E gun8
;0xA0 gun9
;0xA2 gun7
;0xA4 gun4
;0xA6 gun10
;0xA8 gun2
;0xAA gun3
;0xAC bullets0
;0xAE bullets1
;0xB0 barrel5
;0xB2 barrel6
;0xB4 barrel0
;0xB6 barrel8
;0xB8 barrel9
;0xBA barrel7
;0xBC barrel4
;0xBE barrel10
;0xC0 barrel2
;0xC2 barrel3

Now, from what I can see from the ani offset data, various rotary and angular anis were used e.g Engine 3 Prop position (angle) and percentage left wing fold. So no problem of using those type of ani offsets to build into barrels, turrets etc etc (I'd like to know in the SHA_MAHAN what the tags gun, barrel and bullets mean. Is it gun (gun turret), barrel (gun barrel) and bullets (unknown)...????)

Is it just a case of making sure the turrets and barrels have rotary and angular movement, and then letting the cfg/DP take over auto control?

Anyway, being naval gurus could you help me out please?

Many thanks

Cheers

Shessi

Collin
May 7th, 2012, 18:58
I managed to get the main armament on the Essex class to track, but they tracked the the nearest aircraft which in most cases was the player, ( no fun staring down the barrel of a loaded 5"). Since then I haven't bothered.

This was done while making it and through FSDS. I think Crashaz had better results though.

regards Collin:ernae:

Shessi
May 8th, 2012, 13:27
Hi Colin,
Thanks for getting back.

Could you explain what you built (part naming) and how you animated it, to get the tracking? I want to build a vessel-board AA gun, which obviously tracks and fires at enemy ac.

Cheers

Shessi

Collin
May 10th, 2012, 15:54
Hi Shessi,

as you can see the turret only was animated not the barrels. Developement was made early in the build as you can see from the lack of detail on the ships hull.

PSULLYKEYS
May 11th, 2012, 12:32
Interesting Collin, the animator in my version of FSDS2 doesn't seem to allow for your own animation. There are stock ones that seem to be available though.:kilroy:

I have someting from Usio's site a while back that shows how to do it in GMAX, but it loses something in the translation, and it is GMAX.

Collin
May 11th, 2012, 17:41
Ok Shessi, managed to find it, but as you can see I'm having trouble viewing as its win bloody 7 and I can't get FSDS out of demo mode so bear with me.

This first image shows the turret completed, note that there is 2 parts to it, the main one and a little box affair on the bottom of it. The little box is the parent part.

65199

In the 2nd image you see the parts properties activation for the child part. Please note its name and the animations and also the centering of the axis, these are very important.

65197

Next image shows the "New condition" parameters.

65198

This image shows the "Rotate" parameters.

65202

Finally this image shows the properties for the Parent part.

65203

The parent part as you may note is fixed and acts as an axis for the child. The child, because of its respotted axis can now swivel around the parent in animation without going off-centre ("Rotation") and this is activated by the "New condition". These 2 animations have to be done in this order.

The problem is that the macro doesn't recognise friend or foe and goes for the nearest flying object.

I can't get into the macro stuff because of it being in demo mode.

Hi Pat, nice to hear from you again.

regards Collin:ernae:

PSULLYKEYS
May 14th, 2012, 09:57
Thanks for the lesson Collin. This is the only safe way to talk.:guinness:

SULLY

Collin
May 15th, 2012, 03:12
Here's another trick for you.....

both fsds2 and fsds3 have a variable text file, this file relates to the commands for the animations etc in either one, fsds3 having the more advanced one.
If you make a copy of the text for fsds2 and paste it onto your desktop, now copy the one in fsds3 and paste into the fsds2 one on your desktop, delete the double-ups and now swop the two fsds2 texts around you can use fsds3 stuff in fsds2.
Quite a bit does work, some don't.

regards Collin:ernae:

PSULLYKEYS
May 15th, 2012, 16:33
Wow, over my head Collin, let me digest, I havn't gotten in to 3 yet. I's be furthrer along accept for the JO in Toranto.:running: and his drones.




Here's another trick for you.....

both fsds2 and fsds3 have a variable text file, this file relates to the commands for the animations etc in either one, fsds3 having the more advanced one.
If you make a copy of the text for fsds2 and paste it onto your desktop, now copy the one in fsds3 and paste into the fsds2 one on your desktop, delete the double-ups and now swop the two fsds2 texts around you can use fsds3 stuff in fsds2.
Quite a bit does work, some don't.

regards Collin:ernae:

Shessi
June 2nd, 2012, 15:28
Hi Collin,
Apologies for not replying sooner, but I did not get a pop-up email about your posts, so was just passing by and thought I'd take a gander.

Well I followed your tutorial, many thanks, and some problems that it's too late to deal with now...I'll be back.

Thanks again

Shessi

Seagull V
June 7th, 2012, 17:59
If one was to build a Flakpanzer, could the same turret rotation for the ships be applied to the Flakpanzer/vehicle models ???????

Some more nice ship models that could make nice turret projects at Google sketchup:-

http://sketchup.google.com/3dwarehouse/details?mid=a7d015c24213137538418b3a8241d843&prevstart=0
http://sketchup.google.com/3dwarehouse/details?mid=7d040985aa9761838418b3a8241d843&ct=mdrm&prevstart=0
http://sketchup.google.com/3dwarehouse/cldetails?mid=974199ab80d18beeadcdd286d225ba7f&ct=mdcc&prevstart=0
http://sketchup.google.com/3dwarehouse/cldetails?mid=cf7455c504d9924c1b3a1da1260ef4ac&ct=mdcc&prevstart=0
http://sketchup.google.com/3dwarehouse/cldetails?mid=87f645b4752c4802cc0d744dabbd06db&ct=mdcc&prevstart=24

Collin
June 7th, 2012, 20:14
If one was to build a Flakpanzer, could the same turret rotation for the ships be applied to the Flakpanzer/vehicle models ???????


If using FSDS2, I can't see why not.

But remember the axis point for the rotation.

Regards Collin:ernae:

Woof
July 22nd, 2012, 03:56
Collin,
Thanks for the tutorial. I had a go at this following your steps precisely to try and get some of the parts on my ships moving, however all that happens is the parts now do not appear in game (compiled straight from FSDS 2.24 using CFS2 option). They are however in the model if I use mdl2dxf to pull them apart again. So I can only figure they is something up with my 'display when' condition, causing it not to display ever. I'm pretty sure it not an issue with my pc and/or CFS2 as your ships seem to work and animate fine.

Any ideas?

I don't suppose you'd be willing to create/share a sample file so I can check what I'm doing wrong- the internet is very spares when it comes to .sdl macro tutorials these days.

Collin
July 23rd, 2012, 07:27
I would like to indulge you Woof, but, my FSDS doesn't like win7, nor do the other games I have (Blitzkrieg etc). So until I can get another idiot box with win xp on it I am stuffed.

regards Collin:ernae:

Jorge
September 17th, 2019, 09:42
I hate to revive an old thread, but was wondering if there was any update? It seems the website being quoted is down and the attachments are not working either. I was hoping to update some of Stuart's ships to animate the guns but was wondering if I had understood this correctly, so here goes:

1. The animations are not key-frame, but rather stock. To paraphrase "Field of Dreams": If you name it properly, it will move.

2. The part name must match something that CFS2 can read to activate the animation. For lateral (left-right swivel of the mount) the name starts at gun0 and increases in sequence. For vertical (up-down) the name starts at barrel0 and increases in sequence.

3. The barrel must be linked to the gun so that one follows the other (works together).

4. The axis of each must be aligned to the world and not local or part, otherwise it may not work.

5. The dp file must be labeled with the appropriate section to match the part, otherwise it won't work. In other words, if the physical gun is barrel0 connected to gun0, then the dp entry needs to match the number: gun0 part name = gunstation.0 as well as gun.0 in the dp file.

6. The "gunstation" entry is for the actual gun, while the "gun" entry refers to the rounds that are being fired from the gun. (Doesn't involve animation, but wanted to make sure I understood the difference for future reference).

7. Based on reading the dp from Stuart's ships - and using his gmax files - it should be possible to name a part properly as a "gun0" and "barrel0" (and the rest down the line) and have the gun animate as long as everything above holds true, correct?

8. The guns will track the player aircraft regardless of whether they are friendly or enemy. This is just "eye-candy," however, and they will still fire on the appropriate air targets. It may look strange, but a gun pointing at you and firing at something else is what I've come to understand. Is this correct?

I've read the comments in this thread and read the DPED excerpt above as well as the readme with DPED which I downloaded, but somethings just isn't clicking when it comes to understanding the requirements for animation. It seems so simple, yet frustrating! :banghead: I plan on downloading the USIO Lexington to compare and see.

Thanks for any help, folks!

Jorge
Miami, FL