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 / Halp! Text adventure engine hiccups and I don't know what's what!

Author
Message
Bafflebox
14
Years of Service
User Offline
Joined: 25th Aug 2010
Location:
Posted: 26th Aug 2010 15:54
So, it returns this:

Compiling project...
Subscript must be Integer or DWORD when referencing an array at line 87.
Compilation Failed (Syntax Errors)


I'm probably just reading across it entirely, but I've been breaking my head over it for an hour now. I ust want it to work

Hope you can help~!

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 26th Aug 2010 22:33 Edited at: 26th Aug 2010 22:34
Take the spaces out of end case so its endcase and end select so its endselect, then it'll start going.

Dark Physics makes any hot drink go cold.
Bafflebox
14
Years of Service
User Offline
Joined: 25th Aug 2010
Location:
Posted: 27th Aug 2010 02:10
No, that doesn't fix it
It still returns the same problem. Silly syntax error, but yeah, the problem remains. Any other suggestions? ^_^; I really hope someone can help me out here~

Oh, PS!
This is a little off-topic, but the editor is a bit slow on the uptake for me, does anyone know why? I'm using W7 x64 on a 2.33GHz Core2Quad with 4GB RAM, so I don't think my computer would be to slow (I certainly meet the requirements)
Still, the editor is reaaally sluggish for me :o
Any thoughts on that? (to clarify, there's an increasing latency between typing and visual display, which is rather distracting :o)
Wysardry
14
Years of Service
User Offline
Joined: 10th Jun 2010
Location: Yew Kay
Posted: 27th Aug 2010 02:57
It doesn't seem to like the abs command being used with your array. Also, the code where you set the values for nogo$ is never reached as it's after the loop and outside the subroutines.

I'm still new to DB Pro myself, but the following code at least compiles and runs. I'm just not sure it's doing what you wanted it to:-

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th Aug 2010 07:02 Edited at: 27th Aug 2010 07:03
Yeah HowDo is right about your SELECT/CASE statements and Wysardry is right about ABS(). ABS() is used to convert a negative number to a positive. There's no need to use ABS() since your room numbers are never negative. With ABS() it was giving an array out of bounds error so use Wysardrys modification of your code.

That's a nice start on a text adventure game by the way.

Bafflebox
14
Years of Service
User Offline
Joined: 25th Aug 2010
Location:
Posted: 27th Aug 2010 12:25
Thanks so much!
I got rid of the excessive spacing and the ABS() function. The reason I had it in there was to be able to create different kinds of "You can't go there" messages (for which I'd use the NOGO$ array)

I wonder how I should fix that, now, though ^^:
Also, thanks Grueslayer!

I used one of the newbie tutorials as a basis for it. Although it's very largely based on it, actually, I'm not sure how much of it is exactly the same. I did try to rewrite the code myself, but I'm sure I did a lot from memory
Wysardry
14
Years of Service
User Offline
Joined: 10th Jun 2010
Location: Yew Kay
Posted: 27th Aug 2010 15:47
Try this:-



There's a bit more code, but I think it now does what you were aiming for.
Bafflebox
14
Years of Service
User Offline
Joined: 25th Aug 2010
Location:
Posted: 28th Aug 2010 01:11
I could've sworn I had replied :o

In any event, thanks! That's definitely working now
Now all I need are items and flags and I'll be all set to make a decent TA ^-^

Login to post a reply

Server time is: 2024-09-28 20:25:50
Your offset time is: 2024-09-28 20:25:50