Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Bobboau on December 05, 2004, 02:31:10 am

Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 02:31:10 am
http://freespace.volitionwatch.com/blackwater/dockingtest.zip

I've been working on a few little items over the last few weeks and while I waited for people to respond I have been working on a little side project.

useing the suplied table, mission, and pof file load the mission target the transport go to external veiw get a nice angle of it from the side hit '1'

currently I only have it enabled for docking, but it will be trivial to implement it for _anything_ else.
might be a good idea to start up a wishlist.

it has been designed to have maximum flexability but there are some limits to it, for one thing it must have a singular triggering event, I plan on implementing a linked-to-variable type.

and for those of you who don't know what I'm going on about, remember when I'm vauge like this requiering people to download and runs something to know what I'm talking about it's usualy something realy good.
Title: /*has been playing around*/
Post by: Ransom on December 05, 2004, 02:36:17 am
The build just shows the SCP splash thing then CTDs for me.
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 02:38:22 am
oh crap, I grabed the wrong build, just a second
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 02:46:59 am
alright try it again
Title: /*has been playing around*/
Post by: Singh on December 05, 2004, 02:48:33 am
ill give it a whirl.

what does it do exactly tho?
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 02:50:50 am
:drevil:
Title: /*has been playing around*/
Post by: Singh on December 05, 2004, 02:51:35 am
hmmm...it appears to be asking for starry.pof. I'll edit the mission in FRED and give it a try then.
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 02:54:45 am
oh yeah, I added that sky box thing to that mission, I should have just made a new one
Title: /*has been playing around*/
Post by: Singh on December 05, 2004, 02:58:49 am
oooooooooo

impressive. Love the way it swings (but is the ordering the transport to dock a new thing? Never seen it before). Small bug tho: if i press 2 again, the transport goes on a different docking path, and the things swing back up, but then it DOCKS like that. Having it swing up once the initial docking is aborted then swing back down again would be better tho :D
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 03:02:14 am
hmm if it aborts the docking procedure they don't go back up?

hmm yes it does, stupid docking code, anyway that wasn't the big thing the code behind it is realy nice, you can add a new one with a single function call
Title: /*has been playing around*/
Post by: Singh on December 05, 2004, 03:09:15 am
a new one what? :/

*is confused.
Title: /*has been playing around*/
Post by: Ransom on December 05, 2004, 03:14:13 am
Neat. How complicated can the animation thingy be? Just one movement, or is it possible to do more elaborate movements?
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 03:16:30 am
you can make them very elaborate if you wish useing mulatble triggers of the same type and the delay timer, though I'm sure there will be a few bugs to work out with reverseing them corectly
Title: /*has been playing around*/
Post by: Goober5000 on December 05, 2004, 03:19:23 am
Oh excellent.  This finally got done then.  Very cool. :yes:

Is this in a clean build, so you can put it in CVS?
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 03:29:56 am
there are a few small things WCS wanted that I was intending to  commit also ('detail box' code for there hangers and capship explosion flashing) I'm going to do some clean up, and coment out the actual in game calls (so it isn't actualy reachable, just in case there is something I have missed) before committing it.
Title: /*has been playing around*/
Post by: Goober5000 on December 05, 2004, 03:35:29 am
EDIT: PMing instead
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 04:05:13 am
alright I'm going to sleep now.
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 02:52:54 pm
ok, spent a bit of time adding some idiot proofing, but it isn't perfict, you want to avoid haveing an animation starting while another one is in progress (though it should handel it especaly if you give good animation values)

you also want to try to give good timeing values, the +delay: is the time after the triggering event happens (in millisecond) that the animation will start, +time:4000 is how long you want the game to consiter the animation active, this is for things that will be dependent on the positions of the subobjects (for example gun banks, you don't want to be able to fire untill the models are in position). you can specify an angle in either relitive or absolute coordanants, (though I have been only useing relitive thus far, absolute probly doesn't work right now, it will by the time I get done) for convenience you specify all angle related data in degrees, this all gets converted to radians internaly however, so any code I give will be in radians
+relitive_angle: this is were the subobject is going to end at the end of the animation (unless it gets hijacked by another animation)
+velocity: this is the fastest the subobject will be rotateing, it is in degrees per second
+acceleration: this is how fast velocity will change

now you need to be carefull what you  use, they realy should fit this inequality
velocity^2/acceleration > ending angle
if they don't you run the risk of over shooting the end angle and when it reaches the end of it's motion it will snap into position unrealisticly. now I have some code for catching this, if you make your velocity too high it will change it to something that will work in a simple animation (though I'm thinking I should alow people to specify invalid data to alow complex animations that on there own wouldn't work).

I'm going to commit this soon (and I got the thing you wanted goob) after I do some final checking of stuff.
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 02:56:02 pm
oh, and people, start up a wishlist for triggered animations already
Title: /*has been playing around*/
Post by: Goober5000 on December 05, 2004, 03:13:37 pm
--The SWC guys want movable X-foils.  The key to move them in XWing was AFAIK either 'X' or 'F', both of which are taken (but could be remapped).  That might deserve another key in the interface code.

--Moveable hangar doors, for capships.  For when someone implements linear subsystem movement. :)
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 03:20:48 pm
the hanger doors could be done now, if you just place the center of rotation sufficently far away.

SWC could get what they want by haveing the foil movement atached to selecting a primary weapon bank
Title: /*has been playing around*/
Post by: Goober5000 on December 05, 2004, 03:38:42 pm
Not really... the foils have to move independent of firing.  And they affect the ship... when the foils are closed, you can't fire.  When they're open, you can't hyperspace.
Title: /*has been playing around*/
Post by: SadisticSid on December 05, 2004, 03:53:13 pm
Quote
Originally posted by Goober5000
--The SWC guys want movable X-foils.  The key to move them in XWing was AFAIK either 'X' or 'F', both of which are taken (but could be remapped).  That might deserve another key in the interface code.

--Moveable hangar doors, for capships.  For when someone implements linear subsystem movement. :)


Like the second one. Could you also put in some code to perhaps play a start sound, looping sound while the thing's acellerating and an end sound when it decellerates?
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 04:07:09 pm
well the idea was one bank would be lasers the other would be a dummy bank the animation would be triggered by selecting that bank not fireing it (you can't fire from a bank that you don't have selected) some additional changes could be made to allow the dummy bank to have the other effects that haveing closed foils would have (and to dis-alow linking primaries via a flag).

though if everything else they need is in place adding the animation call in that code would be easy, I could do it in four minutes if I knew were exactly I needed to put them.

to add a new animation type you just add a define in model.h, for example TRIGGER_TYPE_DOCKED, then in ship.cpp there is a function called match_type, it takes the string you put in the table and returns the define you have assosiated with it (this should be prety self explanitory). now finaly were ever you want the animation to start you use ship_start_animation_type first paramiter is a pointer to the ship on wich you want to triger an animation of a type,second paramiter it the type define, third is wich 'direction' (1 or -1) the animation should be procesed in, you need two calls per trigger, one to perform the animation one to undo it (in the opposite direction). though I'm thinking it might be better to have a seperate 'do' and 'undo' animation as when you have complex animations I'm not sure there would be a way to reverse the order and timeing of the assosiated animations.

and it's commited.
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 04:07:44 pm
Quote
Originally posted by SadisticSid


Like the second one. Could you also put in some code to perhaps play a start sound, looping sound while the thing's acellerating and an end sound when it decellerates?


I intend to.
Title: /*has been playing around*/
Post by: aldo_14 on December 05, 2004, 04:37:54 pm
Pivot based animations - i.e so you could have a Saths' prongs move invards by rotating from the base. (not kinematics, natch, but we can't have everything...)
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 04:43:11 pm
if you made them seperate submodels and someone can find the point in the code were it should start, yes you could do that
Title: /*has been playing around*/
Post by: Grimloq on December 05, 2004, 06:14:17 pm
what was that mission supposed to do? it didnt od anything for me, even after i fixed the background pof...
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 06:45:06 pm
did you look at the transport and hit 1 like I told you to?
it was suposed to demonstrate my new submodel animation system.

if I can find a function the does the "all ships' first frame of normal in game existance" initalisatoin I'll have animation trigered by weapon bank selection ready to go.
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 07:39:37 pm
Code: [Select]
$Name:                          GTF Hercules
$Short name: TFight6
$Species:                       Terran
+Type:                          XSTR("Heavy Assault", 2945)
+Maneuverability: XSTR("Poor", 2946)
+Armor:                         XSTR("Heavy", 2947)
+Manufacturer: XSTR("Han-Ronald Corp", 2948)
+Description: XSTR( " ", 2949)
$end_multi_text
+Tech Description:
XSTR("The old workhorse of the Terran fleet, the Hercules is a beloved but aging design. It was the mainstay of the Terran forces during the Great War, but it is slowly being phased out of the modern fleet. As they are replaced by Herc IIs, Myrmidons, and other recent designs, Hercules fighters are increasingly relegated to training and guard duties far from the front lines. Pilots who've flown Hercs for years love the ship's heavy armor and firepower and have learned to compensate for its low speed and poor maneuverability. The old Hercs are still widely used by NTF forces.", 2950)
$end_multi_text
+Length: 20 m
+Gun Mounts: 6
+Missile Banks: 2

