Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Olleh19 on Wed 07/10/2020 23:55:06

Title: (NOT SOLVED) Game Crashing when saving
Post by: Olleh19 on Wed 07/10/2020 23:55:06
It was by accident that i run into it. I'm guessing it has to do with my attempt at a titlescreen.
Am i missing something when i just make the Goptions.Visible=true ?

Using the Thumbleweed Template.


I'm guessing that is what makes it crash, i have tried to take away bits of the code's like tweens and such, but what's bothering me is that it crashes and blaims the repeatedly_execute: Error: Null string referenced

Edit: However it goes to repeatedly_execute in the optionsscript i believe, where it shows save synthax, that i am completely clueless about.


Edited:

The line that's hightlighted is  SaveGameSlot(customSaveData.saveSlotId, customSaveData.saveSlotString);

Code (ags) Select
/ Remember when the game was started
function game_start()
{
  TimeCount.GameStart();
#ifdef SCRIPT_API_v3507
  ScreenWidth = Screen.Width;
  ScreenHeight = Screen.Height;
#endif
#ifndef SCRIPT_API_v3507
  ScreenWidth = System.ScreenWidth;
  ScreenHeight = System.ScreenHeight;
#endif
}

// workaround to take a savegame screenshot without the gui
function repeatedly_execute()
{
  TimeCount.RepExec();
  if (customSaveData.save_scheduled) {
    SaveGameSlot(customSaveData.saveSlotId, customSaveData.saveSlotString);
    customSaveData.saveSlotId = 0;
    customSaveData.saveSlotString = "";       
    customSaveData.save_scheduled = false;
  }
}


#endif

#ifndef __VERB_GUI_MODULE__ //A dependency is missing
  #error Missing module 'OptionGui'
#endif



Title: Re: Game Crashing when saving
Post by: Crimson Wizard on Thu 08/10/2020 00:20:19
Quote from: Olleh19 on Wed 07/10/2020 23:55:06
I'm guessing that is what makes it crash, i have tried to take away bits of the code's like tweens and such, but what's bothering me is that it crashes and blaims the repeatedly_execute: Error: Null string referenced

Please post the script where it crashes, that is most important bit. When you're testing from editor, editor should be pointing you to the exact location where the error occured.
Title: Re: Game Crashing when saving
Post by: Olleh19 on Thu 08/10/2020 09:58:38
Quote from: Crimson Wizard on Thu 08/10/2020 00:20:19
Quote from: Olleh19 on Wed 07/10/2020 23:55:06
I'm guessing that is what makes it crash, i have tried to take away bits of the code's like tweens and such, but what's bothering me is that it crashes and blaims the repeatedly_execute: Error: Null string referenced

Please post the script where it crashes, that is most important bit. When you're testing from editor, editor should be pointing you to the exact location where the error occured.

Code (ags) Select
// Remember when the game was started
function game_start()
{
  TimeCount.GameStart();
#ifdef SCRIPT_API_v3507
  ScreenWidth = Screen.Width;
  ScreenHeight = Screen.Height;
#endif
#ifndef SCRIPT_API_v3507
  ScreenWidth = System.ScreenWidth;
  ScreenHeight = System.ScreenHeight;
#endif
}

// workaround to take a savegame screenshot without the gui
function repeatedly_execute()
{
  TimeCount.RepExec();
  if (customSaveData.save_scheduled) {
    SaveGameSlot(customSaveData.saveSlotId, customSaveData.saveSlotString);
    customSaveData.saveSlotId = 0;
    customSaveData.saveSlotString = "";       
    customSaveData.save_scheduled = false;
  }
}


The line that's hightlighted is  SaveGameSlot(customSaveData.saveSlotId, customSaveData.saveSlotString);