home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Tutorial on how to add mapmodels

by zheddo on 10/12/2007 11:45, 19 messages, last message: 06/10/2008 21:10, 3727 views, last view: 05/03/2024 19:42

STEP 1:

1. Open your model directory

.../sauerbraten/packages/models/

2. Add your own folder, for time being I will call mine "kipsta" for now, so now you have the directory

.../sauerbraten/packages/models/kipsta

3. For every model you would like to add to your game, add a new folder. Lets take a model of a box as an example. It should now look like this:

.../sauerbraten/packages/models/kipsta/box1
(box1 since i will most probably have more boxes, i will later on name them box1, box2, box3, etc...)

NOTE: Look out for that your folders and subfolders are all NONCAPS, it makes it easier later on, and if i remember correct it gets buggy sometimes with the caps non caps, so keep it all small ;)

3. Add your model, this should me an ".md2" or ".md3" file, and add its skin to it, which will have to be in a ".jpg" file

4. Change the models name to "tris.md2/md3" and the .jpg file to "skin.jpg"

The directory should now look like this:

.../sauerbraten/packages/models/kipsta/box1

inside .../box1 there should now be 2 files:

- tris.md2/md3
- skin.jpg




STEP 2:

1. Go to your base directory, which is under:

sauerbraten/packages/base

2. Search for your map, as an example I would have a map called "kipstamap" create a file (with any text editing tool) that has the SAME name as the map. The text file will have to end with a ".cfg" suffix!

You should have 2 Files in your .../base directory now:

- kipstamap.ogz
- kipstamap.cfg

3. Open your .cfg file, and add the following code:

mapmodelreset

mmodel "kipsta/box1" // 01
mmodel "kipsta/box2" // 02
mmodel "kipsta/box3" // 03
mmodel "kipsta/barrel1" // 04
...etc

4. Explanation:

"mapmodelreset" means that you will reset the standard mapmodels, so that you will not use the standard map models that come with the editor.

"mmodel" means mapmodel, and is the name of the folder the certain model is in

you will need the " as i have written it in the code above, otherwise it will not work, in between the " write the directory you get the model from, remember I used "kipsta" as a folder, yours will be called different ;)

the "//" at the end of each line I used to do the counting, so that i know which model is which number later on.

5. For every model you would like to add, add a new line of code



CONCLUSION:

You should now have a separate folder for every model, inside each folder there should be a tris.md2/md3 and a skin.jpg file. And inside the .../base directory there should be your mapname.cfg file with the coding i showed you


Have Fun adding your models
- Zheddo

   Board Index   

#1: ..

by geartrooper^2 on 10/12/2007 18:19

informative. helpful. this will add to the knowledge base for new users. 4 stars.

reply to this message

#2: ..

by slider on 10/14/2007 12:23

This is wonderful

Could you also add a tut for including normal maps for models. Whats needed in the .cfg etc.

That would make it a 12 out of 10

reply to this message

#3: ..

by JadeMatrix on 10/21/2007 18:55

You need to be careful here. You can't use just any text editor for the cfg. The more advanced ones (more likely new users have one of these that come default w/ os's) have extra info in the files for the app to read. In order to make a cfg, you need something that makes pure text files, ie .txt . I learned this when sauerbraten kept giving me messages about weird headers in my cfg's. I use Xcode, but that's only for Mac. I dunno if you can export to txt from Word; if you can't, anyone got a suggestion? But you can't simply save a .doc, .rtf, or .cwk and then add .cfg to the end.

reply to this message

#4: Re: ..

by SheeEttin on 10/22/2007 21:42, refers to #3

Pretty sure Microsoft Word can write plain text.

On Windows, I did most of my text editing in Notepad. Plain text only.
On Linux, I love Kate. So many useful features, I don't know how I ever used Notepad.

reply to this message

#5: ..

by zheddo on 10/23/2007 08:45

Doesnt really matter which program you use, as long as the .cfg suffix doesnt change :)

reply to this message

#6: Re: ..

by Quin on 10/23/2007 15:37, refers to #5

