Load Order Wrong
Archives Forums/Blitz3D Bug Reports/Load Order Wrong
| ||
Hi all, When I Run my game, the game loop start before load all media files into game, when this happen, the screen continue black and I can hear the sounds of the game running. Why this Happenning? Example of the code: Graphics3D 1024,768,32,1 HidePointer Const terr=1,pers=2 SeedRnd (MilliSecs()) Global Narra,passos Narra=LoadSound("sons\pessoas\N\narrafeira1.wav") passos=LoadSound("sons\pessoas\N\cav_7.wav") : SoundPitch passos,10000 Global ps ;Codigo para FPS Const FPS=30 Global period=1000/FPS Global time=MilliSecs()-period Global tempo=10000 terreno=LoadMesh("cenarios\feira\fi\fi.b3d") EntityType terreno,terr Global perso=LoadAnimMesh("soldado1\i\im\iniverml.b3d") Global texture=LoadTexture("soldado1\i\im\soldbranco.png") EntityTexture perso,texture ScaleEntity perso,.08,.08,.08 PositionEntity perso,10000,10000,10 Type Persons Field anda,corre Field mesh,cubo End Type For x=1 To 70 ami.persons = New persons ami\mesh=CopyEntity (perso) ami\anda=ExtractAnimSeq(ami\mesh,5,45) PositionEntity ami\mesh,Rnd(-20,5),0.01,Rnd(21,12) RotateEntity ami\mesh,0,180,0 Animate ami\mesh,1,1,ami\anda sombra=LoadSprite("imagens\ef\shadow.bmp",2,ami\mesh) EntityBlend sombra,2 ScaleSprite sombra,3,3 RotateEntity sombra,90,0,0 SpriteViewMode sombra,2 Next ami.persons=New persons ami\mesh=LoadAnimMesh("soldado1\k\k8a.b3d") ami\anda=ExtractAnimSeq(ami\mesh,1600,1640) PositionEntity ami\mesh,-5,0.01,9 ScaleEntity ami\mesh,.08,.08,.08 RotateEntity ami\mesh,0,180,0 Animate ami\mesh,1,1,ami\anda sombra=LoadSprite("imagens\ef\shadow.bmp",2,ami\mesh) EntityBlend sombra,2 ScaleSprite sombra,3,3 RotateEntity sombra,90,0,0 SpriteViewMode sombra,2 For x=1 To 5 ami.persons=New persons ami\mesh=LoadAnimMesh("soldado1\i\im\MBCav.b3d") ami\anda=ExtractAnimSeq(ami\mesh,60,100) PositionEntity ami\mesh,Rnd(-20,5),0.01,Rnd(12,10);Rnd(21,10) ScaleEntity ami\mesh,.08,.08,.08 RotateEntity ami\mesh,0,180,0 Animate ami\mesh,1,.7,ami\anda sombra=LoadSprite("imagens\ef\shadow.bmp",2,ami\mesh) EntityBlend sombra,2 ScaleSprite sombra,6,6 RotateEntity sombra,90,0,0 SpriteViewMode sombra,2 Next For x=1 To 5 ami.persons=New persons ami\mesh=LoadAnimMesh("soldado1\i\im\MCCav.b3d") ami\anda=ExtractAnimSeq(ami\mesh,60,100) PositionEntity ami\mesh,Rnd(-20,5),0.01,Rnd(12,10) ScaleEntity ami\mesh,.08,.08,.08 RotateEntity ami\mesh,0,180,0 Animate ami\mesh,1,.7,ami\anda sombra=LoadSprite("imagens\ef\shadow.bmp",2,ami\mesh) EntityBlend sombra,2 ScaleSprite sombra,6,6 RotateEntity sombra,90,0,0 SpriteViewMode sombra,2 Next Include "sky.bb" mesh_skybox = MakeSkyBox("imagens\ef\sk\sky") Global camera=CreateCamera() EntityType camera,pers PositionEntity camera,-13,1,7 RotateEntity camera,0,270,0 AmbientLight 200,200,200 Collisions pers,terr,2,3 While Not KeyDown(1) Repeat elapsed=MilliSecs()-time Until elapsed ticks=elapsed/period tween#=Float(elapsed Mod period)/Float(period) For k=1 To ticks time=time+period If k=ticks Then CaptureWorld ;FPS If Timer + 1000 <= MilliSecs() Timer = MilliSecs() FPSReal = FPSTemp FPSTemp = 0 EndIf FPSTemp = FPSTemp + 1 controlacamera() UpdateWorld Next RenderWorld tween# Flip Wend End |
| ||
Might have misunderstood something but what sounds are you hearing? I can only think it's the .wavs but there's no playsound. |
| ||
Are in the inside of the function "controlacamera()" called inside of the game loop. |
| ||
No One of Blitz Team Can Ask Me? |
| ||
Do you ever get to your Renderworld? What happens if you add debug/print statements to your code (e.g. within each for/next and if/endif in your mainloop and before renderworld. |