Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: esarai on April 26, 2010, 06:21:43 pm

Title: Need Help with Animation Code/Animation Code Request
Post by: esarai on April 26, 2010, 06:21:43 pm
Okay, so I'mma trying to make a Vertical Launch System for a ship that has doors that open whenever a missile is fired from the launcher, and I noticed that this is doable because of Bobbau's Animation Code.  What I need to use is:

Quote
$Animation: triggered
$type: turret firing
+sub_type: <model number of target turret>

However, there's a problem.  I don't know what the code is referring to by 'model number.'  Here's what the wiki says:

Quote
Syntax: +sub_type: Value, model number of the turret that triggers the animation. NOTE: This feature currently does not work on multipart turrets.

Since it's a value and not a string, it cannot be referencing the turret name.  What is the 'model number' that this expression is attempting to reference, and how does one go about finding it?  Could it perhaps be the turret number (if turretXX is the name, then the number is XX)?

Any help greatly appreciated.

EDIT:

Thanks to Nuke for the solution, that helped a lot.  As many people seem to be in favor of this, could we please change it so that the code uses turret subobject name rather than model number?
Title: Re: Need Help with Animation Code
Post by: Nuke on April 26, 2010, 07:07:54 pm
thats the submodel number from the pof file. if you open the model in pcs2 and drop down the subobjects tree, youl notice every object has a number in parentheses next to it, this is the subobject number. just find the submodel for the turret geometry, and use the number for that one. also this should be moved to modding.
Title: Re: Need Help with Animation Code
Post by: The E on April 26, 2010, 07:14:19 pm
No, it shouldn't. There's a usability issue here, where there's no reason why it should use the number when it could use the subsystem name instead.
Title: Re: Need Help with Animation Code
Post by: FUBAR-BDHR on April 26, 2010, 07:56:38 pm
Yea looking up the subobject number is a pain and it changes just about every time your re-convert the model.  The only version of PCS2 that I know of that actually shows the number is 2.1alpha and that isn't a stable release.
Title: Re: Need Help with Animation Code
Post by: esarai on April 26, 2010, 07:59:19 pm
I agree with everyone here, this should not use model number as it simply adds more steps to an already complex process.  From a modeler, using the turret's subobject name would be much more efficient and reliable.  So, as there seems to be strong will to change this, I have renamed the thread.
Title: Re: Need Help with Animation Code/Animation Code Request
Post by: Nuke on April 26, 2010, 10:29:36 pm
No, it shouldn't. There's a usability issue here, where there's no reason why it should use the number when it could use the subsystem name instead.

in that case i can see the point. subtype is a pretty generic value and i can understand why it confuses people. it does different things for every trigger type. making it a string might work better, but it would still be confusing, especially when using a primary/secondary weapons trigger (subtype is used on animations that occure while a bank is armed or disarmed). we could put a +subobject name: field that would work for all turret (or other physical subsystem) related animations, and likewise for other uses of subtype (so far only primarybank/secondary bank, they would need a +bank number: field), this would increase the number of fields that would need to be parsed, but would be easier for a new modder to get their head around. problem is every time a new animation type is added new fields to be parsed will also need to be added (unless theyre covered by an existing one).

on the other hand, this has been in the code base for years, and changing it is bout to affect some old mods. then again i never really considered it a complete system and i dont think it was very widely used (or at all), so i guess it wouldnt make too big of a mess to change it.