I can't seem to keep my images and printed statements from flickering every time it syncs.
How do you get a nice consitant image or printed data while sync-ing every loop cycle?
here's what it should look like, just the start of a commands pannel at the bottom of the screen, it and the printed data flicker like mad, prob more times than my eye can see.---->
http://img.photobucket.com/albums/v459/JABO/sjot1flicker.jpg
heres my code-->
Rem Project: sea 2
Rem Created: 9/9/2006 5:43:38 PM
Rem ***** Main Source File *****
Set Display Mode 1024,768,32
set text font "book" : set text size 20
set text to bold : set text transparent
Load Image "water/waves.bmp", 1
Load Image "water/waves.dds", 2
Load Image "water/refract.bmp", 3
LOAD IMAGE "Images/spec.bmp", 4
LOAD IMAGE "Media/hull.tga",5
LOAD IMAGE "Media/d_gun.tga",6
LOAD IMAGE "Media/prop.tga",7
LOAD IMAGE "Media/20mmflak.tga",8
LOAD IMAGE "Images/spec.bmp", 9
LOAD IMAGE "Images/hud.bmp",10,1
REM SKY OBJECT
Load Object "sky/sky.x", 10
rem objectScale(10, 800)
SCALE OBJECT 10,100000*1000,100000,100000*1000
Set Object Light 10, 1
Set Object Fog 10, 1
Set Object Texture 10, 2, 0
Position Object 10, 0, -400, 0
rem terrain
load object "Media/channelter.x",11
position object 11,0,-1400,0
Set Object Light 11, 1
set object cull 11,0
Set Object Fog 11, 1
rem objects
LOAD OBJECT "Media/hull.X",1
POSITION OBJECT 1,0,10,0
Set Object Light 1, 1
Set Object Fog 1, 1
LOAD OBJECT "Media/dgun_base.X",2
make mesh from object 1, 2
add limb 1, 1, 1
offset limb 1, 1, 0, .47, 16.959662
link limb 1, 0, 1
TEXTURE LIMB 1, 1, 6
LOAD OBJECT "Media/dgun.X",3
make mesh from object 2, 3
add limb 1, 2, 2
offset limb 1,2,0,.74031, 0
link limb 1, 1, 2
TEXTURE LIMB 1, 2, 6
LOAD OBJECT "Media/prop.x",4
make mesh from object 3,4
add limb 1,3,3
offset limb 1,3, 2.19856,-10.307131,-83.868813
link limb 1,0,3
TEXTURE LIMB 1, 3, 7
add limb 1,4,3
offset limb 1,4,-2.47,-10.307131,-83.868813
link limb 1,0,4
TEXTURE LIMB 1, 4, 7
LOAD OBJECT "Media/rudder.x",5
make mesh from object 4,5
add limb 1,5,4
offset limb 1,5,-2,-9.5,-88.99
link limb 1,0,5
TEXTURE LIMB 1, 5, 5
add limb 1,6,4
offset limb 1,6,2,-9.5,-88.99
link limb 1,0,6
TEXTURE LIMB 1, 6, 5
LOAD OBJECT "Media/port_dplane.x",6
make mesh from object 5,6
add limb 1,7,5
offset limb 1,7, -6.4476135,-10.094486,69.78912
link limb 1,0,7
TEXTURE LIMB 1, 7, 5
LOAD OBJECT "Media/star_dplane.x",7
make mesh from object 6,7
add limb 1,8,6
offset limb 1,8, 6.8476135,-10.094486,69.78912
link limb 1,0,8
TEXTURE LIMB 1, 8, 5
LOAD OBJECT "Media/20mm_base.x",8
make mesh from object 7,8
add limb 1,9,7
offset limb 1,9,0,8,-9.128900
link limb 1,0,9
TEXTURE LIMB 1, 9, 8
LOAD OBJECT "Media/20mm_gun.x",9
make mesh from object 8,9
add limb 1,10,8
offset limb 1,10,0,9.307491,-9.128906
link limb 1,0,10
TEXTURE LIMB 1, 10, 8
DELETE OBJECT 2
DELETE OBJECT 3
DELETE OBJECT 4
DELETE OBJECT 5
DELETE OBJECT 6
DELETE OBJECT 7
DELETE OBJECT 8
DELETE OBJECT 9
Load Object "plain.x", 100, 2
rem objectScale(100, 1000)
SCALE OBJECT 100,1000*1000,1000*1000,1000*1000
xRotate Object 100, 90
Position Object 100, 0, 0, 0
Set Object Diffuse 100, Rgb(256,128,128)
Set Object Emissive 100, Rgb(128,128,128)
Set Object Specular 100, Rgb(128,128,128)
Set Object Ambience 100, Rgb(128,128,128)
Set Blend Mapping On 100, 1, 2, 3, 24
Set Blend Mapping On 100, 2, 1, 3, 4
Set Blend Mapping On 100, 3, 3, 3, 26
Set Blend Mapping On 100, 4, 2, 11, 24
Set Blend Mapping On 100, 5, 1, 11, 7
Scale Object Texture 100, 0, 25, 25
Scale Object Texture 100, 1, 500, 500
Set Object Light 100, 1
Ghost Object On 100, 4
rem Set Object Fog 100, 1
SET OBJECT CULL 100, 0
MAKE PARTICLES 1, 9, 100,1
MAKE PARTICLES 2,9, 100, 1
GHOST PARTICLES ON 1, 1
GHOST PARTICLES ON 1, 1
ROTATE PARTICLES 1,0,90,0
ROTATE PARTICLES 2,0,90,0
SET PARTICLE LIFE 1, 100
SET PARTICLE LIFE 2, 100
SET PARTICLE SPEED 1, .01
SET PARTICLE SPEED 2, .01
SET PARTICLE GRAVITY 1, 2
SET PARTICLE GRAVITY 2, 2
MAKE CAMERA 1000
SET CAMERA RANGE 1000, .1, 5000000000
SET CAMERA FOV 1000, 50
POSITION CAMERA 0,50,0
forw=0
surface=1
spd#=0
leftrudder=0
rightrudder=0
waveup=1
balli#=.01
balld#=.01
DO
if loadcyle#<1 then GOSUB _hudload
loadcycle#=1
camx#=CAMERA POSITION X (1000)
camy#=CAMERA POSITION y (1000)
camz#=CAMERA POSITION z (1000)
hpx#=OBJECT POSITION X(1)
hpy#=OBJECT POSITION Y(1)
hpz#=OBJECT POSITION Z(1)
hullangy#=object angle y (1)
rudder1#=limb angle y (1,5)
rudder2#=limb angle y (1,6)
rudder3#=limb angle y (1,5)
rudder4#=limb angle y (1,6)
propx1#=LIMB POSITION X(1, 3)
propy1#=LIMB POSITION Y(1, 3)
propz1#=LIMB POSITION Z(1, 3)
propx2#=LIMB POSITION X(1, 4)
propy2#=LIMB POSITION Y(1, 4)
propz2#=LIMB POSITION Z(1, 4)
spy#=object position y (100)
spy2#=object position y (100)
spy#=spy#*10
spy2#=spy2#*10
if LEFTKEY()>0 then gosub _leftrudder
if RIGHTKEY()>0 then gosub _rightrudder
if INKEY$()="0" then forw=0
if INKEY$()="1" then forw=1
if INKEY$()="2" then forw=2
if INKEY$()="3" then forw=3
if INKEY$()="4" then forw=4
if INKEY$()="5" then forw=5
if INKEY$()="a" then ballinc=1
if INKEY$()="d" then ballinc=2
if INKEY$()="s" then neutralball=1
if ballinc=1 and surface=0 then GOSUB _ballinc
if ballinc=2 and surface=0 then GOSUB _balldec
if surface=1 and ballinc=1 then surface=0
if neutralball=1 and surface=0 then GOSUB _neutralball
if forw=0 then GOSUB _allstop
if forw=1 then GOSUB _ahead14
if forw=2 then GOSUB _ahead12
if forw=3 then GOSUB _ahead34
if forw=4 then GOSUB _aheadfull
if forw=5 then GOSUB _aheadflank
if camy#<spy# then gosub _underwater
if camy#>spy# then gosub _abovewater
if rudder3#<0 then rightrudder=1 else rightrudder=0
if rudder1#>0 then leftrudder=1 else leftrudder=0
if leftrudder>0 then gosub _leftturn
if rightrudder>0 then gosub _rightturn
if waveup=1 then GOSUB _waveup
if waveup=0 then GOSUB _wavedown
if ballinc=2 and hpy#>spy# then GOSUB _resurface
POSITION CAMERA 1000,hpx#+2,hpy#+9,hpz#+2
POINT CAMERA 1000, hpx#,hpy#,hpz#
SET CAMERA TO OBJECT ORIENTATION 1000, 1
rem keep skybox over the ship
POSITION OBJECT 10,CAMERA POSITION X(1000),CAMERA POSITION Y(1000),CAMERA POSITION Z(1000)
REM MAKE CLOCKWISE ANGULAR WAKES(optionally just make them stra?ght for a better look)
ang# = WrapValue(ang# + 0.1)
Scroll Object Texture 100, 0, -Sin(ang#)*0.0001, Cos(ang#)*0.0001
Scroll Object Texture 100, 1, 0.0001, 0.0
set cursor 20,675
print "speed->":set cursor 100,675:print spd#
set cursor 20,690
print "POS X->":set cursor 100,690:print camx#
set cursor 20,705
print "POS Y->":set cursor 100,705:print hpy#
set cursor 20,720
print "POS Z->":set cursor 100,720:print camz#
sync
LOOP
_hudload:
PASTE IMAGE 10,0,650
RETURN
_waveup:
if spy#<8 then move object 100,-.01
if spy#>8 then waveup=0
RETURN
_wavedown:
if spy2#>-8 then move object 100,.01
if spy2#<-8 then waveup=1
RETURN
_leftturn:
if spd#>0 then hullangy#=hullangy#-.02
if spd#>.05 then hullangy#=hullangy#-.04
if spd#>.09 then hullangy#=hullangy#-.09
YROTATE OBJECT 1, hullangy#
RETURN
_rightturn:
if spd#>0 then hullangy#=hullangy#+.02
if spd#>.05 then hullangy#=hullangy#+.04
if spd#>.09 then hullangy#=hullangy#+.09
YROTATE OBJECT 1, hullangy#
RETURN
_leftrudder:
if rudder1#<15 then rudder1#=rudder1#+3
if rudder2#<15 then rudder2#=rudder2#+3
ROTATE LIMB 1,5,0,rudder1#,0
ROTATE LIMB 1,6,0,rudder2#,0
RETURN
_rightrudder:
if rudder3#>-15 then rudder3#=rudder3#-3
if rudder4#>-15 then rudder4#=rudder4#-3
ROTATE LIMB 1,5,0,rudder3#,0
ROTATE LIMB 1,6,0,rudder4#,0
RETURN
_allstop:
if spd#>0 then spd#=spd#-.0002
move object 1, spd#
HIDE PARTICLES 1
HIDE PARTICLES 2
RETURN
_ahead14:
set cursor 50,50
print "ahead 1/4"
if spd#<.4 then spd#=spd#+.0005
if spd#>.4 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+50
prop2=prop2-50
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
SET PARTICLE EMISSIONS 1, 1
SET PARTICLE EMISSIONS 2, 1
POSITION PARTICLES 1,propx1#,propy1#,propz1#-1
POSITION PARTICLES 2,propx2#,propy2#,propz2#-1
RETURN
_ahead12:
set cursor 50,50
print "ahead 1/2"
if spd#<.425 then spd#=spd#+.001
if spd#>.425 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+60
prop2=prop2-60
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
SET PARTICLE EMISSIONS 1, 5
SET PARTICLE EMISSIONS 2, 5
POSITION PARTICLES 1,propx1#,propy1#,propz1#-1
POSITION PARTICLES 2,propx2#,propy2#,propz2#-1
RETURN
_ahead34:
set cursor 50,50
print "ahead 1/4"
if spd#<.475 then spd#=spd#+.002
if spd#>.475 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+70
prop2=prop2-70
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
SET PARTICLE EMISSIONS 1, 8
SET PARTICLE EMISSIONS 2, 8
POSITION PARTICLES 1,propx1#,propy1#,propz1#-1
POSITION PARTICLES 2,propx2#,propy2#,propz2#-1
RETURN
_aheadfull:
set cursor 50,50
print "ahead full"
if spd#<.525 then spd#=spd#+.003
if spd#>.525 then spd#=spd#-.0002
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+75
prop2=prop2-75
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
SET PARTICLE EMISSIONS 1, 10
SET PARTICLE EMISSIONS 2, 10
POSITION PARTICLES 1,propx1#,propy1#,propz1#-1
POSITION PARTICLES 2,propx2#,propy2#,propz2#-1
RETURN
_aheadflank:
set cursor 50,50
print "ahead flank"
if spd#<.550 then spd#=spd#+.005
if spd#>.550 then spd#=.550
MOVE OBJECT 1, spd#
prop1=LIMB ANGLE Z(1, 3)
prop2=LIMB ANGLE Z(1, 4)
prop1=prop1+80
prop2=prop2-80
ROTATE LIMB 1, 3, 0, 0, prop1
ROTATE LIMB 1, 4, 0, 0, prop2
SHOW PARTICLES 1
SHOW PARTICLES 2
SET PARTICLE EMISSIONS 1, 15
SET PARTICLE EMISSIONS 2, 15
POSITION PARTICLES 1,propx1#,propy1#,propz1#-1
POSITION PARTICLES 2,propx2#,propy2#,propz2#-1
RETURN
_ballinc:
balli#=balli#+.02
if balli#>.1 then balli#=balli#+.015
MOVE OBJECT DOWN 1,balli#
pitch object down 1, balld/2
set cursor 955,70:print balli#
RETURN
_balldec:
balld#=balld#+.01
if balld#<.1 then balld#=balld#+.025
MOVE OBJECT up 1,balld#
pitch object up 1, balld/2
set cursor 900,50:print balld#
RETURN
_neutralball:
ballinc=0
balldec=0
neutralball=0
RETURN
_resurface:
set cursor 900,70:print "resurface"
hpy#=-15
ballinc=0
balldec=0
surface=1
RETURN
_underwater:
rem FOG ON
rem FOG COLOR 256, 256, 256
rem FOG DISTANCE 10000
SET AMBIENT LIGHT 1
RETURN
_abovewater:
rem fog off
rem FOG COLOR 128, 128, 128
rem FOG DISTANCE 10000
SET AMBIENT LIGHT 200
RETURN
function Distance(Object1,Object2)
dist#=sqrt((object position x(Object1)-object position x(Object2))^2+(object position y(Object1)-object position y(Object2))^2+(object position z(Object1)-object position z(Object2))^2)
endfunction dist#
function AngleY(Object1,Object2)
angy#=atanfull(object position x(Object2)-object position x(Object1),object position z(Object2)-object position z(Object1))
endfunction angy#
I'll getting close to a uber rough beta release if I can just get past these little things that arise,
I was thinking of posting it at the WIP board the even with the way it is now it's at now, the only functions not coded are the dive planes, (but I have coded balist control for diving) and the weapons, I've also created the largest world ever, the northeast coast of Frace to southern Enland, and West out into the eastern Atlantic, at almost full scale, I couldn't believe it! but we'll see what happens to the FPS when there are other ships, and strutures,
Having trouble with my fog making thinks go all black or disappear all together, but another issue another day
anyway, went off track there, if anyone could help me with the flicker I'd been very greatful,
JABBERWOCKY