Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Kieve on January 03, 2007, 12:19:42 am

Title: Animation Help Requested: KVFr Margay
Post by: Kieve on January 03, 2007, 12:19:42 am
KVFr Margay - Light Freighter
(http://i50.photobucket.com/albums/f321/Kieve/Freespace/KVFr_MargayR06.jpg)
Designed with roughly the same function as the Poseidon, the Margay is intended to transport a single A09 or A17t container. Other screens here (http://www.hard-light.net/forums/index.php/topic,43530.msg902226.html#msg902226), although the TX'ing has progressed considerably since then.

So, now that you know how pretty it is... ;) A bit of help from those wiser than I?

The docking arms are set up as separate sub-objects, and their pivot point is arranged appropriately so that a thirty-degree rotation around the Z axis (Y, if you follow PCS's skewed frustrum) will open/close each arm. After reviewing the animation code wiki, however... well, it didn't explain enough of what I needed to know - namely, how to get it to work. All attempts to fire up FS2 or FRED with the anims in place resulted in errors and much whining on the part of the programs. Followed by foul language on my part. *dry chuckle*

I've included the Margay's table here - you might note the docking arm subsystems and their anims have been commented-out so I could see it and test it in-game - it also docks a bit weird with the containers, but I'll leave that problem for later.

Code: [Select]
;;=============================================================

$Name:                      KVFr Margay
$Short name: KVFreightSm
$Species:                    Kh'aj
+Tech Description:
XSTR(" ", 3040)
$end_multi_text
$POF file:                      kvfr_margay.pof
$Detail distance:        (0, 140, 400, 1300)
$Show damage:            YES
$Density:                       1
$Damp:                          0.2
$Rotdamp:                       0.7
$Max Velocity:          0.0, 0.0, 50.0
$Rotation time:          15.0, 15.0, 15.0
$Rear Velocity:          0.0
$Forward accel:          4.0
$Forward decel:          1.0
$Slide accel:            0.0
$Slide decel:            0.0
$Expl inner rad:        50.0
$Expl outer rad:        100.0
$Expl damage:            50.0
$Expl blast:            500.0
$Expl Propagates:        NO
$Shockwave Speed:        0.0
$Default PBanks:        ()
$Default SBanks:        ()
$SBank Capacity:        ()
$Shields:                       0
$Power Output:          30.0
$Max Oclk Speed:        60.0
$Max Weapon Eng:        0.0
$Hitpoints:                     2800
$Flags:                         ( "freighter" "in tech database")
$AI Class:                      Captain
$Afterburner:            NO
$Countermeasures:        0
$Scan time:              2000
$EngineSnd: 128
$Closeup_pos:            0.0, -4.0, -75
$Closeup_zoom:          0.6
$Score: 15
$Subsystem:                     turret00,1,1.0
$Default PBanks:        ( "Mirage XR" )
$Subsystem:                     turret01,1,1.0
$Default PBanks:        ( "Mirage XR" )
$Subsystem:                     turret02,1,1.0
$Default PBanks:        ( "Mirage XR" )
$Subsystem:                     turret03,1,1.0
$Default PBanks:        ( "CEPA-TG30" )
$Subsystem:                     turret04,1,1.0
$Default PBanks:        ( "CEPA-TG30" )
;;$Subsystem: docking arm-0
;; $animation: triggered
;; $type: docking
;; +delay: 0
;; +relative angle: 0, 0, -30
;; $animation: triggered
;; $type: docked
;; +delay: 0
;; +relative angle: 0, 0, 30
;;$Subsystem: docking arm-1
;; $animation: triggered
;; $type: docking
;; +delay: 0
;; +relative angle: 0, 0, -30
;; $animation: triggered
;; $type: docked
;; +delay: 0
;; +relative angle: 0, 0, 30
$Subsystem:                     communication, 10, 0.0
$Subsystem:                     navigation, 5, 0.0
$Subsystem:                     weapons, 20, 0.0
$Subsystem:                     sensors, 10, 0.0
$Subsystem:                     engine00, 30, 0.0
$Subsystem:                     engine01, 30, 0.0
$Subsystem:                     engine02, 30, 0.0

;;=============================================================

This is how it's supposed to work:
(http://i50.photobucket.com/albums/f321/Kieve/Freespace/MargayDockingProcedure.jpg)

1- Margay's default is arms straight-out
2- before docking, arms rotate 30 degrees outward
3- dock, then arms lock back into place
4- for undocking, reverse the order.

I understand this may be a bit complex, so if I have to start with the arms 30-out and just lock 'em in after docking, that's okay - as long as someone can help me get the anim code working.
(and yes, I know what I have up there is broken - FRED whined about a +delay tag, so I added one - then it kept whining, so I commented everything)
Title: Re: Animation Help Requested: KVFr Margay
Post by: Snail on January 03, 2007, 12:32:12 am
Can't you just do that in modelview?
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 03, 2007, 12:33:47 am
I don't really know how to use modelview... :confused:
Title: Re: Animation Help Requested: KVFr Margay
Post by: Snail on January 03, 2007, 12:36:52 am
Open the POF editor, select the submodels tag and select rotate, then choose which axis, etc. etc. But I don't know if it actually moves in game...... :nervous:
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 03, 2007, 12:44:50 am
??? I don't think that's quite what I'm after. What I need to knwo is, how do I use this (http://www.hard-light.net/wiki/index.php/Animation_Code) to move the arms while docking?

[edit] Definitely not what I'm after. I tried that and it made the arm twirl constantly. Radar dish movement - good for radars, bad for docking arms. ;) Thanks anyway though.
Title: Re: Animation Help Requested: KVFr Margay
Post by: DrewToby on January 03, 2007, 01:09:51 am
Most likely, ignore me. I know nothing of what I'm attempting to reason out. Maybe I'll hit something, but I doubt it.

You'd use the docking or the scripted animation type, right? And through that, could you just set it like the barrels of a gun? Like ...you know how they move and track their target? Could you, somehow, manipulate the code to have it do that kind of thing, just without a target, and go out to a certain angle?
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 03, 2007, 09:30:37 am
That's a theory I suppose, but...

How?
Title: Re: Animation Help Requested: KVFr Margay
Post by: Titan on January 03, 2007, 09:35:37 am
hey kiev, forgive me if i'm wrong, but did you make the Tigris class? 'cause i was thinking its 'big brother' you mentioned could be named the euphrates!
Title: Re: Animation Help Requested: KVFr Margay
Post by: Axem on January 03, 2007, 09:53:13 am
Well there's a few things that I see wrong with it right now.

First, the arms will need to rotate on the y-axis. If its on the z-axis the arms will just bank.

Second, there aren't any +velocity:, +acceleration:, or +time fields. Velocity and acceleration are pretty self explanatory. Time is an optional field I think. For some triggers it'll be how long until the animation resets. So try adding the velocity and acceleration fields. They're just like the relative angle field, they'll need values for x, y, z axes.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 03, 2007, 02:57:32 pm
time is optional and has no actual effect on the animation it'self, it is used for gameplay effects, for example, you have an animation that opens gun ports, you specify time and it won't let you fire untill after that delay.

ok looking at that table you seem to be on the right track, but you are missing a few things

first off you will probly want to change
   +relative angle:   0, 0, -30,   10,   0.0
to
   +relative angle:   0, -30, 0
//and on the closeing animation too
second as said you need
+velocity: 0, 10, 0
and
+acceleration: 0,10,0
(the numbers I used there were just arbitrary, you'll probly want to tewak them once you get this working)

another thing I notice is your sybsystem tag is missing some stuff
$Subsystem:         docking arm-1
should be
$Subsystem:         docking arm-1, 10.0, 0.0
those numbers are important, the first one is how much percentage of the hull it's hitpoints are, the second one pertains to turrets, but the parser still expects it to be there (and while we are on the subject you shouldn't use 100% or more of the hull it suposedly causes problems and a debug build will ***** at you about it)

in the subobject properties make sure it has the two following lines
$special=subsystem
$triggered:

once you've done all that, if it still doesn't work mention what errors it gives you, because those error mesages are designed to help you track down what is going wrong, so mentioning what they are is sort of usefull to soeone trying to bug hunt your model..
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 04, 2007, 12:26:46 am
Thanks! Bit late today for me to be trying that, but I'll definitely make the attempt tomorrow morning [daylight] and let you know. ;)

[edit] Yes, Titan, the KVF Tigris is mine. And don't think the idea hadn't occured to me  :nervous: Doesn't exactly fit with the naming conventions I've been using for the rest of the KV fleet though...
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 04, 2007, 01:01:03 am
If I get this working, is it alright if I add it to the Wiki entry? The example there isn't very helpful on non-turret applications.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 04, 2007, 01:49:16 am
I get two types of errors related to the Margay (and a few regarding my weapons table I didn't know about before, but whatever)...


(http://i50.photobucket.com/albums/f321/Kieve/error1.gif)
(http://i50.photobucket.com/albums/f321/Kieve/error2.gif)
The errors repeat for both arms, naturally. I've checked PCS- "docking arm-1" and "-0" are the exact names, and they're definitely part of the model, linked to detail-0.
No gripes about the Margay's table, so I assume what I have now is correct (or at least partly so):
Code: [Select]
$Subsystem: docking arm-0, 30, 5.0
$animation: triggered
$type: docking
+delay: 0
+relative_angle: 0,-30,0
+velocity: 0,5,0
+acceleration: 0,5,0
;; $animation: triggered
;; $type: docked
;; +delay: 0
;; +relative angle: 0, 0, 30
$Subsystem: docking arm-1, 30, 5.0
$animation: triggered
$type: docking
+delay: 0
+relative_angle: 0,-30,0
+velocity: 0,5,0
+acceleration: 0,5,0
;; $animation: triggered
;; $type: docked
;; +delay: 0
;; +relative angle: 0, 0, 30
Haven't tried the second set of anims yet, as I want to know the first will function before I go mucking about any more. Also of note, it's "+relative_angle: #,#,#" not "+relative angle:"

Damn underscore.

Could it be that I'm not allowed to space "docking arm"? And on a PCS note, if I add a $Name tag to the docking arms, will that affect the table, or just what I see in-game if I try to target the arms?
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 04, 2007, 06:40:14 am
the name tag in the submodel properties won't effect anything important. just looking at it that nothing jumps out at me as being wrong. if you can post your wip model and tbm (includeing the cargo pod if possable) I might be able to find out what's wrong.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Titan on January 04, 2007, 07:06:27 am
Thanks! Bit late today for me to be trying that, but I'll definitely make the attempt tomorrow morning [daylight] and let you know. ;)

[edit] Yes, Titan, the KVF Tigris is mine. And don't think the idea hadn't occured to me  :nervous: Doesn't exactly fit with the naming conventions I've been using for the rest of the KV fleet though...


i just recently realized that the TIGRIS wasn't like TIGER, it was one of the rivers in the fertile crescent. i just learned that in social studies.    :nervous:
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 04, 2007, 10:19:22 am
Yep, supposedly the original cradle of civilization. Sumarians, I believe it was? *shrug* It's one of those "one-off" things.

As requested Bob, here are the models. The A09 and A17t are almost identical, aside from the 17's armored edges, so if you find you need to fix any problems with the cargo, please post the corrected .pof back for me? :)

[attachment deleted by admin]
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 04, 2007, 12:55:57 pm
wait a sec... someone commented out the code...
I have to go... I have to go post something, somewere...
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 04, 2007, 11:32:39 pm
try this build
http://freespace.volitionwatch.com/blackwater/fs2_open_Bobboau_1-4-07.zip
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 05, 2007, 11:07:17 am
Unfortunately, the only noticeable difference is that now FS2 crashes. >.<; Before, the debug would complain, then run, and the arms would stay locked in place...
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 05, 2007, 12:26:55 pm
well I found that the four lines needed for the docking animation have been commented out for a while, so none of the regular builds are going to work, apparently you are the first person in like a year to try and use this.
ok, if it just crashed without giving any error (which is weird because it's a debug build) try to find your fs.log and attach it, there might be some information in there.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 05, 2007, 01:44:47 pm
ok, one thing that just jumped out at me, the names you gave to the subobjects in the model, are $docking arm-0 and $docking arm-1 respectively, I don't think the '$' character is illegal, but I wouldn't trust that, regardless the name in the model and the table do not match, one of the  two needs to be changed to match the other, I would recommend changing the name in the model.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 05, 2007, 02:42:41 pm
ok, after you fix the names in the model, this should get you what you want

Code: [Select]
$Subsystem: docking arm-0, 30, 5.0
$animation: triggered
$type: docking
+delay: 0
+relative_angle: 0,30,0
+velocity: 0,10,0
+acceleration: 0,15,0
+time: 2000
$animation: triggered
$type: docked
+delay: 0
+relative_angle: 0,-30,0
+velocity: 0,15,0
+acceleration: 0,5,0
+time: 2000
$Subsystem: docking arm-1, 30, 5.0
$animation: triggered
$type: docking
+delay: 0
+relative_angle: 0,-30,0
+velocity: 0,10,0
+acceleration: 0,15,0
+time: 2000
$animation: triggered
$type: docked
+delay: 0
+relative_angle: 0,30,0
+velocity: 0,15,0
+acceleration: 0,5,0
+time: 2000

also here is another build, I made some tweaks to the docking related animation code, that should help make it look better... or lock the game up horribly, one or the other.
http://freespace.volitionwatch.com/blackwater/fs2_open_Bobboau_1-5-07.zip
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 05, 2007, 06:00:42 pm
(http://i50.photobucket.com/albums/f321/Kieve/error3.gif)

I've tried various permutations of the docking arm name, with underscores and the like, but none of them work. I even tried "darm00" once, thinking that since both "dock" and "arm" have special recognized properties (for dockpoints and turret barrels, specifically), mebbe that was throwing it off... not so.

Now I get these errors in "fs.log" although I don't get a popup about it.
Code: [Select]
Warning: Ignoring unrecognized subsystem docking_arm00, believed to be in ship kvfr_margay.pof
Warning: Ignoring unrecognized subsystem docking_arm01, believed to be in ship kvfr_margay.pof

Sheesh. And I'm the only one in a year who's thought to try using docking anims? o.O; Peculiar.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 05, 2007, 10:01:08 pm
ok, I was using this model (http://freespace.volitionwatch.com/blackwater/kvfr_margay.zip), with a table using the section I posted above an it was working, that thruster error may have come from something other than this model, as this model has neither thrusters nor subsystems

I added a slightly more descriptive and potentially informative error message in this build
http://freespace.volitionwatch.com/blackwater/fs2_open_Bobboau_1-5-07a.zip
it will at least confirm that it is this model causing the error.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 07, 2007, 11:17:43 am
so, d'ja get it work'n?
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 07, 2007, 12:04:06 pm
Haven't tested yet... needed a brief break from the aggrivation and disappointment. I'll get to it sometime later today or maybe tomorrow.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 07, 2007, 12:44:19 pm
well despite my internet only working five minutes out of an hour for the last two days, you've got the guy who wrote the code deperately trying to help you right now... ...
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 07, 2007, 02:00:25 pm
News:
The standard FS2_Open build (3_6_9) runs okay, and the Margay [does] dock. Arm systems are targetable/destroyable, and everything appears to check out. Of course, the arm [animations] don't work, but you said that build had the docking-anim code disabled, so...

The last build you sent- 07a -crashes without any error after launching the mission. At first I thought it might be due to the Tigris model, as I was getting a lot of errors from it, but removing the Tigris from the test mission didn't fix the crashing. FS2.log doesn't reveal any glaring errors, and I don't get the WARNING:Ignorning Subsystem thing this time.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 07, 2007, 02:11:08 pm
could you post the log (as an atachment)?
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 07, 2007, 02:54:43 pm
Log, as requested. The errors about thruster04/N/Na etc. are inconsequential, relating to thruster glows for the Kh'aj and Naga entries- I haven't finished those just yet, but they shouldn't crash the game... o.o;

[attachment deleted by admin]
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 08, 2007, 01:04:43 pm
ok, so does it crash right when loading is done or when you hit the commit button to start playing after the breifing?
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 08, 2007, 08:49:33 pm
try makeing a mission with just it and the player ship in it.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 09, 2007, 12:28:46 am
It crashes after "loading" the actual game area- that is, I load up my mission, go through briefing etc, and when I hit "Commit" again, it gives me an illegal op and crashes. It was doing the same thing before, except before it also provided that third error screen, and would crash after "OK." Cancel, of course, simply closed Freespace.

The test mission right now contains Alpha 1, a Margay and the A17t it's assigned to dock with, and various enemies delayed 60-sec plus (so I can watch the docking). The various enemies are all FS2 stock, so they shouldn't be presenting a problem.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 09, 2007, 12:47:47 am
well I don't get how the exact table and pof can work perfictly on my machine and crash in such an unhelpfulmaner on yours.


...try running in D3D...
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 09, 2007, 01:39:37 am
D3D didn't fix - it still crashes. The mission loads up to the "Commit" (enter game) bit, freezes (indicated by a sudden looping of the soundtrack), and then crashes. This was on the last build you sent me, btw...
The Mission itself was Alpha 1 in an Erinyes, with an MO to simply wait for the Margay to dock with the container. That's it.

Perhaps the error lies in the most recent model build? Test this package on your machine and see if maybe I fragged my own model at some point? If the old variant works for you and this one doesn't... Anyways, this is [everything] I have on the Margay - I've adjusted the table a little so that it reads Terran and uses Terran wepons (five PromR turrets), but both this and the included A17t are otherwise identical to what I've been using. Even threw in some low-res variants of the textures- ironically, I guess this makes the closest thing to a Release I've done yet.  :rolleyes:

[attachment deleted by admin]
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 09, 2007, 01:07:27 pm
that ran fine for me...  :wtf: there were a handfull of missing textures, that's the only thing diferent, well that and the fact that I have just these files in it's own mod.

...
ok, I just spent a whole bunch of time trying to get my code up to date with CVS, maybe that will help.

http://freespace.volitionwatch.com/blackwater/fs2_open_Bobboau_1-9-07.zip
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 09, 2007, 01:26:28 pm
ok, to make sure we have eleminated as many posable sources for the crash as posable, lets make sure we are useing the exact same data. would it be posable for you to turn off your current working mod? this should be easy if you have it in a mod folder (just drop the comand line). I want you to get it so only retail data is getting loaded, and then use the atached mod, it's exactly what I have right now, includeing a test mission

[attachment deleted by admin]
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 09, 2007, 01:55:06 pm
Affirmative. I'll run this ASAP and get back to you.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 09, 2007, 03:18:38 pm
VICTORY! I had to alter the mission you sent so that the Margay had [orders] to dock with the cargo, but it worked. Beautifully. Thank you. ^.^

Now... question is, will [everyone] now need a new build of FS2 to run the Margay? o.O;

Also, point of interest: every time I [quit] the new build, it crashes with no error... just Illegal Op. But everything else runs ok.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 09, 2007, 03:28:35 pm
if you are useing D3D that's normal.

well untill I commit these changes only my builds will have this, you may have to wait untill after the next release to use an offical build. if you are looking to make one big mod, then this shouldn't be too bad a problem as there will probly be another release before you get totaly done.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 09, 2007, 07:20:33 pm
Yeah, Kh'aj/Naga ships are part of a campaign whose release will likely be a LONG time from now. x.x; Ah well. Good to know it works at least.

...such a pretty sight, watching those arms move...  :D Thank you so much.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 09, 2007, 09:51:08 pm
if you think that's nice, think about what you could do with this (http://www.hard-light.net/forums/index.php/topic,43483.0.html) you would need to make some changes to the model to use this of course, but think about what it would look like to not only have the arms move, but also see the mechanical means by wich they were moveing.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 09, 2007, 11:43:10 pm
Aye... although for now I'm quite satisfied with internal mechanisms, that would be an excellent feature for some of the Naga ships... ^.^

Btw, would you be able to PM me a list of the animation codes that are still deactivated (assuming there are any and the docking one wasn't a fluke)?
Title: Re: Animation Help Requested: KVFr Margay
Post by: Bobboau on January 10, 2007, 12:05:03 am
from what I can see nothing else is disabled.
docking was a fluke.
it got disabled because I didn't want the code to be opperational  before I had totaly tested it, and I just forgot to uncoment it.
Title: Re: Animation Help Requested: KVFr Margay
Post by: Kieve on January 10, 2007, 12:18:48 am
huh. *laughs* Lucky me... 9.9;