Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///load_zom()
- //Creates zombies according to what was saved and applies their saved information. Takes data from the ini file.
- with (zom){
- instance_destroy()
- }
- //Convert the grid to a string and save it to an ini file.
- var load_zom_grid;
- load_zom_grid = ds_grid_create(1,1);
- ini_open("zombie_savedata.ini");
- var t_string;
- t_string = ini_read_string("Savedata", "ZombieGrid", "");
- if t_string != "" {ds_grid_read(load_zom_grid, t_string);
- ini_close();}
- else{
- ini_close();
- show_message("no zombie save file")
- exit
- }
- //Create enough zombies and set their data to that which was loaded from the ini file.
- var gridheight, loadedzom, loadzom;
- gridheight=ds_grid_height(load_zom_grid)
- loadedzom=1
- while loadedzom<=gridheight{
- loadzom=instance_create(0,0,zom)
- with (loadzom){
- x=ds_grid_get(load_zom_grid,0,loadedzom)
- if x=0 show_message("returned x=0!")
- y=ds_grid_get(load_zom_grid,1,loadedzom)
- if y=0 show_message("returned y=0!")
- hp=ds_grid_get(load_zom_grid,2,loadedzom)
- if hp=0 show_message("returned hp=0!")
- targeting=ds_grid_get(load_zom_grid,3,loadedzom)
- target=ds_grid_get(load_zom_grid,4,loadedzom)
- loaded=1
- }
- loadedzom+=1
- }
- ds_grid_destroy(load_zom_grid)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement