I have made a little test program with parts of my code to find where it fails:
// Project: pruebas
// Created: 2017-10-29
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "pruebas" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
aaahprotasnd=loadsoundogg("sonidos\aaah distorsion prota.ogg")
playsound(aaahprotasnd)
loadcontrols()
savecontrols()
loadcontrols()
img_carazombi=loadimage("zombi\cara2.png")
img_ladoscabezazombi=loadimage("zombi\lados cabeza.png")
img_topcabezazombi=loadimage("zombi\top cabeza.png")
img_pielzombi=loadimage("zombi\piel.png")
img_brazopielymangazombi=loadimage("zombi\brazo piel y manga.png")
img_lateralescuerpozombi=loadimage("zombi\laterales cuerpo.png")
img_partesuperiortorsozombi=loadimage("zombi\parte superior torso.png")
img_pielzapatoszombi=loadimage("zombi\piel zapatos.png")
img_telaamarillazombi=loadimage("zombi\tela amarilla.png")
img_telagriszombi=loadimage("zombi\tela gris.png")
img_torsozombi=loadimage("zombi\torso.png")
global zombieobj=1
LoadObjectWithChildren(zombieobj,"zombi\zombie.ms3d") //************when I insert this line then fails the other things work ************!!!!!!!!!!!!!!!!!!!!!!!!!!HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//skybox
SetSkyBoxVisible(1)
SetSkyBoxHorizonSize( 4, 0 )
setskyboxhorizoncolor(100,100,100)
SetSkyBoxSkyColor(100,100,100)
SetSkyBoxSunVisible(1)
setskyboxsuncolor(255,255,255)
SetSkyBoxSunSize(20, 100 )
SetSunActive(1)
SetSunColor(255,255,255)
SetSunDirection(0,0.3,-1)
//fog
SetFogMode(1)
setfogcolor(100,100,100)
SetFogRange(250, 350)
SetCameraRange( 1, 1, 400 )
do
print("version test 5")
Print( ScreenFPS() )
Sync()
loop
function savecontrols()
opentowrite(1,"controls.dat")
writeinteger(1,2)
writeinteger(1,2)
writeinteger(1,2)
writeinteger(1,2)
closefile(1)
endfunction
function loadcontrols()
if getfileexists("controls.dat")=1
opentoread(1,"controls.dat")
readinteger(1)
readinteger(1)
readinteger(1)
readinteger(1)
closefile(1)
else
endif
endfunction