• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [FIXED] DS Grid Levels

cdgamedev

Member
I just finished creating my level editor and want to know if there is any way that I could add the levels to my actual game, possibly using Included Files? I have tried but couldn't reference the files. They work by saving the contents of a DS grid

Any ideas?

Thanks,
Callum​
 
B

barshems

Guest
you tried but couldn't reference the files? does that mean you saved them with the ini_write function but when you tried to ini_read they wouldn't read?
 

cdgamedev

Member
you tried but couldn't reference the files? does that mean you saved them with the ini_write function but when you tried to ini_read they wouldn't read?
No, sorry, I should've been more clear haha. I tried to add them as Included Files but I couldn't reference them
 
B

barshems

Guest
oh sorry I don't now much about that area yet I'm still stuck on something myself
 
W

whale_cancer

Guest
Please post code. There is no reason that including the outputted file and reading it with either the ini* functions or the text file options wouldn't work.

*Unless the converted string is too big, in which case ini files fail. I think saving ds_strings to ini files is never a good idea, personally.
 

cdgamedev

Member
The functions work.... What I want to do is add the file to my actual game. This is the level editor, the problem is, that as an included file, it doesn't become highlighted in my code - in my actual game
 

cdgamedev

Member
As in, in the code editor? GM doesn't highlight included files the way it does sprites, sounds, etc.,
Yeah, and it doesn't want to open the included file either... Its basically an ini file... It gives me this error:
FATAL ERROR in
action number 1
of Create Event
for object obj_world:

Variable obj_world.World0(100007, -2147483648) not set before reading it.
at gml_Object_obj_world_CreateEvent_1 (line 8) - ini_open(World0);

Its basically saying that the error is because its a variable when what I really want to do is call the included file to be opened
 
Last edited:
W

whale_cancer

Guest
Yeah, and it doesn't want to open the included file either... Its basically an ini file... It gives me this error:
FATAL ERROR in
action number 1
of Create Event
for object obj_world:

Variable obj_world.World0(100007, -2147483648) not set before reading it.
at gml_Object_obj_world_CreateEvent_1 (line 8) - ini_open(World0);
It's always better if you post your code... Even if you don't think it will help.

What is the name of your included file? Is 'World0' a variable you have used to reference the included file, or is that the name of the file? If it is the name of the file, well, filenames are strings. You need to reference it as a string (i.e. with quotation marks around it).

Edit: Also, included files can be weird sometimes. Try clearing the cache and restarting GM if my above suggestion isn't relevant.
 
Last edited:

cdgamedev

Member
The thing is, its an INCLUDED FILE, its doesn't exist in the working_directory... What I want to know is how I either, open it as an included file OR extract it to the working_directory, my code is irrelevant to what I want to do

EDIT: Clearing the cache and restarting GM didn't do anything
 
Top