I think on behalf of all us geeks, I'd have to disagree. The format of the file is different depending on what you save it as in most cases. A Word document in binary format is totally useless to Sauer.

reply to this message

#7: Re: ..

by tentus_ on 10/23/2007 17:45, refers to #5

As Quin just said, we're sorry, but that just isn't true. Heck, it even matters which OS you're using the program in- read this wikipedia entry for some clarification:

http://en.wikipedia.org/wiki/Newline#Common_problems

As a general piece of advice to those unfamiliar with CFG files, just use Notepad until you've got a better idea of what's going on underneath the hood.

reply to this message

#8: Re: ..

by MovingTarget on 10/23/2007 18:51, refers to #7

You can convert between Windows, Mac, and UNIX text in notepad++ by going to Format->Convert to (Windows, Mac, UNIX). Right now I'm working on getting notepad++ to recognize and syntax highlight cubescript. It's pretty easy.

MovingTarget

reply to this message

#9: Re: ..

by tentus_ on 10/24/2007 04:28, refers to #8

Be sure to put that on Quadropolis once you get it finished, I'd be interested in that.

reply to this message

#10: Re: ..

by MovingTarget on 10/25/2007 00:12, refers to #9

Will do.

reply to this message

#11: GUI?

by Nivekian on 03/09/2008 18:31

Wouldn't it be batter to add a editor menu that has all available map models? I would much prefer such a tutorial... I just can't seem to find it, if it exists...

reply to this message

#12: Re: GUI?

by MovingTarget on 03/09/2008 19:52, refers to #11

You mean... ESC->Editing->Ents->mapmodels?

reply to this message

#13: Re: GUI?

by Nivekian on 03/10/2008 16:53, refers to #12

Yes. But I guess what I was thinking was a script that would read the map model folder and list ALL available models in the menu. I haven't wrote script since '88 so a lot has changed or I'd do it myself. This is something I always wished the cube/sauer engines always had. Maybe someone has a few ideas on this?

reply to this message

#14: Re: GUI?

by SheeEttin on 03/10/2008 21:42, refers to #13

On systems with find(1), you can do 'find -name "*.md[23]"' in packages/ to find all MD2s and MD3s, which can then be manipulated into a list of models...
I'm not aware of any way to do this in Cubescript.

I did something similar for skyboxen, as well; 'find -name "*_ft*" | sed "s-^\./--" | sed "s/_ft\..*$//"' in packages/ will give you a list suitable for use with listcomplete.

reply to this message

#15: ..

by N!ghtmare on 06/05/2008 13:11

great tutorial and all

so how can i use this models in game

they are not showing in the menu

how can i add them to the map?

reply to this message

#16: Re: afraid of the docs & the console

by MeatROme on 06/05/2008 14:18, refers to #15

For one thing typing "/newent mapmodel X" might just work, eh?
Another stab in the dark might've been to click on one of the first models listed in the GUI - which would show a "false" string but give the right result.

And finally:
In the new release the GUI is actually always up-to-date with whatever the current map is using.

HTH

reply to this message

#17: ..

by L. Tempris on 06/10/2008 18:12

Going back to the cfg file prob. You could take a file from another level, copy it, and rename it for your level. then type up what you want as shown:

loadsky "socksky/emerald"

fog 300
fogcolour 10000

