Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Nuke on November 14, 2005, 10:04:30 pm

Title: submodel animation triggers
Post by: Nuke on November 14, 2005, 10:04:30 pm
now the submodel animation code works pretty well. the only problem is the lack of trigger options. several modders (self included) are making moels that will use animations. so far theres like 6 or so triggers and was wondering when more will be added. now youre probibly gonna use the scripting system for complicated animations but id like to keep the existing system around for simple ones. either way your still gonna need a trigger relay of sorts in the code.  heres a few trigger ideas. i suggest other modders sugest some as well.

subspace- performs animation on entrance to supspace, and undoes when a ship comes out of subspace and acts as a initial position if the "mission takes place in subspace" flag is set.

afterburners-performs animation when afterburners are used and undoes the anumation when they go off.

weapon fire-performs animation when weapon is fired and undoes it before the weapon can fire again.

also id like a few more movement options. in addition +relative angle: would it be possible to have +absolute angle: (wich is really relitive to ship rather than subobject) wich will animate to that position regaurdless of where its rotated to, and +incrimental angle: wich makes it a one time pulse trigger and adds or subtracts to the current angle of the object and does not get undone (possible means for gatling turrets (http://www.game-warden.com/nukemod-cos/Images/turrrent.gif)).

another thing, make glopoints triggerable by the trigger system as well. with possibly +glowpoint on: (bank,slot), +glowpoint off: (bank,slot), +glowpoint toggle: (bank,slot). which would be added in somewhere amongst  the other animation fields.
Title: Re: submodel animation triggers
Post by: WMCoolmon on November 15, 2005, 01:11:56 am
There already is a +absolute angle, I sort of assumed it was in world pos though.

http://www.hard-light.net/forums/index.php/topic,36737.0.html
Title: Re: submodel animation triggers
Post by: StratComm on November 15, 2005, 01:22:31 am
Of the two things I can think of that would use world coordinates (basically the cockpit pod on the star-wars B-wing maybe, and a thruster array that was always supposed to point "down"), I can think of 200 that would use absolute model coordinates.  World is just asking for trouble almost all of the time.  The proper thing to do would be to add "global" coordinate support for world coordinates, and make "absolute" signify model coordinates, so that all possibilities could be supported.
Title: Re: submodel animation triggers
Post by: Nuke on November 15, 2005, 01:36:58 am
woah, when were all these other options added. i was under the impression it hadnt changed at all sence i had originally tested it. the way i meant absolute angle wasnt in the way it seems to have been implemented. perhaps +goto angle: would be more apropriate. rather than moving from the current angle by x'y'z, it would move to x'y'z regaurdless of where its at.

 the primary/secondary bank trigger seems to be mislabled in function in the other thread, it doesnt happen when a weapon is fired but rather when a weapon is armed, the pf chimera uses it to unfold its wings and open the missile bay. but still i want a weapon fire trigger for recoil effects.
Title: Re: submodel animation triggers
Post by: StratComm on November 15, 2005, 02:11:19 am
You know, has anyone ever actually used absolute for anything?  I'm guessing it's never even been tested.
Title: Re: submodel animation triggers
Post by: Nuke on November 15, 2005, 02:26:02 am
i never knew it existed and offhand i cant think of anything that i would use it for. the goto mode however would be very usefull. also a mode to make a subobject counter-rotate perfectly when its inheriting a perents movement.
Title: Re: submodel animation triggers
Post by: Bobboau on November 15, 2005, 03:01:19 am
the absolute angle exsists and some suporting code is in place however useing it could majorly screw up angles as there would be no way to know if an object was in a nutral position or not, it was added to allow the useage of absolute degrees (in model coords) mixing and matching was never realy consitered, and I basicly stoped suporting it before even the first test builds, the more I thought about it the moore I realised that absolute coordanants would make things horably messy and weren't needed.

as for adding more triggers, I explained how to do it, in most cases it should requier only a few lines of code to add new triggers (one of the goals was to make the system easily expandable).
Title: Re: submodel animation triggers
Post by: WMCoolmon on November 15, 2005, 03:22:38 am
While we're on the subject, is there a good reason that a couple of the fields use "$var=blahblah" style parsing? Or can I just swap those out for the usual kind of parsing stuff w/ a warning for the old method. (eg this is deprecated, please use new style)
Title: Re: submodel animation triggers
Post by: Nuke on November 15, 2005, 04:44:01 am
While we're on the subject, is there a good reason that a couple of the fields use "$var=blahblah" style parsing? Or can I just swap those out for the usual kind of parsing stuff w/ a warning for the old method. (eg this is deprecated, please use new style)

it does seem abit cluttered to me. the entries for the rumrunner's doors take up more space than the rest of the ship entries do. and that includes turrets. the chimera has about 13 animations in its list  i mean it takes two of theese:

Code: [Select]
$Subsystem: bdoor1,1,0
+non-targetable
$animation=triggered
$type="secondary_bank_2"
+delay:0
+relitive_angle:0,0,-60
+velocity:0,0,4000
+acceleration:0,0,80
+time:5000
just to get the missile launcher doors to open and another to lower the missile launcher. lets disect it.


Code: [Select]
$Subsystem: bdoor1,1,0 ;<- this should be here anyway
+non-targetable ;<- this really has nothing to do with an animation i guess it can stay
$animation=triggered ;<- now here this line really doesnt do anything but indicate the start of the animation and state that its triggered, ive never seen an animation that isnt
$type="secondary_bank_2" ;<- this line tells the game what will trigger the animation, i see no reason you cant use a variable list, like what you find on the subsystem line to put delays and the like
+delay:0 ;<-fancy that another line of text
+relitive_angle:0,0,-60 <-this is effietient it tels how to go to and where to go to, perhaps save some space and put the velocity and acceleration here too, can you have 3 vectors in a list?
+velocity:0,0,4000
+acceleration:0,0,80
+time:5000 <-you could probibly stick this on the trigger line too

would it be possible to do this
Code: [Select]
$Subsystem: bdoor1,1,0
+non-targetable
$trigger: secondary_bank_2,0,5000 ;trigger event,event data,delay,time
$movement: relitive (0 0-60),(0,0,4000),(0,0,80) ;movement type,(angle),(velocity),(acceleration)

its less cluttersome albeit more cryptic, but thats easyly solved as [v] ilustrated in its well commented tables.
Title: Re: submodel animation triggers
Post by: Bobboau on November 15, 2005, 07:51:04 am
I was intending to implement two seperate animation styles, triggered and linked, the linked animation I put off untill I had a good expression system to use, looks like that's comeing in the form of scripting suport.

the delay is needed, though I supose defaulting to 0 would be fine.

haveing all the data smashed into two lines without any lable would be a real pain, especaly for people learning how to use the code. I know it's a pain to remember wich number does what on the turret line, no harm in someone adding in a second opptional parseing method though.
Title: Re: submodel animation triggers
Post by: Nuke on November 15, 2005, 05:59:40 pm
i just think it should be made as shorthand as possible. it might be difficult at first but once you know it you would be glad its shortened. learning it wouldnt be nearly as hard as learning how to model. the way it is almost threw me off cause it used an = rather than a : , i remember i had a problem with that. i forgot what delay does, i guess its more usefull when youre dealing with a heirarcical animation.
Title: Re: submodel animation triggers
Post by: FireCrack on November 15, 2005, 06:23:52 pm
Dont froget the most important trigger of them all...

mission-Subtype is a name, a new sexp can call animtions of a cerian subtype to any ship/
Title: Re: submodel animation triggers
Post by: Nuke on December 08, 2005, 03:40:59 pm
i was thinking about linked animations, trying to figure out why it would be nessicary to script simple linked animations like moving flight controls in a 3d cockpit. all youd really need is a link to a flight control axis and a range of motion value.

$Subsystem:    flight yoke1,1,0
+non-targetable
$animation=linked
$type="control_bank" ;axis being linked to
+minrange: 0,0,-60  ;range of motion
+maxrange: 0,0,60  ;proportional to control motion

this can also be used for stuff like control surfaces (not that they would do much good in space) and thrust vectoring nozzels. id like to see the controls in my ships working same as they do in starlancer or cfs3.
Title: Re: submodel animation triggers
Post by: WMCoolmon on December 09, 2005, 01:22:38 am
Would everyone be fine with me swapping out the = with the : to make it more compatible, then? I don't think there are any official releases that use it yet, if there are I can make it a warning or something.
Title: Re: submodel animation triggers
Post by: Nuke on December 09, 2005, 01:42:34 am
i have no problem with that. i have no idea why bob did it that way in the first place.

what about an incremental animation. that increments the rotation once and doesnt reset back to its original position once the animation is done. could use it to make those gatling turrets ive been asking for, as well as wheels for ground vehicles. il also need a turret fires event for my gatling turrets.

$Subsystem:    thingie1,1,0
+non-targetable
$animation=triggered
$type="turret_fire_turretname"
+incremental_angle:0,0,5
Title: Re: submodel animation triggers
Post by: WMCoolmon on December 09, 2005, 01:49:02 am
While I'm at it, I should also mention that I plan on making the +non-targetable and the damage carry flag for subsystems into another "$Flags:" sort of thing like ships...I dunno if anyone has released something with them, but I'll probably put a warning on, just in case. There are a number of other things that could be done, and the way those in particular are done in the code will get really wasteful after another two flags.
Title: Re: submodel animation triggers
Post by: Vasudan Admiral on December 09, 2005, 02:29:50 am
*Adds support to the More Triggers! request*
Submodel animation is the thing I've wanted most after the HTL engine, and even in this simplistic form it has enormous potential. Heck, if we get a weapon-fire animation as Nuke suggested, that we can link to a specific turret's firing, turret recoil of all sorts is a pinch. ;)
Other than that, I'd love to see a SEXP trigger, and Nuke's idea of an incrimental setting. :)

And I may as well point out in here that there's a bit of a bug when you restart a mission with any animations in it. It doesn't appear to reset them to their initial state again, which creates some odd effects with opening doors. ;)
Title: Re: submodel animation triggers
Post by: Bobboau on December 09, 2005, 06:23:47 am
for the record the reason I used '=' rather than ':' was because this was origonaly going to go into the properties feild of the subobject.
Title: Re: submodel animation triggers
Post by: Nuke on December 14, 2005, 06:24:21 pm
im adding this to the feature request section of the wiki. be sure to add your mod to the 'supported by' list. and add any other triggers and features you have. im gonna add as much of the stuff mentioned in this thread as i can.
Title: Re: submodel animation triggers
Post by: Vasudan Admiral on December 15, 2005, 01:31:52 am
Added TI, and I'm sure there's plenty more who would want that sort of stuff too. :)