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 / What is wrong with my Text RPG?

Author
Message
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 15th May 2009 01:27 Edited at: 15th May 2009 23:18
I am making a text RPG and when I try to run it, it says syntax,nesting error so please run it on your computer and tell me what is wrong with it because I seroiusly have no Idea why it won't run.




EDIT:
K sorry ron its just that sometimes I forget alot

EDIT: Also when I type something and mess and press enter it does not let me backspace the whole program just stops I want a system so that if you press enter and you type somthing that there is no command for it just gives you a new line of code.

[link]www.kdlproductions.webs.com[link]
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 15th May 2009 02:31 Edited at: 15th May 2009 02:36
You forgot to put an ENDIF after
Quote: "If Command$ = "vac""




ALSO,
if you can't figure out somthing put a remstart and a remend at diffrent parts of your code until it runs right

If at first you don't succeed-Pause-Go to last checkpoint
Yodaman Jer
User Banned
Posted: 15th May 2009 02:34 Edited at: 15th May 2009 02:36
You can't have all of your input commands in a Do..Loop. Put all of these...



...into a subroutine, something like



Then call that subroutine in your Do...Loop with Gosub command_input.

That should do it.

EDIT:

What razerx says is true, I didn't catch that. Hmm, maybe you don't have to use subroutines..but whenever I tried to get input in a do...loop I had problems, so using subroutines may be the key.

"If you want lots of people to play your game make it simple; lots of people are simple." -Obese87
spt games
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 15th May 2009 02:56 Edited at: 15th May 2009 03:10
Fixed it. You didn't close your final If statement. I have indented it as well, it should run now


Try indenting and spacing out your code so you can proof-read it easier. Mistakes like forgetting to close IFs stand out straight away when you indent the code If you need help with this then Obese87 has written an excellent guide:


http://forum.thegamecreators.com/?m=forum_view&t=138230&b=10

Agree with razerx on the use of REMarking out statements that aren't working until you figure out why they aren't working, then delete the rem or remstart & remend. Type rem in the editor and press F1 for info on rem

Also, what Yodaman Jer says about using subroutines is quite right. Once you get the hang on them they can save you a lot of typing and help cut down on errors. TDK has a great intro to subroutines on this page:

http://forum.thegamecreators.com/?m=forum_view&t=96075&b=7

(scroll all the way down to "What Are Subroutines (sometimes called Procedures)"

- Steve

Attachments

Login to view attachments
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th May 2009 03:20
Quote: "... Obese87 has written an excellent guide"

Another recommendation!
Not sure if it should be stickied yet though I want to make a few changes and finish all the topics first. Now I have a PC again I might just get this reference finished

@Chewy
A nesting error means you haven't closed a statement after opening it. This could be an If-Endif or any type of loop (For, While, Repeat, Do); any command that occupies more than one line.
Indent your code and you'll never have to post on the forums with this error again.

Riddle: The more you take, the more you leave behind. What are they? Answer
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 15th May 2009 05:36
K ya guys that fixed it.
I didn't put an endif and I only thought I needed an endif if there was more countinous code after.

[link]www.kdlproductions.webs.com[link]
arbiter chewbacca hybrid
16
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 15th May 2009 05:38
and what do remstart and remend

[link]www.kdlproductions.webs.com[link]
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 15th May 2009 05:57 Edited at: 15th May 2009 16:45
the REM command when placed at the biggining of any line tells
dark basic to skip that line.For example:

But what the REM command is useful for is to tell you stuff you
will probaly forget or to tell others what they might not understand.


Now REMSTART's and REMEND's are used to skip many lines of code so
you can put longer notes without putting rem on every line.

So this:


Turns into this:

Hope that helps

If at first you don't succeed-Pause-Go to last checkpoint
Ron Erickson
Moderator
22
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 15th May 2009 13:24
arbiter,
This is the 2nd time I am warning you about double posts. If you need to add something to your post, especially 2 minutes later, then please use the modify button.

Thank you!

Ron


a.k.a WOLF!
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th May 2009 17:36
Hey razerx, a better substitute to remming out the program is using breaks or step through mode. heck they were made for debugging lol

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 17th May 2009 01:44
Quote: "step through mode"


Isn't that only dbpro? Or is it in DarkEdit?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
spt games
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 17th May 2009 16:57
Step Through is available in DBC if you use DarkEdit. From DarkEdit editor, either press SHIFT + F5 or choose "Compile" menu, "Step Through...".
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 19th May 2009 07:07
Yup DarkEdit Does it. Do you not use darkedit Bn2? what do you use?

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 19th May 2009 08:09
I use the built in interface. I know it has some problems, but I like it better than a windows one, not really sure why, just do.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 19th May 2009 17:08
Oh thats cool i use darkedit mainly for the bottom scroll bar lol the built in one is a pain to get over if you text goes off the screen. that and the extended syntax(if you don't know, Darkedit has types and globals and something else i don't remember)

New Site! Check it out \/
spt games
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 19th May 2009 23:40 Edited at: 19th May 2009 23:42
Line Numbers
Insert RGB Color right-click menu
Customisable Syntax Highlighting - colours,font,etc
The Search Menu - Find, Goto Function, Goto Label etc
Up to 25 windows open at a time, so can view/edit multiple files.

All nice features of DarkEdit.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 20th May 2009 01:40
and you can insert pre-written code templates (ctrl+J) and write your own ones too! Look in the readme if you don't know how.

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer
spt games
16
Years of Service
User Offline
Joined: 14th Apr 2009
Location: United Kingdom
Posted: 20th May 2009 02:01
@OBese87

Thanks
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th May 2009 07:05
Oh Well ya i geuss i take those for granted... hmmm i use those a lot. ha i should pay more attention lol

New Site! Check it out \/

Login to post a reply

Server time is: 2025-05-15 00:36:41
Your offset time is: 2025-05-15 00:36:41