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 / RPG Terrain Maker-Help

Author
Message
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 2nd Mar 2008 22:59
Ok, I wish to know how to make a Terrain editor...please don't tell me exactly the code...just help me if you wish. Ok, I don't know where to start...should I divide the screen up into a 20(x) by 15(y) grid? and divide that up into 32x32 tiles...sort of like the editor i've used before (Mike Shah's) but people told me that his editor stunk...so would I do that? And is there a way I can make it to where in the editor lets say I hold in p, then click, and it registers that as unpassable(moves hero sprite away) and if you just click you can walk over it? Like I said im not expecting you guys to do the project for me...id really rather you didn't so I can "Learn" how to do it(I learn better when I'm told what to accomplish, then I put up my recent code and you tell me what's wrong better ten when im givin the answer)

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
Paul08
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location: Oxford, UK
Posted: 2nd Mar 2008 23:09 Edited at: 2nd Mar 2008 23:13
Ok im telling you to run a search for data read/write.
I saw a post just recently

<hunts>
<finds>
http://forum.thegamecreators.com/?m=forum_view&t=124678&b=7

I dont know if you've had experience with that, but then you should just create a test, so when the mouse is between a certain x and y co-ordinate - if they click, change the corresponding data.

You should probably setup a little system like:

G - grass
W - wall
O - water/ocean

then its just a matter of using read/write functions to load and save data??

does this sound good?

Paul
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 2nd Mar 2008 23:33
Well...im going to try, thanks for your help I'll report my problems if I run into any.

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
Paul08
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location: Oxford, UK
Posted: 2nd Mar 2008 23:45 Edited at: 2nd Mar 2008 23:45
had a really quick go at a grid idea



-found it quite difficult to get each tile to mate up - but ive never divided up the screen before- oh and i realise i should of done this in a loop

Paul
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 4th Mar 2008 00:02
here is my terrain editor so far. I took some of Mike Shah's Code and edited it to my needs.



Ok, now when I save the file it puts it all 1 line per string...so its like

Quote: "
1
1
W
1
1
W
1
1
etc. etc.
"


I want it to do it like this
Quote: "
1 1 1 W 1 1 W 1 1
"

I need it to be 20 acrros and 17 down...anyone have any suggestions on how to do that?

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 4th Mar 2008 15:09 Edited at: 7th Mar 2008 06:56
This is hint.


<< this is code box
Paul08
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location: Oxford, UK
Posted: 4th Mar 2008 19:32
might not be the right way but you could even punch them into arrays? - dont want to confuse matters though

Paul
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 10th Mar 2008 00:25 Edited at: 11th Mar 2008 04:03
pcraider, how do i get it to write to the file like that though?

EDIT:What I mean by all of this is when you save the file, it saves every string to 1 seperate line. I want it to be able to save it like a data statement and read like a data statement...how would I do this?

EDIT2k, nvm guys, I just decided to go with the way I have it, I tried making data statements, but this is fine anyway...here is my new problem relating to this.

I have my terrain maker have the images set up differently (ex. hero is sprite 1 in real game, grass is 1 in terrain editor) so I know how to change it when creating the file from what grass is to what it is supposed to be...but I forgot...you can only use each sprite once (unless cloned) so basically I created (for example) 100 grass sprites (1-100 for example) I have it set up like this.


Ok, this works all fine, but it changes all of the sprites from 1 to 100 and I wish for each (x,y) axis to have a seperate number. So basically if Grid(0,0)=1, then I want it to realize that Grid(1,0) must equal 2, and Grid(2,0) must equal 3, if they are all 3 grass sprites...or say Grid(1,0)=1, then if the next grass sprite is in the point (15,18) then Grid(15,18) must equal 2...if that makes sense...well I really need help on this, thanks in advance.

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/

Login to post a reply

Server time is: 2024-09-27 12:14:46
Your offset time is: 2024-09-27 12:14:46