[project1dev] map editor details

  • From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
  • To: project1dev@xxxxxxxxxxxxx
  • Date: Wed, 6 May 2009 21:31:42 -0700

Hopefully i didn't forget anything!

===================================
Basics of the map editor
===================================

Ok so basically, the geometry part of a map will live in a different script
file than the scripts of a map.

Cavemap is setup this way right now, ie there's cavemap.lua which has all
the enemies and scripts in it, and then there's cavemap_geometry.lua which
has all the geometry.

The cavemap_geometry.lua file is the one that gets edited by the map editor.

if you put any script stuff in the geometry file then re-save it in the
editor, all that stuff will be lost.

But, if you go in and edit some stuff by hand (such as the position or
rotation or scale of models) if you load it in the editor and resave it,
your changes will still be there.

Kinda confusing but basically when you load, the map editor it runs all the
scripts to load the map.  When you save, it only writes out the scripts
needed to build the geometry, so everything else gets lost.

===================================
Getting into the map editor
===================================

To create a new map in the map editor, press ~ to bring up the console and
type "new".  That will bring you into the editor with a blank map.

To edit an existing map, use the edit command in the console.  For example
to edit the cavemap, type "edit maps/cavemap_geometry.lua" into the console.

You can optionally leave off the file extension "edit
maps/cavemap_geometry".

when you want to leave the map editor, type "load" in the console to load
index.lua (or you can view your work by typing "load maps/cavemap.lua"), or
you can just click the X to close the program.

To save your work before leaving the editor you can type "save" in the
console and it will save as the same file name as you loaded.

If you used "new" to create a new file you have to give a filename.  If you
didn't use the "new" command you can still give a filename to do a save as.

For example

To save your current map
save

To save as another filename
save maps/blah.lua

===================================
Placing models
===================================

To place a new model, pop open the console and use the "place" command.

To place a wooden crate for example type this into the console "place
alanmap/woodencrate.ms3d".  Just like the other places, file extension is
optional.

After using the place command, a semi transparent model will be stuck to
your cursor.  Left click with the mouse button to place the model.

You can also use the "clone" command to copy an existing model.  Click a
model to select it, then type clone in the console.

You can also delete a model by clicking on it to select it and then pressing
the delete key.

===================================
Changing the camera
===================================

To change the camera, hold the right mouse button down and then you can
change your view with the mouse, and use the WASD or arrow keys to fly
around.

===================================
Manipulating models
===================================

To change a model's position, rotation or scale, click on it to select it.

If you click and drag a model, you'll move it alone it's X/Y plane.  If you
hold down control, you'll be able to move it up and down.

For finer controls, there are arrows shown for each axis when a model is
selected.

You can click on an arrow and drag to move a model along that axis.

Press tab to cycle between positioning a model, rotating a model, and
scaling a model.

===================================
Bugs / future features / etc
===================================

I know there are some bugs, and we are missing some features like snap to,
and some things need improvements (like there's no way to uniformly scale a
model).

I'm going to be upgrading it over the next couple days to get it to a
cleaner and better version.

However, if you find bugs or have ideas for improvements or questions, let
me know so i can make it easier and better for all of us (:

Other related posts: