Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: headdie on June 20, 2010, 04:04:40 pm

Title: question about the animation code
Post by: headdie on June 20, 2010, 04:04:40 pm
I have a fighter which has an external rotating Gatling style weapon in its own weapon primary bank (gunbank3).  Using the animation code I have achieved a gun that rotates every time bank 3 is selected but only for 1 rotation.

what I am after is one of the following
a gun that rotates when bank 3 is selected for the full duration that it is selected then stops when the bank is deselected (preferred)
or
a gun that just rotates for the duration of the mission

the current table flags are
Code: [Select]
$Subsystem: subobject01-Gat_Gun, 2, 0.0
$animation: triggered
$type: primary_bank
+delay: 0
+relative_angle: 0,0,360
+velocity: 0,0,500
+acceleration: 0,0,100

POF values
Code: [Select]
name:       subobject01-Gat_Gun
movement:   Rotate
axis:        Y Axis
properties:  $special=subsystem
             $triggered:
Title: Re: question about the animation code
Post by: Colonol Dekker on June 20, 2010, 05:38:12 pm
From memory Nukemod used the trigger "primary fired" on a gatling gun I think. . . . .
 
 
Don't quote me though :nervous:
Title: Re: question about the animation code
Post by: FUBAR-BDHR on June 20, 2010, 11:46:57 pm
Duration of the mission should be easy but not very good.  All you should have to do is make the gun a subsystem, set rotation in the pof to the axis and set a rotation time either in the pof or table.  It would be a standard rotating subsystem and the fire points would just be related to the ship hull. 

As for the while firing one (which would be more realistic) I have no idea.  The animation code is a bit buggy but there may be fixes in newer builds. 
Title: Re: question about the animation code
Post by: SpardaSon21 on June 21, 2010, 12:06:39 am
If you add the spin on firing, maybe keep the spin on weapon selection to make it seem as if the weapon is readying itself?
Title: Re: question about the animation code
Post by: Getter Robo G on June 29, 2010, 04:17:40 am
Nuke's MG takes a second to spin up to speed before firing (but will as long as you hold the trigger) IIRC...


Title: Re: question about the animation code
Post by: The E on June 29, 2010, 04:22:16 am
Actually, after doing a bit of research on the subject, rotating guns is ridiculously easy.

Take a look at the following lines in weapons.tbl:

http://www.hard-light.net/wiki/index.php/Weapons.tbl#.24Submodel_Rotation_Speed:

and

http://www.hard-light.net/wiki/index.php/Weapons.tbl#.24Submodel_Rotation_Acceleration:

If these are set, the external model assigned to that weapon will rotate around its mountpoint at the set speed. It will start firing once it reaches the set rotation speed.
Title: Re: question about the animation code
Post by: Nuke on June 30, 2010, 12:41:50 am
From memory Nukemod used the trigger "primary fired" on a gatling gun I think. . . . .
 
 
Don't quote me though :nervous:

not quite. the gatling guns all use weapon models. the gatling turrets are scripted. the only place i use animation code is for doors or missile bays. of course on old versions of nukemod i attempted to use gatling turrets which used animation code. this didnt work at all and was something i forgot to take out.

Nuke's MG takes a second to spin up to speed before firing (but will as long as you hold the trigger) IIRC...

those would simply use weapon models. the scripted gatling turrets act more like real gatling guns, where the rate of fire is directly proportional to the guns current rpm*number of barrels. they fire in timed bursts where the guns spin up, wait some duration, then spin down. as far as the ai is concerned its only firing about as fast as a blob turret. its armed with a weapon that is kind of a dummy with no damage, sounds or effects. when the turret has fired, it tells the script and the script starts a burst. the effect is totally awesome. it also doesnt break difficulty scaling because the gun will fire bursts at a frequency determined by the engine. the burst does the same amount of damage but is less frequent at lower difficulty.