yes, this is the code, i am TRYing to put it all into functions, wich i can call later in the level editor
+ Code Snippet// aftermath engine env_objects and env_effects functions
**********TEMP**********TEMP**********TEMP**********TEMP**********TEMP
` **********TEMP**********TEMP**********TEMP**********TEMP**********TEMP
load image "gfx\env_+fire.bmp",1
paste image 1,0,0
fire_num = 2
firstframe = fire_num
for y = 0 to 128 step 128
for x = 0 to 425 step 85
get image fire_num, x, y, x + 85, y + 128, 1
inc fire_num
lastframe = fire_num
next x
next y
fire_num = firstframe
sync on : sync rate 60 :autocam off
load image "gfx\env_dirt.bmp",20
make object box 11,16,32,16
texture object 11,20
position camera 0,40,-20
env_rag(3,1,100,0,0,180,0)
env_fire(2,16,256,0,32,80)
env_rag(1,1,100,0,0,10,0)
`env_light(3,512,0,0,255,0,0,-50)
env_3d_sound(1,"sound\env_wind1.wav",1,100,0,0,0)
make object plain 20,1024,1024
xrotate object 20,90
position object 20,0,-4,0
texture object 20,20
scale object texture 20,20,20
color backdrop 0
set ambient light 10
set camera fov 80
do
camposx#= camera position x()
camposy#= camera position y()
camposz#= camera position z()
camroty#= camera angle y()
if inkey$()="w" then move object 11,1
if inkey$()="s" then move object 11,-1
CONTROL CAMERA USING ARROWKEYS 0,1,1
position listener camposx#,camposy#,camposz#
rotate listener 0,camroty#,0
point object 2,camera position x(), 0, camera position z()
xrotate object 2,0
zrotate object 2,0
gosub init_fire
sync
loop
` **********TEMP**********TEMP**********TEMP**********TEMP**********TEMP
` **********TEMP**********TEMP**********TEMP**********TEMP**********TEMP
function env_fire(fire_onum,fire_size,fire_range,fire_x,fire_y,fire_z)
make object plain fire_onum,fire_size,fire_size*2
yrotate object fire_onum,180
position object fire_onum,fire_x,fire_y,fire_z
set object ambient fire_onum,0
ghost object on fire_onum,0
` scale object texture fire_onum,0.18,0.5
make light fire_onum
color light fire_onum,232,167,55
position light fire_onum,fire_x,fire_y,fire_z
set light range fire_onum,fire_range
endfunction
function env_fire_init()
load image "gfx\env_+fire.bmp",1
paste image 1,0,0
fire_num = 2
firstframe = fire_num
for y = 0 to 128 step 128
for x = 0 to 425 step 85
get image fire_num, x, y, x + 85, y + 128, 1
inc fire_num
lastframe = fire_num
next x
next y
fire_num = firstframe
endfunction
function env_rag(rag_num,rag_anim,rag_size,rag_x,rag_y,rag_z,rag_yrot)
load object "progs\env_rag.md2",rag_num
set image colorkey 0,0,0
set object transparency rag_num,4
if rag_anim=0
set object frame rag_num,0
else
loop object rag_num,1,5
endif
set object speed rag_num,1
set object smoothing rag_num,60
position object rag_num,rag_x,rag_y,rag_z
scale object rag_num,rag_size,rag_size,rag_size
yrotate object rag_num,rag_yrot
endfunction
function env_light(light_num,light_range,light_r,light_g,light_b,light_x,light_y,light_z)
make light light_num
set light range light_num,light_range
color light light_num,light_r,light_g,light_b
position light light_num,light_x,light_y,light_z
endfunction
function env_3d_sound(sound_num,sound_path$,sound_playing,sound_vol,sound_x,sound_y,sound_z)
load 3dsound sound_path$,sound_num
set sound volume sound_num,sound_vol
if sound_playing=1
loop sound sound_num
else
stop sound sound_num
endif
endfunction
function env_global_sound(gsound_num,gsound_path$,gsound_playing,gsound_vol)
load sound gsound_path$,gsound_num
set sound volume gsound_num,gsound_vol
if gsound_playing=1
loop sound gsound_num
else
stop sound gsound_num
endif
endfunction
init_fire:
if timer()-lasttick#>80.0
lasttick# = timer()
texture object 2,fire_num
inc fire_num
endif
if fire_num > lastframe-1
fire_num = firstframe
endif
return