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 / Some suggestions, please

Author
Message
Killswitch
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 7th Jan 2004 20:53
Well some of you remember that i've long wanted to make a text based rpg in darkbasic, I've started up lots of times but always stopped then either continued or started all over again when I figure out a way to do something better or I have another idea.

Anyway this time I'm really serious, its my new years coding resoultion, and I'm going to need an editor to get the rooms built as I've previously tried to hard code the rooms into the game - needless to say chaos soon took over.

So I'm trying to build a world editor, again. The first time I tried to do this was late last year I most of the major points worked out (saving, loading, loading in game, objects ect) but I can figure out a way to unquiely identify each room and succesfully connect one room with another (as well as creating new rooms when I want to expand in one dirction).

Any ideas/thoughts/pity/cheese (?) you have on the matter would be greatly appericated

~I see one problem with your reasoning: The fact is that is a chicken~
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 8th Jan 2004 04:37
Cheese? cheese is good, i like cheese! lol.

Anyway... um ...

To answer your question, in the "rooms" if you are using a plain as the floor, then you can simply use that object's number as the identifyer for the room, as it give you both the 3d coordinate of it, and a unique number for it ( it must be a unique number 'cos you can't have duplicate objects ).

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Killswitch
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 8th Jan 2004 21:44
Erm... there are no 3d objects in a text game...

~I see one problem with your reasoning: The fact is that is a chicken~
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 8th Jan 2004 22:38
Wouldn't it be a simple case of just adding another DIM variable to the start end of whatever code you use for the room descriptions etc?

Ok so its not a mouse.
Killswitch
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 9th Jan 2004 00:31
I tried doing that last time but I couldn't figure out how to get each room description, exits and objects all from the one variable, or how to check to see if I am creating an exit into the room I want and not room 65 if you know what I mean.

~I see one problem with your reasoning: The fact is that is a chicken~
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 9th Jan 2004 04:39 Edited at: 9th Jan 2004 04:40
Quote: "there are no 3d objects in a text game..."


lol, don't I feel like an idiot

well, make an array to hold all of the rooms ( make the array at the start of your program with the maximum amount of rooms yuo can have. Then, use that to specify what rooms connect to eachother.

Ie,



In that fashion, you can change where any room conects, and if it is undefined ( ie, = 0 ) then, you can create another room and attach it to it.

Hope I Helped... ( this time... )


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Killswitch
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 9th Jan 2004 20:41
Lol yeah thanks alot

~I see one problem with your reasoning: The fact is that is a chicken~
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 9th Jan 2004 21:23 Edited at: 9th Jan 2004 21:26
or you can just use a character array, the locations are indicated just by the co-ordinates of the descriptions (psuedocode)

dim descriptions$(5,5,5)
for i=1 to 5
for l=1 to 5
for j=1 to 5
read description$(i,l,j)
next j
next l
next i
startposx=3
startposy=3
startposz=3
do
print "direction?"
input a$
if a$="up" and startposy<5 then inc startposy
if a$="down" and startposy>1 then dec startposy
if a$="north" and startposz<5 then inc startposz
if a$="south" and startposz>1 then dec startposz
if a$="east" and startposx<5 then inc startposx
if a$="west" and startposx>1 then dec startposx
print "you are currently located in the ",description$(startposx,startposy,startposz)
print
loop
data "hall","basement","spacious palace waiting room", "creepy tomb"................

that sort of thing can index the loacations, to prevent yourself from being able to walk into any room like you can in this example, you just add six characters to the start of each room description and then print just the right side of the description and the six characters would limit movement, just check if the player moved down, and if the 1st character was "d", that means the move is allowed, likewise, if the character was "n" then thats a solid wall and you don`t decrement the position, just print, "you can`t go that way" or "you can`t walk through walls...yet"
you would modify the code to read something like this (psuedocode again)

if a$="up" and startposy<5 and left$(description$(startposx,startposy+1,startposz),1,1)="u"
inc startposy
else
print "OUCH!...thats the ROOF!....dumbo!"
endif

you can use other characters to indicate locked doors etc and change the characters as the game progresses to indicate openings or tunnels that cave in etc, hope thats some help, cheers.

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800Pro 128mb.
Killswitch
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 9th Jan 2004 23:28
What I'll think I'll do is set the room ID numbers manualy for a simple level of about 5 rooms then after that I'll try to indtroduce the automatic code after that, maybe as part of another feature then maybe I'll introduce it everywhere... It seems a little less duanting then plus I'll have the bonus of a base to work from.

Thanks alot for your help

~I see one problem with your reasoning: The fact is that is a chicken~

Login to post a reply

Server time is: 2025-05-22 08:36:30
Your offset time is: 2025-05-22 08:36:30