mapmodelreset
//Default
mapmodel 4 32 0 "tree1" // 0
mapmodel 24 48 0 "dcp/tree2" // 1
mapmodel 8 32 0 "dcp/tree3" // 2
mapmodel 4 48 0 "dcp/palmtree" // 3
mapmodel 4 16 0 "dcp/thorns" // 4
mapmodel 4 8 0 "dcp/plant1" // 5
mapmodel 4 0 0 "dcp/grass" // 6
mapmodel 12 0 0 "dcp/ivy" // 7
mapmodel 4 32 0 "dcp/pillar" // 8
mapmodel 8 8 0 "dcp/waterbowl" // 9
mapmodel 0 0 0 "dcp/leafs" // 10
mapmodel 4 4 0 "dcp/mushroom" // 11
//DCP *http://cube.dietmarpier.de/*
mapmodel 3 11 0 "dcp/cask" // 12
mapmodel 3 4 0 "dcp/cart" // 13
mapmodel 1 3 0 "dcp/candle" // 14
mapmodel 1 3 0 "dcp/vase" // 15
mapmodel 2 1 0 "dcp/sack" // 16
mapmodel 2 5 0 "dcp/chandelier" // 17
mapmodel 2 3 0 "dcp/chest" // 18
mapmodel 1 5 0 "dcp/firebowl" // 19
mapmodel 1 0 0 "dcp/smplant" // 20
mapmodel 1 0 0 "dcp/reed" // 21
//Nieb, makkE & Kurtis
mapmodel 1 12 0 "objects/window01" // 22
mapmodel 0 0 0 "objects/sign01" // 23
mapmodel 0 0 0 "objects/lamp01" // 24
mapmodel 2 6 0 "objects/chair01" // 25
mapmodel 0 0 0 "objects/bed01" // 26
mapmodel 4 64 0 "vegetation/tree00" // 27
mapmodel 4 64 0 "vegetation/tree01" // 28
mapmodel 0 0 0 "vegetation/bush01" // 29
mapmodel 4 64 0 "vegetation/tree02" // 30
mapmodel 4 64 0 "vegetation/tree03" // 31
mapmodel 10 0 0 "objects/window02" // 32
mapmodel 10 0 0 "objects/window03" // 32
mapmodel 4 64 0 "vegetation/tree04" // 31
mapmodel 4 64 0 "vegetation/tree05" // 32
mapmodel 4 64 0 "vegetation/tree06" // 33
mapmodel 0 64 0 "vegetation/tree07" // 34
mapmodel 10 8 0 "objects/bench01" // 35
mapmodel 1 20 0 "objects/lantern01" // 36
mapmodel 0 0 0 "objects/lantern02" // 37
mapmodel 2 3 0 "objects/woodchop" // 38
mapmodel 10 40 0 "objects/table01" // 39
mapmodel 0 0 0 "objects/torch" // 40
mapmodel 0 0 0 "objects/torch_cold" // 41
mapmodel 4 50 0 "objects/fire" // 42

