Modding, Mission Design, and Coding > The Scripting Workshop

Hard CTD on write to custom HUD gauge text

(1/2) > >>

xenocartographer:
Title says it all. The following are minimal *-sct.tbm and *-hdg.tbm files to reproduce the issue, adapted from my actual mod files:


--- Code: ---#Conditional Hooks

$Application: FS2_Open

$State: GS_STATE_GAME_PLAY
$On Frame: [
if mn.getMissionTime() > 5 then --rule out some sort of first-frame issue
local gauge = hu.getHUDGaugeHandle("TBeamStatus")
if gauge then gauge.Text = "DEBUG" end
end
]

#End
--- End code ---


--- Code: ---#Gauge Config
$Base:       (1024,768)
$Gauges:
+Custom:
Scale Gauge: NO
Origin: (1, 0.5)
Offset: (-159, 0)
Name: TBeamHeader
Text: Tractor Beam
X Offset: 2
Y Offset: 2
Gauge Type: CENTER_RETICLE
Slew: NO
Active by default: YES
Filename: escort1
+Custom:
Scale Gauge: NO
Origin: (1, 0.5)
Offset: (-159, 13)
Name: TBeamTarget
Text:
X Offset: 4
Y Offset: 1
Gauge Type: CENTER_RETICLE
Slew: NO
Active by default: YES
Filename: escort2
+Custom:
Scale Gauge: NO
Origin: (1, 0.5)
Offset: (-159, 24)
Name: TBeamStatus
Text:
X Offset: 4
Y Offset: 1
Gauge Type: CENTER_RETICLE
Slew: NO
Active by default: YES
Filename: escort3
$End Gauges
#End
--- End code ---

As soon as the mission clock hits 5 seconds (well, right before that frame is drawn, I think), the game either hangs for a bit and crashes, or just immediately crashes. In either case, the usual FSO error popup is missing, even with debug builds. I've attached a log generated by a debug build.

[attachment stolen by Russian hackers]

xenocartographer:
Found a workaround with help from IRC folks, and a recent nightly's actually fixed the issue, so /shrug

chief1983:
Heh, if it's the timer code fix, you're welcome :)

Well, not for the fix, but for calling attention to what needed to be fixed.

AdmiralRalwood:

--- Quote from: chief1983 on February 21, 2017, 06:41:22 pm ---Heh, if it's the timer code fix, you're welcome :)

Well, not for the fix, but for calling attention to what needed to be fixed.

--- End quote ---
Doubt the timer code would cause a crash there; 5 seconds isn't long enough for an overflow, an overflow shouldn't cause a crash anyway, and the mn.getMissionTime() call clearly works because it waits until the correct amount of time has elapsed before crashing. Unfortunately, diagnosing exactly why it did crash would require figuring out when the problem went away, and that's an awful lot of troubleshooting for a bug that appears to have already been fixed...

chief1983:
Yeah it seemed awfully short to me too.

Navigation

[0] Message Index

[#] Next page

Go to full version