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 / help on rpg game

Author
Message
Matt Drith
17
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 31st May 2008 03:05
Hey all!

I ive been programming with darkbasic for a little while but just found the website today!


anyways im making a little rpg game however I am stuck on how to generate the map. I consider myself just past the newb mark, so sorry if this is a dumb question!

heres my code:


You have to run this program first so it creates the file that is loaded!




Heres the actual game:
(if you can call it such)


BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 31st May 2008 04:04
Quote: "just past the newb mark"


Don't know if an rpg is necessarily the best place to start. Good ways are simple, seemingly pointless games like pong and such.

now, to help you out with a few pointers:


1. Where does map$(x,y) get defined as anything other than ""? all you did in level1 was make some data statements
2. The data statements are wrong as well. Since (I assume) you will be loading these values into a string, EACH must have its own quotes, otherwise it will be regarded as one very large (and useless without more cumbersome commands) piece of data. so it should look more like this:


3. It would be much easier (for maps as simple as that) to simple forget 0's and instead leave it empty (is read by computer as ""). This will save you some loading time as it will automatically be set to what would be interpreted as default terrain.

4.

Did you mean xlocal and ylocal? Just to clue you in, ALL variables in dbc are global (except those in functions, but thats another story for another day). If you look at the code, the values x and y are never changed, they just remain as 0,0. A simple change would make this better: if map$(w,h), that way it will correct itself as the for loops progress.

5. Kinda the same as 4 but just wanted to point it out, xlocal and ylocal are added 11 to every time they are referenced (in the loop, after drawing the box, it adds 11 to BOTH). The problem with this is that you will only be able to tile in a single diagonal line. To fix this move them to different parts of the loops (add 11 to the width at the end of the width loops and then 11 to the height at the end of the height loop but AFTER the next command for the width loop).

Why? This will make it create boxes starting from the top, going left to right row by row. Remember, just like in math, the order of operations is very important.

These are just a couple things I saw, there may be more, but wanted to help you out. I would suggest starting a little simpler, but congrats on not falling into the idea of "I just got a new programming language that can make games! I am going to make the worlds greatest MMORPG!!!" That only results in crushed hopes and spirits (trust me...I know from experience).

Hope these help!

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Matt Drith
17
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 1st Jun 2008 01:14 Edited at: 1st Jun 2008 20:00
ok i added the suggestions that you made.

However I am still unable to get it to generate the image on the screen.

This is the image I am trying to generate:

[img]null[/img][img][/img]


and heres the condensed code without all the other stuff you dont need to know:

Matt Drith
17
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 11th Jun 2008 08:49
ok i can see why, i think, that this does not do anything.

i think it is because the data is not being read each time so it cannot distinguish which line came first or which one came last and it is not connecting the data lines with the for w = 1 to mapw commands.


can someone explain to me how I would go about generating the map I want?

I am at a loss for ideas on this one.

thanks!

and thanks for your help BN2 Productions!

Login to post a reply

Server time is: 2025-06-06 16:05:28
Your offset time is: 2025-06-06 16:05:28