$POF file:                      fighter06.pof
$Detail distance: (0, 80, 300, 900, 1500)
$Show damage: YES
$Density:                       1
$Damp:                          0.2
$Rotdamp:                       0.35
$Max Velocity: 0.0, 0.0, 50.0                  ;; in x/y/z -- z only specified forward.  use special tokens for backward movement
$Rotation time: 4.0, 4.5, 4.0
$Rear Velocity: 0.0
$Forward accel: 3.0
$Forward decel: 1.5
$Slide accel: 0.0
$Slide decel: 0.0
$Expl inner rad: 25.0
$Expl outer rad: 75.0
$Expl damage: 25.0
$Expl blast: 1000.0
$Expl Propagates: NO                                                      ;; If set to Yes, then when the ship dies, the explosion propagates through it.
$Shockwave Speed: 0.0                                             ;; speed shockwave expands at, 0 means no shockwave
$Allowed PBanks: ( "Subach HL-7" "Akheton SDG" "Morning Star" "Prometheus S" "Prometheus R" "UD-8 Kayser" "Lamprey" "Circe" "Maxim")
;;$Allowed Dogfight PBanks: ( "MorningStar D" "Prometheus D" "Lamprey" "Circe" )
$Default PBanks: ( "Subach HL-7" "Prometheus R" )
$Allowed SBanks: ( "Rockeye"  "Tempest" "Harpoon" "Trebuchet" "Hornet" "Tornado" "Hornet#Weak" "EMP Adv." "Infyrno" )
;;$Allowed Dogfight SBanks: ( "Rockeye D"  "Tornado D" "Infyrno D" "Piranha" )
$Default SBanks: ( "Harpoon" "Hornet" )
$SBank Capacity: ( 60, 60 )
$Shields:                       600
$Shield Color: 100 100 255
$Power Output: 3.0
$Max Oclk Speed: 64.0
$Max Weapon Eng: 150.0
$Hitpoints:                     250
$Flags:                         ( "player_ship" "default_player_ship" "fighter" "in tech database")
$AI Class:                      Captain
$Afterburner: YES
+Aburn Max Vel: 0.0, 0.0, 120.0
+Aburn For accel:       0.7
+Aburn Fuel:            300.0
+Aburn Burn Rate:       60.0
+Aburn Rec Rate:        25.0
$Trails:
+Bitmap: ABtrail
+Width: 1.0
+Alpha: 0.5
+Life: 5
$Countermeasures: 25
$Scan time:                     2000
$EngineSnd: 126                   ;; Engine sound of ship
$Closeup_pos: 0.0, 0.0, -30
$Closeup_zoom: 0.5
$Shield_icon: shield-f06
$Ship_icon:                     iconfighter06
$Ship_anim:                     ssfighter06
$Ship_overhead: loadfighter06
$Score: 10
$Trail:
+Offset: 6.59 -4.8 -3.33
+Start Width: 0.25
+End Width: 0.05
+Start Alpha: 1.0
+End Alpha: 0.0
+Max Life: 1.0
+Spew Time: 60
+Bitmap: Contrail01
$Trail:
+Offset: -6.59 -4.8 -3.33
+Start Width: 0.25
+End Width: 0.05
+Start Alpha: 1.0
+End Alpha: 0.0
+Max Life: 1.0
+Spew Time: 60
+Bitmap: Contrail01
$Trail:
+Offset: 0 -7.2 -3.2
+Start Width: 0.25
+End Width: 0.05
+Start Alpha: 1.0
+End Alpha: 0.0
+Max Life: 1.0
+Spew Time: 60
+Bitmap: Contrail01
$Subsystem: sensors,                                10,0.0
$Subsystem: communications, 10,0.0
$Subsystem: weapons,                                10,0.0
$Subsystem: navigation,                     10,0.0
$Subsystem: engine,                         35,0.0

$Subsystem: primary1a,                         1,0.0
+non-targetable
$animation=triggered
$type="primary_bank_1"
+delay:0
+relitive_angle:0,-180,0
+velocity:0,90,0
+acceleration:0,60,0
+time:4000
$Subsystem: primary1b,                       1,0.0
+non-targetable
$animation=triggered
$type="primary_bank_1"
+delay:0
+relitive_angle:0,180,0
+velocity:0,90,0
+acceleration:0,60,0
+time:4000
$Subsystem: primary2,                         1,0.0
+non-targetable
$animation=triggered
$type="primary_bank_2"
+delay:0
+relitive_angle:-7,0,0
+velocity:5,0,0
+acceleration:60,0,0
+time:1500
$Subsystem: secondary1,                         1,0.0
+non-targetable
$animation=triggered
$type="secondary_bank_1"
+delay:0
+relitive_angle:-180,0,0
+velocity:90,0,0
+acceleration:60,0,0
+time:3000
$Subsystem: secondary2,                         1,0.0
+non-targetable
$animation=triggered
$type="secondary_bank_2"
+delay:0
+relitive_angle:-180,0,0
+velocity:90,0,0
+acceleration:60,0,0
+time:3000