texturereset
texture 0 "ik2k/ik_sky_day_back.jpg"
texture 0 "golgotha/water2d.jpg"
texture 0 "aard/aardograss_1.jpg"
texture 0 "dg/mad064.jpg"
texture 0 "dg/mad065.jpg"
texture 0 "dg/mad065.jpg"
texture 0 "dg/mad067.jpg"
texture 0 "dg/mur013.jpg"
texture 0 "dg/floor_grass1.jpg"
texture 0 "dg/floor_grass3&soil.jpg"
texture 0 "dg/floor_pavement_stone4_2.jpg"
texture 0 "dg/floor_pavement_stone4_3.jpg"
texture 0 "dg/floor_pavement_stone4_4moss.jpg"
texture 0 "dg/floor_pavement_stone5_2.jpg"
texture 0 "dg/floor_pavement_stone_four2.jpg"
texture 0 "dg/floor_pavingStone.jpg"
texture 0 "dg/floor_pavingStone_ceramic.jpg"
texture 0 "dg/floor_paving_littleStones3.jpg"
texture 0 "dg/floor_paving_littleStones3_2.jpg"
texture 0 "dg/floor_paving_littleStones3.jpg"
texture 0 "dg/floor_soil&grave3.jpg"
texture 0 "dg/floor_tile_ceramicBlue.jpg"
texture 0 "dg/mur049.jpg"
texture 0 "dg/mad065.jpg"
texture 0 "dg/mad065.jpg"
texture 0 "dg/mad063.jpg"
texture 0 "dg/mur060.jpg"
texture 0 "dg/mur073.jpg"
texture 0 "dg/mur078.jpg"
texture 0 "dg/mur067.jpg"
texture 0 "dg/mur142.jpg"
texture 0 "dg/muv158.jpg"
texture 0 "dg/muv185.jpg"
texture 0 "dg/muv204.jpg"
texture 0 "dg/sue011.jpg"
texture 0 "textures/rock01.jpg"
texture 0 "dg/sup079.jpg"
texture 0 "dg/mur013.jpg"
texture 0 "dg/mur017.jpg"
texture 0 "dg/mur039.jpg"
texture 0 "dg/mur043.jpg"
texture 0 "dg/mur045.jpg"
texture 0 "dg/mur049.jpg"
texture 0 "dg/mur051.jpg"
texture 0 "dg/mur058.jpg"
texture 0 "dg/mur060.jpg"
texture 0 "dg/mur067.jpg"
texture 0 "dg/mur064.jpg"
texture 0 "dg/mur067.jpg"
texture 0 "dg/mur067.jpg"
texture 0 "dg/mur080.jpg"
texture 0 "dg/mur081.jpg"
texture 0 "dg/mur081.jpg"
texture 0 "dg/nie049.jpg"
texture 0 "dg/mur088.jpg"
texture 0 "dg/mur109.jpg"
texture 0 "dg/mur127.jpg"
texture 0 "dg/mur135.jpg"
texture 0 "dg/mur139.jpg"
texture 0 "payne/Box12b.jpg"
texture 0 "payne/Brick52a.jpg"
texture 0 "payne/Brick58_512x512.jpg"
texture 0 "dg/mad065.jpg" 1
texture 0 "dg/muv030.jpg"
texture 0 "dg/muv032.jpg"
texture 0 "dg/mur000.jpg"
texture 0 "dg/mur054.jpg"
texture 0 "dg/mad051.jpg"
texture 0 "dg/muv025.jpg"
texture 0 "dg/f_p2_v.jpg"
texture 0 "dg/mot001.jpg"
//dg
texture 0 "dg/trail.jpg"
texture 0 "dg/trail_lg.jpg"
texture 0 "dg/trail_lg.jpg" 1
texture 0 "dg/trail_lg.jpg" 2
texture 0 "dg/trail_lg.jpg" 3
texture 0 "dg/trail_sm.jpg"
texture 0 "dg/trail_sm.jpg" 1
texture 0 "dg/trail_cl.jpg"
texture 0 "dg/trail_cl.jpg" 1
texture 0 "dg/trail_cl.jpg" 2
texture 0 "dg/trail_cl.jpg" 3
texture 0 "dg/trail_cs.jpg"
texture 0 "dg/trail_cs.jpg" 1
texture 0 "dg/trail_cs.jpg" 2
texture 0 "dg/trail_cs.jpg" 3
texture 0 "dg/trail_in.jpg"
texture 0 "dg/trail_in.jpg" 1
texture 0 "dg/trail_in.jpg" 2
texture 0 "dg/trail_in.jpg" 3
//sign skins: by Makke
texture 0 "models/objects/sign01/skin_inn.jpg"
texture 0 "models/objects/sign01/skin_pub.jpg"
//dg cont.
texture 0 "dg/mot067.jpg"
texture 0 "dg/mot088.jpg"
texture 0 "dg/mot190.jpg"
texture 0 "dg/mur033.jpg"
texture 0 "dg/mot067_2.jpg"
texture 0 "dg/mot067_2.jpg" 1
texture 0 "dg/mot067_2.jpg" 2
texture 0 "dg/mot067_2.jpg" 3
texture 0 "dg/nie048.jpg"

-Jungle map cfg file...

use notepad to do this.

reply to this message

#18: ..

by N!ghtmare on 06/10/2008 18:56

mapmodel 4 32 0 "tree1" // 0


what do numbers 4 32 9 mean?

reply to this message

#19: Re: ..

by SheeEttin on 06/10/2008 21:10, refers to #18

http://sauerbraten.org/docs/editref.html#mapmodel

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53862970 visitors requested 71638078 pages
page created in 0.015 seconds using 10 queries
hosted by Boost Digital