Código [Seleccionar]
var a,b,c,d,e,f;
f=get_save_filename("Sokoban File|*.skb|Binary File|*.bin|All Files|*","")
if f!="" then
{
c=file_bin_open(f,1)
file_bin_rewrite(c)
file_bin_write_byte(c,global.blocktype)
for(a=0;a*32<15;a+=1){for(b=0;b*32<15;b+=1){
e=(instance_position(a*32,b*32,all))
if e!=-1 then
{
switch(e.object_index){
case obj_mkb:file_bin_write_byte(c,1);break;
case obj_mkbx:file_bin_write_byte(c,2);break;
case obj_mktg:file_bin_write_byte(c,3);break;
case obj_mkp:file_bin_write_byte(c,4);break;
}
}
else
{
file_bin_write_byte(c,0)
}
}}
file_bin_write_byte(c,string_length(global.sel) mod 256)
file_bin_write_byte(c,string_length(global.sel) div 256)
for(a=0;a<string_length(global.sel);a+=1)
{
file_bin_write_byte(c,ord(string_char_at(global.sel,a)))
}
file_bin_close(c)
}
Nosé lo que pasa, solo me genera un archivo de 4 bytes en ves de uno con más bytes. deberías ser algo alredero de 128 bytes el archivos, pero solo llega a los 4 bytes, ¿cual es el problema? :'(