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 / problem with tutoral 5 huge dungeons

Author
Message
madness chuckles darkly
12
Years of Service
User Offline
Joined: 1st Feb 2012
Location:
Posted: 9th Feb 2012 19:44
Hello

I am having trouble with this code. Could someone please proof read it and find the error that is causing the code to not run. Thank You.
scythe_reaver
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 9th Feb 2012 22:15
I'm on my phone atm, what error is it giving you?

http://www.shrinkpictures.com/processed/phprZ6E7O_c2AM.jpg
"I AM YOUR GOD OF DEATH"
madness chuckles darkly
12
Years of Service
User Offline
Joined: 1st Feb 2012
Location:
Posted: 10th Feb 2012 19:41
i started it over and this is my current problems.

Could not determine parameter type of '“dungeon.map”' at line 41.
in the


and when i set the parameters from



to



and run it I get
Declaration name '“dungeon.map”' is not valid at line 30.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 11th Feb 2012 02:56
Leave your function as this:


The problem is your quotes. Somehow you have this “dungeon.map” instead of this "dungeon.map". Not sure how you've done that but the compiler doesn't recognise it as a string so you'll need to use the 'other' quotes.

madness chuckles darkly
12
Years of Service
User Offline
Joined: 1st Feb 2012
Location:
Posted: 13th Feb 2012 18:51
it successfully compiles but as soon as it pops up it says.

early exit error
you have hit a function declaration mid program

what am missing or have i done wrong.

nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 14th Feb 2012 09:20 Edited at: 14th Feb 2012 09:23
Quote: "you have hit a function declaration mid program"


Where you main module endeth, so placeth ye the phrase "END"

This is what you're doing essentially:
(wrong code)


So it should be:
(The correct code)


This is because the program runs from top to bottom in a linear fashion. Now all your functions are actually already declared when the program starts so when it hits them again, it causes a conflict. That is why you cannot declare a function mid-program, hence always put "END" above the start of your functions.

madness chuckles darkly
12
Years of Service
User Offline
Joined: 1st Feb 2012
Location:
Posted: 14th Feb 2012 18:35
what is wrong with my function


nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 15th Feb 2012 08:22
Quote: "what is wrong with my function"

Nothing. That's not what I said. Read the post again...

I've just spotted another error after looking at your code. Perhaps this will clarify: Define all functions at the bottom of your code. You must also terminate your main program before in runs into a function as declarations must be done at the top of the code (Or it was like that in the stone age where I hail from). Luckily DBPro does function declarations automatically (I presume). So terminating your main program prevents a double declaration of the same function.
I've marked out your errors here (there may/may not be other errors, I'm just focusing on what I saw:

Here is your code, corrected:


Seems silly but it keeps things neater and more efficient this way and I think it's easier to translate into ASM too.

madness chuckles darkly
12
Years of Service
User Offline
Joined: 1st Feb 2012
Location:
Posted: 15th Feb 2012 19:10
still not working when i run it. When it ends with the END command, it will start up and then shut down. When i add a do command to try and have a set button to exit with, it comes up but only displays a black screen.

nonZero
12
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 16th Feb 2012 13:22 Edited at: 16th Feb 2012 13:37
You used SYNC ON, meaning you have to call SYNC to update the screen.
SYNC ON = You update the screen
SYNC OFF = Computer updates the screen
Try this:

Instead of this:


Also, unless you call DISABLE ESCAPEKEY, the Escape key automatically terminates your program (it's actually compiled that way), eg:


Sidenote: The SYNC commands can be a menace if not used correctly. SYNC will update (draw) to the screen when it's called ("[except the first time]" says the docies). However, the program will automatically update itself if SYNC ON is never called. The main advantage of manual SYNCing is saving resources. This can, however, backfire. Personally, I'd recommend you simply use SYNC RATE to set your refresh rate and leave the refreshing to the computer. The only times you need manual control over the refreshing are:
1) When you have a resource-hungry app*
2) To manipulate the program ie intentionally not update something.

*But you can get away with a lot so far as graphics are concerned. This should not run slower than 100FPS on even a low-end PC. This runs at around 350 on my laptop (Warning, this may induce siezures in those with a history of epilepsy. View with caution):

While not the most accurate of tests, it shows you can have 1000 reasonably complicated objects moving at once and still get a decent performance without needing SYNC ON. Obviously things like collision-detection will slow things down a little but unless you're using extremely hi-res textures, lots of high poly-count models and huge worlds, you can probably get away with not worrying about performance. But you can see once you've gota working level.

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Feb 2012 00:14
anybody else apart from me notice his

REMSTART
and
REMEND

surrounding his DO:LOOP?

or did I miss something?

Login to post a reply

Server time is: 2024-05-09 10:15:56
Your offset time is: 2024-05-09 10:15:56