http://freespace.volitionwatch.com/blackwater/animationtest01.zip

it isn't perfict (like I said, I need a first instent in game function, to get them in the right position) but it's prety cool.
this is just intended as a test.
Title: /*has been playing around*/
Post by: Goober5000 on December 05, 2004, 08:11:53 pm
Quote
Originally posted by Bobboau
if I can find a function the does the "all ships' first frame of normal in game existance" initalisatoin I'll have animation trigered by weapon bank selection ready to go.
That's not the proper way to implement S-foils.

Don't worry about it.  I'll add it soon as I get done with exams.
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 08:22:38 pm
well regardless, many people have wanted it, I remember a realy nice bomber nico made that was suposed to take advantage of this once we implemented it. I actualy was doing this for it's own sake anyway.


...you know, we could hook it into the afterburner, it's suposed to make the thing go faster right? just start up the animation and wait untill the animation is done before engageing the afterburner.
and you can atach multable animations to a single subobject.
Title: /*has been playing around*/
Post by: Trivial Psychic on December 05, 2004, 09:25:29 pm
Quote
Originally posted by Bobboau

$Subsystem:               primary1a,  1,0.0
   +non-targetable
   $animation=triggered
   $type="primary_bank_1"
   +delay:0
   +relitive_angle:0,-180,0
   +velocity:0,90,0
   +acceleration:0,60,0
   +time:4000

OMFG!! Does this mean we can impliment destroyable, non-targettable subsystems?
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 10:18:19 pm
oh, yeah
Title: /*has been playing around*/
Post by: Bobboau on December 05, 2004, 10:26:22 pm
and if you look in the wcs forum you will see some other cool features.
Title: /*has been playing around*/
Post by: Nuke on December 06, 2004, 02:24:10 am
hey could we have recoiling guns now? if ya can only make subobject rotate (not translate) thats no problem. just change the subobject origin to be really far from the gun and then trigger a fast rotate back and a slower rotate forward. i hope this doesnt screw with gatling guns.
Title: /*has been playing around*/
Post by: aldo_14 on December 06, 2004, 04:07:10 am
Bob, why the hell do you always implement these things after I've modelled my last ever GTVA models...... gah.
Title: /*has been playing around*/
Post by: Bobboau on December 06, 2004, 10:04:21 am
I can probly adapt the exsisting code to manage translation too, later.
Title: /*has been playing around*/
Post by: Nuke on December 06, 2004, 10:29:22 am
cool. is the current system one way only, or will it return the ojects to their original position? or does it toggle? it would be a better canidate for gatling guns than the current setup cause it allows for acceleration/deceleration. just wish there was a weapon flag to accelerate/dcelerate the rate of fire to match. real gatling guns take a bit of time to spin up.

as for trigger events:
any motion you can do with your ship, should be proportional to the amount (sorta like control surfaces and rcs trusters)
weapon events
stealth mode
burners
sexp trigger of course, would be good if you could just give it the ship and the subobject and it just runs the ani in the table
dock/undock, should toggle when docking and reverse when undocking, for doking clamps.
subspace jump
not sure if you could do it with this but id like to see gatling turrets :D
oh, and can you make the glowpoints move with them (could use this as a force field effect on the launch tupes of the ssj dante)
performing scan (be cool if you could have a dummy subobject with a glowpoint and thin have the glow come on, scan across and go off)

also with that last one would it be possible to make a dummy object to attach a glowpoint to, without haveing to recompile the whole model?
Title: /*has been playing around*/
Post by: redmenace on December 06, 2004, 11:07:31 am
Gun Ports!!!;)
Title: /*has been playing around*/
Post by: Grimloq on December 06, 2004, 10:22:55 pm
HANGAR DOORS!!!


serioiusly, will this be finished and implemented into the 3.6.5? if it is, then ill release my new hecate with an opening and closing door... :) thatll make that there hanger look cool! :lol:
Title: /*has been playing around*/
Post by: redmenace on December 06, 2004, 11:07:29 pm
The way this are typically done in the SCP, we have a code freeze then we release then add features. Or atleast this time, that is the how things are being done.
Title: /*has been playing around*/
Post by: Bobboau on December 06, 2004, 11:14:06 pm
I'm thinking I'm going to have to keep track of animation types and remove them from the queue when a reveral of an animation is applied...

