i want something to appear only at the only first gamestart

H

heanfry

Guest
yes my title says it. how can i let something be, but only at the first gamestart ever.

Thanks :)
 
N

Noba

Guest
I think undertale did something like this, where it used a text document to store variables with events in the game, that's how it knew what you did between each playthrough. Maybe you could do something like this? Not sure how you'd do it though-
 
F

FabioF

Guest
you need to set a flag in a external file, that will be read every time the game starts.

Code:
//create event of controller object
_file="startgame.dat";


if  not file_exists(_file){

file = file_text_open_write(working_directory+_file);
file_text_write_string(file,"");
file_text_close(file);

// do first start game things

} // i'm creating the flag which i use to check the first   
//start of the game
else{
// write here following game starts stuffs
}
Consider that this is the simplest offline way to check a first start game!
 

Dupletor

Member
Just to notice, FabioF, "else" in this situation is useless.
There isn't something you want done in later applications but not in first, when taking return and room_goto() in consideration.
 

RangerX

Member
An alternate solution could be to use the "gamestart" event. Its meant to execute stuff only one, at game start.
 
F

FabioF

Guest
Just to notice, FabioF, "else" in this situation is useless.
There isn't something you want done in later applications but not in first, when taking return and room_goto() in consideration.
yes, it could be generally useless, but it can be useful if you need to initializate different objects or events, or variables, after the start event. I don't know what are the coder plans about his game, so i added "else" for a matter of completeness.
 
Top