Saving/exporting the current map

Saving/exporting the current map

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Saving/exporting the current map

Post by gajop »

In the process of creating an in-game scenario editor, I thought having a map* editor would be cool. It would allow people to create whole scenarios with one tool - assuming dependence on the actual mod. I've created some simple terrain editing actions and it looks good so far, but before digging myself too far in...

Without knowing much about what "maps" are except for being those neat little files in the maps folder, is it currently possible to save/export the currently modified map in a easy & efficient way as it would be by editing it in 3rd party tools?

If not, and I assume no, would it be possible? Are there any restrictions on creating an in-game editor for maps, as far as the map modifications go? I assume there may be stuff like no ability to change the map size, textures, etc, but keep in mind I'm ok with it if I can do that with a spring restart (and therefor map reload).
Most importantly, what should I start reading in order to implement a proper save?

*I'm mostly interested in having a terrain editor, i.e. currently the main thing would be to save the features, height map, texture map, and whatever else comes into play for the terrain & display properties of the map. Dynamic map such as those maps with lava/flood elements are out of the scope of the current aim.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Saving/exporting the current map

Post by Beherith »

I recommend tou look at zwzsg's savegame mutator, and quantum's mission editor for starters.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: Saving/exporting the current map

Post by BrainDamage »

username made an heightmap exporter a while ago, the format ppm is weird but it works ( afaik the others don't ) , since i cba to dig for the thread, here's the widget:

( remember to create the destination folder or it'll complain )

i did in fact toyed myself a bit with an ingame map editor experiment, it's rather crappy, using old terraform code from CA, nowdays it doesn't even run in spring, i'll attach here if you want to check
Attachments
mapedit.zip
(283.14 KiB) Downloaded 35 times
cmd_heightmapexporter.lua
(11.79 KiB) Downloaded 135 times
Post Reply

Return to “Lua Scripts”