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.

Code Snippets / Cartography Shop style map editor

Author
Message
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 21st Jun 2003 19:23 Edited at: 28th Jun 2003 22:36
Note: This is not finished yet!

This is my first attempt at trying to make a mapping prog, like CShop. I hope I'll be able to finish it!

- 4 views, 3D, XZ, XY, ZY
- Drag out boxes to make level
- 3D navigation (hold dowm mouse on 3d screen for mouselook, arrow keys)
- Save (press space)
- Select box by clicking, delete by pressing delete
- Resize handles

Updated code below


Run as 800 x 600. The code should set this. Recommended running in window.


To be put in:
- Moving boxes while being dragged
- Some sort of GUI
- Exporting to a common format
- Texturing


There may be some quirs and bugs, plus some of the source if uncommented and very tricky!

If only I could fit it into 20 lines - I might even win something then!

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
Oliver
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 21st Jun 2003 20:28
Nice , this could be really cool when you finish it.

You might want to have a look at the origninal CShop. I think it was made in DB. The source code is available, I had it some where...
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Jun 2003 20:29
David89
this is great
please keep us informed of your progres.

one thing,i only got two views

dave

just trying to learn
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 21st Jun 2003 21:13
Quote: "You might want to have a look at the origninal CShop. I think it was made in DB. The source code is available, I had it some where..."


