Posted by Bountywolf
Hey size could you take a look at this I'm confused as to why it isnt saving. I used most of the scripts you had in blocks edited all of them to remove sparse objects and add some other stuff.But thats bout it
if (global.tilegeneration = true){
if (y = 0 or x = 0 or x = 3168 or y = 3168){
if (y = room_height) {
global.tileGeneration = false;
global.server1 = 'Online';
Heres a simplified version of the world generater just took out the generator parts so you can see the saving parts.

Replies (8)

Last message on 10 Jan 2018

Bountywolf (Topicstarter) on 9 Jan 2018, 00:07:37
im sure the debug message comes up heres the code in world_save
show_debug_message("Starting save!")
gms_bdb_open(get_bdb_index_for_current_session(), true, on_save_world)
idk why it isnt saving
Size43 (Administrator) on 9 Jan 2018, 11:59:02
How about on_save_world, does that script get executed? Can you post the code in on_save_world?
Bountywolf (Topicstarter) on 9 Jan 2018, 22:44:40
var fid = argument0

gms_bdb_seek(fid, 0)

with obj_world_controller
var width = ds_grid_width(layer[0])
var height = ds_grid_height(layer[0])

// Version number. Increase when adding new features to the save data.
// Update on_read_world with an if data_version > ... that reads the new data.
var version = 2

// Header
gms_bdb_write(fid, bdb_u8, version)
gms_bdb_write(fid, bdb_u16, width)
gms_bdb_write(fid, bdb_u16, height)

for(var xpos = 0; xpos < width; xpos++)
for(var ypos = 0; ypos < height; ypos++)
var i = 0;
if version >= 2
while(i + 1 < LAYER_COUNT)
// One way to reduce save size is to bitback values.
// You can use this to pack two or more layers that only have blockIDs up to 16 into 1 u8/byte.
// This makes the savefile 50% smaller!
var packed = bitpack_2x4bits(ds_grid_
Bountywolf (Topicstarter) on 9 Jan 2018, 22:45:05
get(layer[i], xpos, ypos), ds_grid_get(layer[i + 1], xpos, ypos));
gms_bdb_write(fid, bdb_u8, packed)
i += 2

while(i < LAYER_COUNT)
// Using u8 (= 1 byte) for saving block types
// u8 is the smallest data type available
// Try to keep it as small as possible to allow for fast loading times!
gms_bdb_write(fid, bdb_u8, ds_grid_get(layer[i], xpos, ypos))


// Save the total size we used (in bytes) so we can draw it
world_size = gms_bdb_tell(fid)

show_debug_message("World saved!")
gms_show_message("World saved!")
As I said earlier I used the blocks example for a saving ystem
Size43 (Administrator) on 9 Jan 2018, 23:03:20
Might have fallen off while copying it here, but your code is missing a call to gms_bdb_close. Please double-check whether it's still in your original code.
Bountywolf (Topicstarter) on 10 Jan 2018, 01:01:58
I added it, but it still doesn't work care to takea look at the project?
Size43 (Administrator) on 10 Jan 2018, 16:53:24
Sure. Send it to
Size43 (Administrator) on 8 Jan 2018, 14:46:27
I don't see any issues with this code. Are you sure that world_save gets executed at all?