player.FaceDirection crashes game in AGS 3.6.2.10

Started by Honza, Fri 30/05/2025 21:41:52

Previous topic - Next topic

Honza

Two days ago I recompiled Shards of God in AGS 3.6.2.10. Today, I got this fatal crash report from a player:



I replicated the crash and found out it's caused by a simple "player.FaceDirection (eDirectionUp);" line of code - if I remove this line, the game proceeds normally. There wasn't an issue with this in the previous version of the engine (3.6.0.50), and I haven't made any changes to the game, I only recompiled it.

For a bit more context, the line is in a room script, in a function which is triggered by looking at a dead body:

Code: ags
function open_victim_detail ()
{
player.Walk (130, 195, eBlock);
player.FaceDirection (eDirectionUp); // This is what crashes the game
gui_fade ("in", gBody);
}

function oVictim_Look()
{
open_victim_detail ();
}

FortressCaulfield

every time this has happened to me its because the character is using a view that doesn't have an up loop

walk can live with that, face can't
"I can hear you! My ears do more than excrete toxic mucus, you know!"

-Hall of Heroes Docent, Accrual Twist of Fate

Crimson Wizard

This is not a regular "missing loop" error, this is a unhandled exception in the engine, which must not happen.

Honza

Quote from: FortressCaulfield on Fri 30/05/2025 21:44:00every time this has happened to me its because the character is using a view that doesn't have an up loop

walk can live with that, face can't

Just to be triple-sure, I tried replacing the line with "player.Loop = 3;" and it works.

FortressCaulfield

Quote from: Crimson Wizard on Fri 30/05/2025 21:51:40This is not a regular "missing loop" error, this is a unhandled exception in the engine, which must not happen.

I have gotten this error from missing loops, or at least, similar situations with facedirection which were all fixed by addressing the loop issue. In fact I don't think I've ever seen a missing loop error, just this.

A character only had a right-facing idle but can face left or right to talk. If I talked to her from the left while idling, it called facedirection to turn her left and I got an unhandled exception. I'll start documenting those if I see more.
"I can hear you! My ears do more than excrete toxic mucus, you know!"

-Hall of Heroes Docent, Accrual Twist of Fate

Crimson Wizard

If engine displays a message with "Illegal exception" in the title, and similar structure ("An exception 0xxxxx" occured..."), that's a bad error in the engine, not a game's mistake. Please report such errors as AGS bugs.

Crimson Wizard

@Honza I cannot reproduce this problem with your script alone. There must be something in the game's setup that contributes to this.

Since I've already got your game earlier, could you tell how do I get to this scene and reproduce this error?
(or, do you have any save made just before this?)

Honza

Quote from: Crimson Wizard on Fri 30/05/2025 23:03:29@Honza I cannot reproduce this problem with your script alone. There must be something in the game's setup that contributes to this.

Since I've already got your game earlier, could you tell how do I get to this scene and reproduce this error?
(or, do you have any save made just before this?)

This is a different game (Shards of God). I'll send you a download link including the save.

Crimson Wizard

It turned out that the crash was caused by reading Character.DestinationX or DestinationY property while character is turning to face location.

The new temp build with a fix will be available here:
https://cirrus-ci.com/task/5641890608971776

Honza

Quote from: Crimson Wizard on Sat 31/05/2025 03:51:34It turned out that the crash was caused by reading Character.DestinationX or DestinationY property while character is turning to face location.

The new temp build with a fix will be available here:
https://cirrus-ci.com/task/5641890608971776


Great, it doesn't crash anymore. Thank you!

SMF spam blocked by CleanTalk