ok I give up : how to use debug mode
Blitz3D Forums/Blitz3D Beginners Area/ok I give up : how to use debug mode
| ||
There is no documentation with blitz 3D on how to use the debugger that I can see. Is there a tutorial or something posted in the forums that can show someone new how to step through a program I can get the debugger up and I can step through a progam but if there is some code that is checking for a key depressesd I can not get the script to step into the code even though I hold the key it is looking for as I am stepping the program Thanks for any info in advance. |
| ||
you can write stop In your code which will stop the program, and then you can 'step through' one function or line at a time using the icons at the top of the debugger. That what you wanted? Just be aware that if you run not in debug mode and your 'stop' line is still in there it will stop your game with no way (that i know) to start it again. |
| ||
I thought a "Stop" was ignored if you run in release mode? |
| ||
not that i have seen. |
| ||
Thanks -- the stop does work and I can step through the program except in the code example before I can not step into the code that runs in one of the keydown sections even when I am holding down the key and steping the program. Graphics3D 800,600 SetBuffer BackBuffer() camera=CreateCamera() CameraViewport camera,0,0,800,600 light=CreateLight() rocket=LoadMesh( "rocket.3ds" ) PositionEntity rocket,0,0,7 While Not KeyHit(1) If KeyDown(200) Then MoveEntity rocket,0,0.05,0 EndIf If KeyDown(203) Then TurnEntity rocket,0,0,1.0 EndIf If KeyDown(205) Then TurnEntity rocket,0,0,-1.0 EndIf UpdateWorld RenderWorld Text 320,500,"Movement & Rotation" Flip Wend End |
| ||
Forum Codes (or just click on the link below above the reply box!) |
| ||
ok I figured it out I had to put a stop after each of the key down statemens as well. |
| ||
Not sure I fully understand what all the icons do -- I can see the green dot starts the program running again but so does the icon that points up and right is there any difference in there functions Also I can't see what function the icon that points down and to the right does other then stepping the program like the icon that points right does Thanks for any info |
| ||
When running in release mode the stop line does stop the program so for each of my stop lines I changed it to an if statment debug = 1 Graphics3D 800,600 SetBuffer BackBuffer() camera=CreateCamera() CameraViewport camera,0,0,800,600 light=CreateLight() rocket=LoadMesh( "rocket.3ds" ) PositionEntity rocket,0,0,7 While Not KeyHit(1) If KeyDown(200) Then If debug Then Stop MoveEntity rocket,0,0.05,0 EndIf ; toggle debug mode If KeyDown(32) Then debug = Abs(debug - 1) Delay 250 EndIf If KeyDown(203) Then If debug Then Stop TurnEntity rocket,0,0,1.0 EndIf If KeyDown(205) Then If debug Then Stop TurnEntity rocket,0,0,-1.0 EndIf UpdateWorld RenderWorld Text 320,500,"Movement & Rotation Debug Mode = " + debug Flip Wend End I set debug variable at the top of my program only once to either 1 or 0 |
| ||
The three icons are : Step forward - Process the next line of code, but do not enter a function/loop etc line by line. Processes the function/loop etc, but does not step through it : Step into - Process the next line and go line by line through each function/loop etc encountered :Step out - Jump out of what ever loop or function your in. Used if you've seen enough of whats happening and want to move on. My terminology might be wrong here, but that's what i roughly think they mean. |
| ||
That is basicaly what I was thinking ther were for as well... Thanks, |
| ||
if u havn't found it yet the debuglog command is useful, but sometimes its just easyter to print or text out to the screen. |