my computer is being weird
it will compile in debug mode and run, but otherwise "undefined parser error" no error line or anything. and i don't think i changed anything unless i added a letter somewhere on accident but why would it compile with f6 and not f5?
the only code that could have been changed (the main code) is first 74 lines if anybody has coffee and time lol
REM Project Blood And Iron
REM Chris Contreras
REM Typ
REM Set
sync on
sync rate 60
set camera range 1.0, 10000000.0
autocam off
set display mode 1024, 768, 32
REM Var
global oldmc
global mc
global o_sea
REM Ini
REM Test
make_matrix_from_heightmap("Europe 1910\map\heightmap.png", -0.05, 2.5)
REM Game
do
handle_test()
handle_camera()
sync
loop
REM Func
function make_matrix_from_heightmap(name$, scale#, scale_b#)
local col as dword
img = free_img()
load image "scenarios\" + name$, img
xtil = image width(img)-1
ytil = image height(img)-1
make matrix 1, xtil * scale_b#, ytil * scale_b#, xtil, ytil
img_tex = free_img()
load image "scenarios\Europe 1910\map\terrain.png", img_tex
prepare matrix texture 1, img_tex, 2, 2
fill matrix 1, 0.0, 1
paste image img, 0, 0
for x = 0 to xtil-1
for y = 0 to ytil-1
col = point(x, y)
r = rgbr(col)
if r = 0 then r = -10
set matrix height 1, x, y, r * scale#
` add mountainous areas
if r * scale# > -4.0 and x < xtil and y < ytil then set matrix tile 1, x, y, 3
` add desert areas
if (x > 55 and x < 190 and y > 255) or (x > 189 and y > 260) or (x > 310 and y > 240)
set matrix tile 1, x, y, 2
if r * scale# > -4.0 and x < xtil and y < ytil then set matrix tile 1, x, y, 4
endif
next y
next x
update matrix 1
i_sea = free_img()
o_sea = free_obj()
load image "scenarios\Europe 1910\map\sea.png", i_sea
make object plain o_sea, xtil * scale_b#, ytil * scale_b#
xrotate object o_sea, 90.0
position object o_sea, xtil * scale_b# - (xtil * scale_b# * 0.5), -7.5, ytil * scale_b# - (ytil * scale_b# * 0.5)
texture object o_sea, i_sea
endfunction
function handle_test()
set cursor 0,0
print screen fps()
print camera position x()
print camera position y()
print camera position z()
if keystate(2) then point camera 0,0,0
print object position y(o_sea)
if keystate(19) then position object o_sea, object position x(o_sea), object position y(o_sea) + 0.1, object position z(o_sea)
if keystate(33) then position object o_sea, object position x(o_sea), object position y(o_sea) - 0.1, object position z(o_sea)
endfunction
function handle_camera()
local mmy as float
local mmx as float
local spd as float
REM Var
spd = 0.1
oldmc = mc
mc = mouseclick()
mmy = mousemovey() / 5.0
mmx = mousemovex() / 5.0
REM Look
if mc = 2 and oldmc = 2
`hide moues while looking around
hide mouse
position mouse 512, 384
`turn camera
xrotate camera wrapvalue(camera angle x() + mmy)
yrotate camera wrapvalue(camera angle y() + mmx)
`bound camera angle
if camera angle x()>89 and camera angle x()<180 then xrotate camera 89
if camera angle x()<271 and camera angle x()>180 then xrotate camera 271
else
show mouse
endif
REM Move
if keystate(42)
spd = spd * 50.0
endif
if keystate(17)
move camera spd
endif
if keystate(31)
move camera -spd
endif
if keystate(30)
position camera newxvalue(camera position x(), camera angle y()-90.0, spd), camera position y(), newzvalue(camera position z(), camera angle y()-90.0, spd)
endif
if keystate(32)
position camera newxvalue(camera position x(), camera angle y()+90.0, spd), camera position y(), newzvalue(camera position z(), camera angle y()+90.0, spd)
endif
if keystate(16)
position camera camera position x(), camera position y() - spd, camera position z()
endif
if keystate(18)
position camera camera position x(), camera position y() + spd, camera position z()
endif
endfunction
function free_obj()
repeat
inc i
if object exist(i)=0 then found=1
until found
endfunction i
function free_img()
repeat
inc i
if image exist(i)=0 then found=1
until found
endfunction i