Really? I know CShop was written in Blitz, but I though Josh Klint was licensing out the code (I'll ask on the CS forums).

Quote: "David89
this is great
please keep us informed of your progres.

one thing,i only got two views

dave"


There are actually 3 including the 3D view, only 2 are 2D.

I might be able to upload an updated version source version tonight, with fixed placement and maybe a 3rd view. And resizing if you're really, really lucky!

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Jun 2003 22:23
i'le keep my fingers crosed

dave

just trying to learn
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 22nd Jun 2003 00:05 Edited at: 22nd Jun 2003 00:07
Nice,
I'll be interested to see how it developes and what sort of 'Save and Export' functions it has.. Keep at it,

gbuilder.

AMD900mhz, 256mb Ram, 64mb GForce2 MX400 Graphics card, Windows ME.
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 22nd Jun 2003 00:12
thats a great snippet when the csg commands into play

David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 22nd Jun 2003 00:32
Hi all,



Thank for all the comments.

I've just got a 3rd viewport in, plus object selectionj an deleting objects. However, I still can't get the resizing working just right

I'll upload the code later tonight.

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 22nd Jun 2003 01:10
Updated Source - 4 viewports, object selection, save (press space and type name - no load yet), object deletion (press delete when selected, larger resolution, general improvements.

Code below, no media needed.

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 22nd Jun 2003 01:12
Here's a pic of what I've got so far



You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 22nd Jun 2003 01:45
Unable to draw boxes now for some reason..

gbuilder.

AMD900mhz, 256mb Ram, 64mb GForce2 MX400 Graphics card, Windows ME.
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 22nd Jun 2003 01:55 Edited at: 22nd Jun 2003 02:35
same as gbuilder

Unable to draw boxes

dave

just found that if you click both mouse
buttons together then you can now draw
boxes,hope that helps

dave

just trying to learn
gbuilder
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: New Zealand
Posted: 22nd Jun 2003 07:43
Yep, that's it both buttons now (I think I preferred just one).
What would be useful is 'handles' on the box ends for shaping.

gbuilder.

AMD900mhz, 256mb Ram, 64mb GForce2 MX400 Graphics card, Windows ME.
Oliver
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 22nd Jun 2003 12:37 Edited at: 22nd Jun 2003 12:46
@David89

I was talking about the very first version of cshop. It's very similar to yours. It exported the collision data to a *.txt file and created a *.asc file which could then be converted to an *.x in a program like 3d exploration.

This was for DBC, so with DBPro you would need to export collision information, just the object file. Are you planning on making it work with any angle, not just 90 degree boxes?

As for the old cshop, you could search for it on google, though I managed to find it along time ago, it might not be there anymore.

Just some ideas
A tool which allows you to carve one object out of another (like in hammer). Though as far as I can see it would be next to impossible.
Some sort of menu. I remember in the old cshop there were lots of commands like Ctrl+S for save and it got confusing.

Good Luck!
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 22nd Jun 2003 16:44
A tool which allows you to carve one object out of another (like in hammer).

patch 5 csg commands will cover that like a charm


Some sort of menu. I remember in the old cshop there were lots of commands like Ctrl+S for save and it got confusing.

make your own or use the brilliant LMS Lightweight menu system by scofflaw? i forget who.

granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 25th Jun 2003 00:50
any news David89
i cant contact you,web site down
i wonderd if you could post a comented version of what
you have done with this so far.
thanks

dave

just trying to learn
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jun 2003 12:53
Hi Everybody. I've been away for a week (and forgot to tell you ) but I've been following this thread on my smartphone (Pocket Internet Explorer).

Quote: "Yep, that's it both buttons now (I think I preferred just one).
What would be useful is 'handles' on the box ends for shaping."


Click on an object to get handles. However resizing isn't in yet.
The reason is is now both buttons is because you can also select a box by clicking the LMB. Having two checks in the same loop causes everthing to get a bit mucked up, so it's either LMB for drawing and RMB for select, or the other way round.

Quote: "Some sort of menu. I remember in the old cshop there were lots of commands like Ctrl+S for save and it got confusing.

make your own or use the brilliant LMS Lightweight menu system by scofflaw? i forget who."


You may have noticed this is in Code Snippets, not beta announcements because it is a code snippet. I might consider developing it further. I probably will, but it's still a snippet!


Quote: "i cant contact you,web site down
i wonderd if you could post a comented version of what "


I haven't made my email public, so naturally you should have trouble contacting me however my web site shouldn't be down. I'll check right away.

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
Shady Simpson
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 28th Jun 2003 15:58
just read the post and can't wait for it to be finished, looks cool m8, BTW RobK has also made a menu system. It's somewhere on the RGT DLL forums but I haven't got a link.

Shady Simpson
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 28th Jun 2003 16:09
just a suggestion:

You should put it into a window, don't know about you but I can't stand a program that's not in a window.

David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jun 2003 21:03
Quote: "just a suggestion:

You should put it into a window, don't know about you but I can't stand a program that's not in a window."


Just a suggestion: as this is a code snippet paste it into DBP and put it in a window yourself. I'm sorry if that was a bit abrupt but that is the way to put it in a window, after all


Plus, once again, this is a code snippet! Don't assume it will be finished! I hope to but I've mainly posted it to show people how to create something similar. But knowing all of you you just want a map editor

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jun 2003 21:40
Update: Resizing with handles in all 4 directions in first view. Should be easy to port over to other 2 views.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 28th Jun 2003 22:02
gets better all the time

dave

just trying to learn
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jun 2003 22:06 Edited at: 28th Jun 2003 22:09
Thanks

Edit: Yay I got resizing working in XZ and XY views now

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jun 2003 22:34
UPDATED CODE

Additions / changed:

- Drag RMB to create
- Handles for resizing - select shape and drag handles to resize

See first post for code.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 28th Jun 2003 23:34
thanks for sharing this this
however far you take it this will be a great
start fore anyone who wants to write there own editor

(thanks for the comments)

dave

just trying to learn
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 29th Jun 2003 00:13 Edited at: 29th Jun 2003 12:42
Quote: "thanks for sharing this this
however far you take it this will be a great
start fore anyone who wants to write there own editor

(thanks for the comments)

dave"



No problem. However, I didn't put too many coments in tomorrow I'll add more.

[Edit]

.X exporter going in now..... I hope this works!

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 29th Jun 2003 15:13
Yay I got the .x exporter in. It still needs a bit of refinement, as there is no exturing in yet (and so the model is invisible) but here is what is exported:



Wow that was hard but also fun. Thanks go to the kind soul at Microsoft who wrote the .x specification - a real help.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 29th Jun 2003 16:40 Edited at: 29th Jun 2003 16:41
still trying to work out what's what :-s

dave

just trying to learn
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 29th Jun 2003 17:26 Edited at: 29th Jun 2003 17:27
What's what in what? If you're talking about the exported .x file DBP will handle that for you

Plus, the exported file above had a few mistakes in it so the exporter is being rewritten. Here is the code for the exporter if you want:



You are the th person to view this signature.
GRAVITY: I fought the law but the law won
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 29th Jun 2003 17:38
sorry i meant the whole thing,i'me going throu
the program a bit at a time,working out what code
dose what

dave

just trying to learn
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 29th Jun 2003 18:08
I'll comment it now and upload a new version.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
Shady Simpson
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 5th Jul 2003 11:47
any updates?

Ocean Runner
20
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 6th Jul 2003 05:04
could you compile that for the poor,poor people who don't have DBPro?

JetRace coming. Watch out!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 7th Jul 2003 21:50
@David89
could you post a link to the .x specification? Thanks

"All programmers are playwrites and all computers are lousy actors" -Anon
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 8th Jul 2003 00:20 Edited at: 8th Jul 2003 00:21
1. Yes, an update will come soon. I want to get texturing in there with .x

2. Maybe - probably yes

3. Sure - http://www.wotsit.org/search.asp?page=10&s=graphics

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 10th Jul 2003 06:37
Thnx

"All programmers are playwrites and all computers are lousy actors" -Anon
Sniffer
20
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 22nd Jul 2003 22:10
I can't get the first code to work i copyid it and pasted it in to darkbasicpro but it is saying missing include file whats wrong can any one post a link to the code allready setup

David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 1st Aug 2003 19:11
You'll get the error about 4 times. For some reason it didn't copy the carrige returns at the beginning of each include files, just separate the two lines:

return Rem include file

becomes

return
rem include file

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 2nd Aug 2003 23:18
hi david89

how are things progressing with the editor
any news

dave

just trying to learn
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Aug 2003 20:51
Hi,

I've been away for 3 weeks so no work done since my last post

I think, unless I find free time, the curretn state might be the final state. It was not meant to be a proper editor, just test, and I did that.

I still want to do .x, though. Can't manage it yet

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
granada
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 3rd Aug 2003 20:59
thanks david89

maybe i should get off my lazy but
and try to learn from your example,and
try to improve it with my own work

(I still want to do .x, though. Can't manage it yet )
it would be nice to see ,x. in thouhg

dave

just trying to learn
UnderLord
20
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 4th Aug 2003 02:11
Let me know when you are done with it =)

http://www.freewebs.com/independant

Login to post a reply

Server time is: 2024-04-19 09:38:31
Your offset time is: 2024-04-19 09:38:31