A certain action makes my game crash for no apparent (to me) reason. Here is my code:
Code: ags
Using inventory item 1 on that hotspot returns the following message, regardless of whether the StrCaseComp is 0 or 1:
Line 50 of the room script is the following:
Code: ags
I don't understand why it doesn't work, as the exact same line works perfectly in other places.
Any help will be appreciated.
// script for Hotspot 2 (bookcase): Use inventory on hotspot
if (player.activeinv==1) {
if (StrCaseComp("Curtis' favor", thought)==0) {
player.Walk(122, 280, eBlock);
player.FaceLocation(122, 100, eBlock);
Wait(20);
player.Walk(171, 280, eBlock);
player.FaceLocation(171, 100, eBlock);
Wait(20);
player.Walk(255, 280, eBlock);
player.FaceLocation(255, 100, eBlock);
Wait(20);
Display("You spot a book titled 'Chants of Experience', by William Flake. That looks like something Curtis would enjoy.");
Display("You take it with you.");
AddInventory(17);
GiveScore(6);
Thou10.Visible=false;
}
else Display("That provides no further insight.");
}
else if (player.activeinv==16) Display("That's not the way to return a book.");
else Display("You can't use that here.");
Using inventory item 1 on that hotspot returns the following message, regardless of whether the StrCaseComp is 0 or 1:
Quote
An internal error has occured. Please note down the following information.
If the problem persists, contact Chris Jones.
(ACI version 2.71.894NMP)
Error: run_text_script1: error -6 running function 'hotspot2_c':
Error: Null string referenced
in Room 66 script (line 50)
Line 50 of the room script is the following:
if (StrCaseComp("Curtis' favor", thought)==0) {
I don't understand why it doesn't work, as the exact same line works perfectly in other places.
Any help will be appreciated.