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 / Having problems with the Huge Dungeons Tutorial

Author
Message
Asmodeus
14
Years of Service
User Offline
Joined: 27th Aug 2010
Location:
Posted: 9th Feb 2011 14:23
Hi there

I'm very new to Darkbasic and have been following the tutorials and have run into a little problem with the Huge Dungeons tutorial.

I've followed the tutorial and when trying to run the program I get a "You have hit a FUNCTION DECLARATION mid program!"

Is this tutorial correct or am I just being more than a little dense?

Thanks
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Feb 2011 16:42 Edited at: 9th Feb 2011 16:43
This normally happens if you don't have either "end" or some kind of game loop before you start declaring functions.

eg GOOD CODE:


eg GOOD CODE:


eg BAD CODE:


Asmodeus
14
Years of Service
User Offline
Joined: 27th Aug 2010
Location:
Posted: 9th Feb 2011 16:47 Edited at: 9th Feb 2011 18:31
Thanks, I was hoping to edit the post but it took a while to post (this is my first time posting here).

I found a couple of threads about putting the Functions after the main loop but it then errors with "Run time error - File does not exist at line 154."

I think I need to retype it all as I've been moving bits around trying to get it to work but here is what I have so far.



I'm still really new at this so I'm sorry if I seem to be talking rubbish half the time.[u][i]
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 9th Feb 2011 22:40
Just with a quick glance...

you've got

for zz = 1 to maxcubes
for xx = 1 to maxcubes

but close those loops with

next xx#
next yy#

so, change the yy# to zz#

Also, you have the program end, and there is no main loop, so you'll need to loop back instead of end.

Asmodeus
14
Years of Service
User Offline
Joined: 27th Aug 2010
Location:
Posted: 10th Feb 2011 09:59
Thanks for that...I hadn't noticed it.

I think I'll give the official tutorials a miss, this one is just confusing the crap out of me with all the errors in it. I think I'll go back to something a little more my level of skill.

Thanks again
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Feb 2011 12:31
Quote: "I think I'll give the official tutorials a miss, this one is just confusing the crap out of me with all the errors in it. "


Don't do that.

Try this version of the Huge Dungeons tutorial. I've just tested it and it seems OK. I made some minor edits ages ago to get it working.

Press the spacekey to quit.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-24 08:08:27
Your offset time is: 2024-11-24 08:08:27