View Issue Details

IDProjectCategoryLast Update
0009738Shattered HavenCrash/ExceptionJan 7, 2013 11:09 am
ReporterGameMaker24 Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Summary0009738: Script freezes the game when assigning text to NPC.
DescriptionI have written a script that places an NPC on top of BG Stairs (in case that matters), moves her along a preset path, calls a message script, and then assigns text to be read if the player addresses her.

The game freezes when the SETTEXT command is used in this instance. By freezing, I mean that the game doesn't do anything more than it's already doing. Music continues to play and the mouse continues to be moveable, but mouse clicks and keyboard actions do not turn back on. The only way "out" of the game at this point is Ctrl+Alt+Delete.

Further, after testing a few times to determine the cause described above, my laptop experienced a huge, yet fluctuating, memory lag because I had simply ended the game in Task Manager. (though you probably know this)

Here is the complete scripting text. The only condition I'm using is ONCEONLY.

FGADD 431 NPCArlene
MOVEFG 431 398 4
MOVEFG 431 302 4
MOVEFG 431 271 4
MOVEFG 431 277 4
MOVEFG 431 213 4
MOVEFG 431 182 4
TEXTBOT LelaText1
SETTEXT FG 431 LelaText2
TagsNo tags attached.
Internal WeightMajor Problem

Activities

GameMaker24

Oct 13, 2012 7:06 pm

manager   ~0028692

In case it's important, this is the text I was going to assign using LelaText2. The only condition I set was ISTEXT.

Lela: I'm truly sorry about your mom. But I'm certainly happy to have another child around!

GameMaker24

Nov 4, 2012 9:42 am

manager   ~0028894

I went back and tried assigning text to this sprite after having started her on a tile that is NOT stairs, but the result was the same.

GameMaker24

Nov 4, 2012 4:29 pm

manager   ~0028897

After I happened to be looking at the script for Willis as he stands outside Stantonsburg, I realized that it uses SETTEXT successfully, but it does so during the PRELOAD condition. I created a PRELOAD script for Lela's entrance and it worked great!

I'm leaving this issue open as a reminder to edit the Encyclopedia's script instructions, which lists SETTEXT under the "Commands (Anytime)" category.

Chris_McElligottPark

Nov 21, 2012 8:13 pm

administrator   ~0029038

I have not specifically tried to duplicate this yet, but I did just put in the following, which may help:

-Previously, if invalid commands were entered, or if the game encountered an error while executing a command, it could go into an infinite loop. This should no longer happen, and instead it should just throw up the error and get on with life, skipping the rest of the script.

GameMaker24

Nov 23, 2012 3:02 pm

manager   ~0029048

I tried removing the PRELOAD condition from this script, since it would be nice to not have Lela standing on the stairs, waiting for Pierce to take his first step before she runs through the halls to greet him.

Unfortuantely, even with your error-trapping in place, the game still goes into an infinite loop here, where the only escape is ctrl+alt+del. No error message appears, it gives no indication that anything is wrong, but interface usage is lost.

Chris_McElligottPark

Nov 23, 2012 6:40 pm

administrator   ~0029051

Can you give me steps to repro? It looks like you have the script itself above, but what level and sublevel does that get used in?

GameMaker24

Nov 23, 2012 6:45 pm

manager   ~0029052

Oh! How did I leave that out? :) It's 001 Main.

GameMaker24

Nov 23, 2012 6:46 pm

manager   ~0029053

To reproduce, just change the first script to include the PRELOAD condition.

GameMaker24

Dec 28, 2012 11:29 pm

manager   ~0029339

Today, I was going to create a script that replaces the text spoken by the old hermit in Snow Hill, to be triggered by talking to her the first time. (No need for her to repeat her long welcome.) But, I realized I can't because it wouldn't be a PRELOAD event.

Still no rush, just finding more reasons to make SETTEXT work beyond PRELOAD. :)

Chris_McElligottPark

Jan 4, 2013 6:37 pm

administrator   ~0029553

Thanks!

* BGREPLACE and SETTEXT both had glitches in them if they were used not as PRELOAD scripts, where they would just keep running in an infinite loop.
** This has been fixed for both of them.
** Additionally, extra checking has been put in place so that if this ever happens again with a different command, it will detect it, break the infinite loop, and tell the player.
** And lastly, the text for level 001 Main is being set now, since I was using that to test it with. :)

GameMaker24

Jan 5, 2013 4:19 pm

manager   ~0029588

Yay! So glad to have this fixed! When testing, I noticed your SETTEXT implementation at Level 001 had its first two arguments swapped, so it wasn't setting her text. I fixed it, and I only mention because the game didn't give any kind of warning that an error had occurred.

Chris_McElligottPark

Jan 7, 2013 11:09 am

administrator   ~0029657

Thanks!

* Previously, the second argument of SETTEXT, OFFSETFG, and BGEXIT was case-sensitive. Now they are now.

* Previously, if the second argument of SETTEXT, OFFSETFG, and BGEXIT was not recognized, it would just silently fail. Now it will actually notify the player of the issue.

Issue History

Date Modified Username Field Change
Oct 13, 2012 6:31 pm GameMaker24 New Issue
Oct 13, 2012 6:31 pm GameMaker24 Status new => assigned
Oct 13, 2012 6:31 pm GameMaker24 Assigned To => Chris_McElligottPark
Oct 13, 2012 7:06 pm GameMaker24 Note Added: 0028692
Nov 4, 2012 9:42 am GameMaker24 Note Added: 0028894
Nov 4, 2012 4:29 pm GameMaker24 Note Added: 0028897
Nov 21, 2012 8:13 pm Chris_McElligottPark Note Added: 0029038
Nov 21, 2012 8:13 pm Chris_McElligottPark Status assigned => feedback
Nov 23, 2012 3:02 pm GameMaker24 Note Added: 0029048
Nov 23, 2012 3:02 pm GameMaker24 Status feedback => assigned
Nov 23, 2012 6:40 pm Chris_McElligottPark Note Added: 0029051
Nov 23, 2012 6:45 pm GameMaker24 Note Added: 0029052
Nov 23, 2012 6:46 pm GameMaker24 Note Added: 0029053
Dec 28, 2012 11:29 pm GameMaker24 Note Added: 0029339
Jan 4, 2013 6:37 pm Chris_McElligottPark Note Added: 0029553
Jan 4, 2013 6:37 pm Chris_McElligottPark Status assigned => resolved
Jan 4, 2013 6:37 pm Chris_McElligottPark Resolution open => fixed
Jan 5, 2013 4:19 pm GameMaker24 Note Added: 0029588
Jan 7, 2013 11:09 am Chris_McElligottPark Note Added: 0029657
Apr 14, 2014 9:28 am Chris_McElligottPark Category Bug - Crash or Exception => Crash/Exception