Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Glitching I encountered.

Author
Message
Fallout3fan
14
Years of Service
User Offline
Joined: 9th May 2009
Location:
Posted: 29th May 2012 03:50 Edited at: 29th May 2012 03:51
Okay I typed in this code.


And the program froze. Is there some way I can still have the same code without it glitching?

If you do help. I will add you to the credits in my game.

_!!!!_
,0~U -Well I do say, its been quite a fancy forum for
__-____TheZachadoodle.________________________________
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th May 2012 03:56
Quote: "If you do help. I will add you to the credits in my game. "


Worst line possible.

If memory serves, Darkbasic does some internal work when sync is closed, so you need to call sync.

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 29th May 2012 04:02
Wait should he just say 'sync'?

[/href]
Fallout3fan
14
Years of Service
User Offline
Joined: 9th May 2009
Location:
Posted: 29th May 2012 04:02 Edited at: 29th May 2012 04:05
Do you mean this?


Have you even pulled out your program? I still have the same problem.

It's Dark Basic Professional by the way.

_!!!!_
,0~U -Well I do say, its been quite a fancy forum for
__-____TheZachadoodle.________________________________
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th May 2012 04:05
Quote: "Have you even pulled out your program? I"

Sorry?

Okay, I guess I'll expand a little more.



I'm not sure if that will help at all. It's probably worth telling you that you've calculated the value of computer AFTER you've printed it.

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 29th May 2012 04:12 Edited at: 29th May 2012 04:13
Nah, I made the program for him as a demo (Im teaching him to program) and the purpose of the program is to save the player's state even during the computer's turn and vice versa... So it shows the current state and then generates a new state to demonstrate the state holding capability of the program.

[/href]
Fallout3fan
14
Years of Service
User Offline
Joined: 9th May 2009
Location:
Posted: 29th May 2012 04:13 Edited at: 29th May 2012 04:17
Still doesn't help the same glitch occurs when it freezes.


I tried that a little bit. I really don't know what I'm doing. I don't know it's like Dark Basic Pro is fine with the program existing but it just doesn't want to smoothly leave. It has to freeze.

Try getting out Dark Basic Pro out. You'll see what I mean when it comes to the program.

_!!!!_
,0~U -Well I do say, its been quite a fancy forum for
__-____TheZachadoodle.________________________________
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th May 2012 04:17
Ah, so the program only freezes upon exit?

Okay, for starters you want to remove those sync off commands, and take the sync on command out of the loop.

Fallout3fan
14
Years of Service
User Offline
Joined: 9th May 2009
Location:
Posted: 29th May 2012 04:18 Edited at: 29th May 2012 04:20
Quote: "Ah, so the program only freezes upon exit? "

Yes it does. I don't want the player to get screwed over when it comes to exiting the game. It has to be a smooth exit and entry.

_!!!!_
,0~U -Well I do say, its been quite a fancy forum for
__-____TheZachadoodle.________________________________
Randomness 128
17
Years of Service
User Offline
Joined: 13th Feb 2007
Location:
Posted: 29th May 2012 04:40
You're using gosub incorrectly. When you use gosub, the current address is added to the end of the stack before jumping. When the subroutine ends, the last address on the stack is used to return. This way, subroutines can call as many other subroutines as they want and return in the correct order. You've used gosub a lot without returning, which really messes up the stack. Try this instead:

Fallout3fan
14
Years of Service
User Offline
Joined: 9th May 2009
Location:
Posted: 29th May 2012 04:42
Anyone here?

_!!!!_
,0~U -Well I do say, its been quite a fancy forum for
__-____TheZachadoodle.________________________________
Fallout3fan
14
Years of Service
User Offline
Joined: 9th May 2009
Location:
Posted: 29th May 2012 04:48
Quote: "You're using gosub incorrectly. When you use gosub, the current address is added to the end of the stack before jumping. When the subroutine ends, the last address on the stack is used to return. This way, subroutines can call as many other subroutines as they want and return in the correct order. You've used gosub a lot without returning, which really messes up the stack."

PERFECT! Thank you Randomness.

_!!!!_
,0~U -Well I do say, its been quite a fancy forum for
__-____TheZachadoodle.________________________________
Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 29th May 2012 04:50
Yay, that was my fault! I thought about putting return in there but decided it would make things too complex. Buuuut evidently I didn't think it through properly.

[/href]
Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th May 2012 04:59
Nice one randomness, I can't believe I missed that one.

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 29th May 2012 06:23
And this is why functions are handy!

[/href]

Login to post a reply

Server time is: 2024-04-27 09:31:01
Your offset time is: 2024-04-27 09:31:01