expect me to get a lot of stuff done two weeks from now.
Title: /*has been playing around*/
Post by: redmenace on December 06, 2004, 11:28:20 pm
Sounds great.
Title: /*has been playing around*/
Post by: Drew on December 06, 2004, 11:30:31 pm
it would be if we could add image support. If we could speceify an image or ani to be played during the animation.

Like you could make somthing open, then start glowing or somthing.

oh and bob,  thruster glows are showing tru the back of the models again, at least on my PC.

IF you wanted to make something that opened and revealed engines, the thruster glows would show trough that somthing. Its kinda annoying.
Title: /*has been playing around*/
Post by: Nuke on December 07, 2004, 02:12:02 am
ive been going over the table code.

$Subsystem: primary1a, 1,0.0  
+non-targetable
$animation=triggered
$type="primary_bank_1"
+delay:0
+relitive_angle:0,-180,0
+velocity:0,90,0
+acceleration:0,60,0
+time:4000

the animation field should also have options such as toggle, while, and proportional. toggle will do the event the first time its triggered and then do the reverse the second time (example docking bay doors).  while will continue an animation so long as the event is being carried out (such as miniguns and gun ports). proportional is for control surfaces and rcs thrusters, thrust vectoring and the like, theese are done in proportion to the players controls at any given time. id also like to be able to trigger glowpoints as well.  also anyone doing a gundam mod would probibly want to be able to take advantage of subobject hierarchy. also is there any wat to delay the trigger event, so say the missiles wont fire until the gunports open?
Title: /*has been playing around*/
Post by: Bobboau on December 07, 2004, 08:15:09 am
triggered animations will generaly reverse themselves (or atleast that's how it's planed currently) this is becase every triggered event basicly has an anti-event, every time you hit the afterburner you eventualy have to release it. there will also be linked animations wich will be linked to a variable, such as current yaw or pitch or thrust or something of that nature. it's sort of an int/float distinction between the two animation types, something that is continuos and variable would be linked something that happens due to some sort of event would be triggered.
Title: /*has been playing around*/
Post by: Grimloq on December 07, 2004, 03:04:33 pm
'gatling' guns can be done in vanilla. take a look at the Jotun from inferno.

still, looking forward to this :yes:

can someone dumb this down for me? im a lowly modeller :blah:
Title: /*has been playing around*/
Post by: Alan Bolte on December 07, 2004, 03:58:51 pm
Animations, eh?
The Starfox mod should be happy about this. The sheer amount of animated models in the original Starfox continues to amaze me. Walkers, all types of doors, ships with flapping wings, stuff (including said doors) that activates when it takes a certain amount of damage, things that move like sea life, gunports, etc. Then there's the variable wing geometry of the later Arwings.
Title: /*has been playing around*/
Post by: Drew on December 07, 2004, 04:58:57 pm
sf 64 right?  the SNES didnt have much flapping wings.
Title: /*has been playing around*/
Post by: Nuke on December 07, 2004, 05:03:46 pm
ive been using gatling guns but i didnt know they worked in the original game, why didnt anyone tell me about that? :D
Title: /*has been playing around*/
Post by: Col. Fishguts on December 07, 2004, 05:38:07 pm
Quote
Originally posted by Drew
sf 64 right?  the SNES didnt have much flapping wings.


On the contrary....there were lots of flapping things in the SNES version (not the Arwing themselves though)
Title: /*has been playing around*/
Post by: Grimloq on December 07, 2004, 06:07:12 pm
Quote
Originally posted by Nuke
ive been using gatling guns but i didnt know they worked in the original game, why didnt anyone tell me about that? :D


sure! theyre just rotating parts. then just pop a gunpoint or ten on the end and there yo ugo, gatling gun :)
Title: /*has been playing around*/
Post by: Trivial Psychic on December 10, 2004, 01:09:19 pm
I thought I'd ask this here.  Its regarding the destroyable, non-targettable submodels.  Since they are also classified as non-targettable subsystems, will they impact the limit on the number of subsystems used in a mission?  If they can be controled in FRED, it could be useful as part of a ship's initial status, to have some these submodels destroyed of a ship is required to look dammaged.  Consequently, it'd look kinda weird if a cap-ship that is supposed to be on the verge of structural collapse (the Hope from FS1 for example), still has all its decorative submodels intact, because the FREDder couldn't pre-set them as destroyed.

Later!