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.

DarkBASIC Discussion / apparently a bunch of nesting errors i don't know

Author
Message
Chief Voyager
23
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 9th Apr 2003 21:27
i can't get this to work. i've got the exit commands there to break me out of the loops. i've been trying to get this menu to work. anyone see what i've done wrong?

You're ate up like a soup sandwich.
Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 10th Apr 2003 02:52
This is probably an obvious point, but I've noticed you're using:

if escapekey() = 1 then gosub leave

Have you used Disable Escapekey at the start of your program? This will prevent the program from quiting prematurely, I don't know if this is your problem

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Chief Voyager
23
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 10th Apr 2003 03:00
yeah, i already have disable esc key. my problem is that i seem to have a nesting problem, but i'm not sure where it's at. i need the exit commands because this is a function for a menu.

You're ate up like a soup sandwich.
Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 10th Apr 2003 04:12 Edited at: 10th Apr 2003 04:15
OK, we've got that out of the way

First, the Load Image at the top is set at 1000 and the sprite is using image 800. I take it that is not correct.

Second, in the leave: subroutine, I noticed that when you press "n" the menu sprite would not re-appear so the user can select another option.

I'm also begining to suspect you may have confused Exit with Exitfunction in some places.

As I'm testing this in DBPro, Windowed mode doesn't work to well for me as you need to re-initailise the display in DBPro.

So after a little re-write (except the window mode), I hope this helps.



...or at least point you in the right direction

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Chief Voyager
23
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 10th Apr 2003 06:58
thanx, i'll give this a shot to see what happens.

You're ate up like a soup sandwich.
Chief Voyager
23
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 10th Apr 2003 07:03
well, i tried it. what i came up with was that when i hit the f1 key, i still couldn't see my menu. then, when i held the f1 key down for a little bit, then released it, the sprite showed up in the lower right hand part of the screen and the CLI came up saying that 'Bob doesn't exist' what on earth is Bob? how come it (the menu) won't pop up when i hit the f1 key? thanx for the help though. do you have another idea? i've been beating at this thing for about 2 days now.

You're ate up like a soup sandwich.
Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 10th Apr 2003 07:22
Hmmm, that's strange, it's working in DBPro (ignoring the windowed mode)

Ah! I wonder, if you are pressing f1 to access the menu and f1 also closes the menu, it could well be that holding the f1 key down for to long it will open and then close before you see it.

try this one:



Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Chief Voyager
23
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 10th Apr 2003 08:44
gave it a shot, still i can't SEE the menu. lol, this thing is going to drive me to the drink! i hit the f1 key, and i still can't see the menu, even when i hold it down and i move my arrow keys (my player movement for the game, which is in the MAIN loop), my player moves around on the screen still, just at a slower rate. which doesn't make sense to me, because if i'm in a function, shouldn't the main game loop relinquish control to the function when i'm supposed to be in it? and how come i still can't see it (the menu), are my bitmap or sprite codes all jacked up? just for the crazy hell of it, i'll post all of my source code (minus the menu,which is already here) to see if that will give you an indication of what i'm working with. thanx, easily confused. that would be a good name for me, considering what i'm trying to do! also, you'll notice that i have my loading sprites (at the beggining of the code, just below the disable esc key) commented out, if i leave those commands in, right before i should see my level (when the sprites delete), i get an error that says "not enough memory", so i restarted my computer to see if that would fix it, but i got the same error again. so i commented that routine out for now. do you have any idea what's causing it? the same exact code worked in another prog that i had.

You're ate up like a soup sandwich.
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Apr 2003 09:04
i posted a working example for you on another post u made on the same subject

Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 10th Apr 2003 09:54 Edited at: 10th Apr 2003 10:05
I this menu function doesn't work now, it's going to drive ME to drink

I've removed the gosubs in the function, in case there was some confliction going on we both couldn't see. I've place the code inside a series of clearly marked IF blocks.

Edit: Have changed the co-ords of the sprite and dropped the need for Paste Sprite.



...all there is to tell you now is, that this works OK in DBPro
(except the windowed mode)

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Chief Voyager
23
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 11th Apr 2003 00:16
HOLY CRAP! it worked! thanx SO much easily confused AND indi. both of you have been tremendous helps! i'm so damn excited, now it's time to go make a new problem with the program! thanx again!!!!!

You're ate up like a soup sandwich.

Login to post a reply

Server time is: 2026-06-12 03:35:51
Your offset time is: 2026-06-12 03:35:51