Jump to content


GreenhornGames

Member Since 19 May 2011
Offline Last Active May 17 2013 05:00 PM

Topics I've Started

Ini Check Not Working Properly

11 May 2013 - 07:38 PM

So I have this code for checking if ini file exists:

 

if file_exists(working_directory+"/savegame.ini")//check file exists or not
{
//open game
ini_open("savegame.ini");
global.battery = ini_read_real("variables","battery",0);
room=ini_read_real("variables","room",0);
ini_close();
}
else
message_background(bk_black)
message_size(-1,-1)
message_text_font(fnt_small,14,c_red,0)
show_message("No saved game found")//show msg

 

But even though the ini files exists, it still shows the message and then loads the game. What's wrong?


.Ini File Question

10 May 2013 - 02:37 PM

I'm currently testing my game loading system. The fact is, if there is no .ini file, the game creates one and sets the first room to room0. But before that room, there is a room that I use as an intro. So, is there a way to check if an .ini file exist, it loads the game, but if the file doesn't exist, it shows a message, something like "No saved game found" ?

 

This is the code for loading the game through .ini

 

ini_open("savegame.ini");
global.battery = ini_read_real("variables","battery",0);
room=ini_read_real("variables","room",0);
ini_close();

 


Very Laggy In Specific Rooms

10 May 2013 - 11:56 AM

After testing the game, I have encountered huge lag when entering a specific room. The room 800x600 but the fps very, very low and and the game is really slow. I don't know why. The game was fine in the beginning (some small lag throughout the game). In this room I have the player object who just collides with the floor, I have floor objects all around which don't collide to each other, and I have some objects that show a message. I don't know whats the problem.

 

The game uses about 116 megabytes or RAM throughout the game that ammount doesn't rise when in the laggy room.

 

Help please?

 

By the way, does step event matter for these? I have a step event that checks if S is pressed when player is near.


Savegame Not Working Properly

09 May 2013 - 02:00 PM

After saving the game using game maker's built in functions and trying to load the game, this error occured:

 

ERROR in
action number 1
of Draw Event
for object obj_control:

Trying to use non-existing surface.

 

I don't have a clue on what's wrong. Can someone explain?


How Does This Function Work?

09 May 2013 - 01:20 PM

I'm using this function when ESC is pressed so the player can either quit the game or load a game. But how exactly do I make the button do something when pressed?

 

show_message_ext("Game paused", "Load game", "Leave","")