Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: headdie on September 04, 2012, 05:22:30 am

Title: Issues with $Substitute: and Turrets
Post by: headdie on September 04, 2012, 05:22:30 am
Is there an issue with the $Substitute: weapons table option and turrets? I ask because I am getting this which is resolved if I comment out the entries

Code: [Select]
...
Entering game at time =  55.442
Frame  1 too long!!: frametime = 0.750 (0.750)
nothing ok to fire
nothing ok to fire
nothing ok to fire
nothing ok to fire
nothing ok to fire
nothing ok to fire
nothing ok to fire
nothing ok to fire
nothing ok to fire
nothing ok to fire
ASSERTION: "position != NULL" at weapons.cpp:4835
 'TRD-Demolisher 1' is trying to fire a weapon that is not selected
Freeing all existing models...

the weapon in question is
Code: [Select]

$Name: RHMG-Reaper
+Title: RHMG-63 Reaper
+Tech Description:
RHMG-63 Reapers are the standard Rail based CIWS on most Terran Republic warship classes.  With an effective range of over 7300 meters and 350 rounds per minute is able to destroy light fighters and transports in quick order and provide heavier strike craft a reason to act with caution.
$end_multi_text
$Model File: 15x60mm.pof
$Mass: 0.03
$Velocity: 2465.25
$Fire Wait: 0.32 ;; in seconds
$Damage: 4.28
$Damage Type:       Ballistic
$Armor Factor: 1.0
$Shield Factor: 0.25
$Subsystem Factor: 0.75
$Lifetime: 3
$Energy Consumed: 0.01 ;; Energy used when fired
$Cargo Size: 0.5 ;; Amount of space taken up in weapon cargo
$Homing: NO
$LaunchSnd: 163 ;; The sound it makes when fired
$ImpactSnd: 85 ;; The sound it makes when it hits something
$Rearm Rate: 12.0
$Flags: ("ballistic" "in tech database" "same turret cooldown" "small only")
$Substitute: RHMG-ReaperT
+period: 6

$Name: RHMG-ReaperT
$Model File: none
   @Laser Bitmap:                   newglo9
   @Laser Glow:                     2_laserglow03
   @Laser Color:                    250, 250, 250
   @Laser Color2:                   128, 128, 128
   @Laser Length:                   10.0
   @Laser Head Radius:              1.0
   @Laser Tail Radius:              1.0
$Mass: 0.03
$Velocity: 2465.25 ;; speed of the weapon (initially) -- may or may not change
$Fire Wait: 0.32 ;; in seconds
$Damage: 4.28
$Damage Type:            BalisticAP
$Armor Factor: 0.8
$Shield Factor: 0.15
$Subsystem Factor: 0.0
$Lifetime: 3
$Energy Consumed: 0.1 ;; Energy used when fired
$Cargo Size: 1.0 ;; Amount of space taken up in weapon cargo
$Homing: NO
$LaunchSnd: 162 ;; The sound it makes when fired
$ImpactSnd: 85 ;; The sound it makes when it hits something
$Rearm Rate: 20.0
$Flags: ( "ballistic" "same turret cooldown")
$Trail: ;; Trail cannot be set if Exhaust is set
+Start Width: 0.75                                       ;; Width of trail nearest missile
+End Width: 0.15                                       ;; Width of trail before it "evaporates"
+Start Alpha: 0.75
+End Alpha: 0.0
+Max Life: 0.25                                       ;; how many seconds before trail disappears
+Bitmap: newmiss3       

the T variant is a bright tracer round used for both visual effect and to help the player see where it is firing.  the turret is a single fire point multipart tabled as

Code: [Select]
$Subsystem:                     turret07aff, 2, 5.0
$Default pBanks: ( "RHMG-Reaper" )
$Turret Base FOV: 360
$flags: ( "fire down normals" "check hull" )


If it is an issue with the combination of $Substitute: and turrets I can run the weapon as just as the main Reaper and replace the model file info with the tracer's laser entry but I would obviously prefer my planned setup as that is how I want it to look.
Title: Re: Issues with $Substitute: and Turrets
Post by: zookeeper on September 04, 2012, 05:41:57 am
Looks like it just plain doesn't work for turrets. More specifically, weapon/weapons.cpp:get_pointer_to_weapon_fire_pattern_index() only looks for substitutions in the ship's primary banks, not in its turrets' banks.

Sounds like a bug to me.
Title: Re: Issues with $Substitute: and Turrets
Post by: headdie on September 04, 2012, 05:46:59 am
In that case I will file a Mantis

edit:

Mantis filed as issue 2707
http://scp.indiegames.us/mantis/view.php?id=2707
Title: Re: Issues with $Substitute: and Turrets
Post by: Spoon on September 04, 2012, 02:45:25 pm
Already reported this way ago when the feature was made.
The guy that coded it just didn't felt like making it work for turrets.
Title: Re: Issues with $Substitute: and Turrets
Post by: headdie on September 04, 2012, 02:54:00 pm
I just did a Mantis search on Substitute cant cant find any issues open or otherwise relating to this.
Title: Re: Issues with $Substitute: and Turrets
Post by: Dragon on September 04, 2012, 03:09:12 pm
Swifty (was it he?) mentioned he'd like to add turret functionality to this, but he needed something else before he could do that. It was quite some time ago, I don't remember the details, but it's planned.
Title: Re: Issues with $Substitute: and Turrets
Post by: headdie on September 04, 2012, 03:24:12 pm
as this is a bug will in all likely hood carry on into the next nightly cycle I have added *Feature causes crash to desktop when weapon is used with a turret. to the Wiki entry for the feature.