Garry's Mod

Garry's Mod

107 ratings
Momo's Map Manipulation Tool
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Roleplay
File Size
Posted
Updated
232.911 KB
Feb 11, 2020 @ 11:56am
May 18, 2020 @ 1:56am
32 Change Notes ( view )

Subscribe to download
Momo's Map Manipulation Tool

In 2 collections by Alban CHAMPIGNON [GiletJaune]
Soccer by Mohamed RACHID
37 items
.bsp editing helpers
10 items
Description
Momo's .bsp editor written in Lua
This tool is designed to modify & protect maps without the need to decompile them.
It supports almost all Source maps, including Garry's Mod, Half-Life 2: Deathmatch, Team Fortress 2 (compressed maps supported), Counter-Strike: Source, Counter-Strike: GO, Left 4 Dead 2. Other games including Dota 2 should have at least minimalistic support.
This add-on is currently usable. It is not finished, it may somehow seem like a draft and it contains bugs. Saving the modified map is planned to be asynchronous, but for now, it hangs the game until the end.
The Remove many entities & put them into a Lua file button, meant to protect a map, needs help from map architects. Some entity classes are probably safe to move into Lua, but others will not work: filtering them out is complicated without your help.
Please check out What can I do with Momo's Map Manipulation Tool?!

Source code[github.com]

Current bugs
Here is the list

Usage
In console, type the console command as one of the following:
- map_manipulation_tool gm_construct - map_manipulation_tool "maps/gm_construct.bsp"

Discord
Become a helper and bring your assistance to the developer and other helpers! Join us on the French-speaking community Game Creators Area[discord.gg] where we have a dedicated channel for this tool.

Vocabulary
  • Lump: constituent element of the map file. There always are 64 lumps + a variable number of game lumps in the LUMP_GAME_LUMP. A lump can be of zero-length (which I call a null-lump), meaning that it is not included (technically it has no payload).
  • Pak file: uncompressed ZIP file holding content files embedded in the map.

Notes
  • Please read console messages when working with this tool. They contain messages to help you and me produce better maps and figure out bugs & unexpected behaviors.
  • Many generated files have their extension suffixed with .dat or .txt. You need to remove this suffix in order to use the files.
  • Generated files are always saved somewhere in garrysmod/data/. Generated map files and Lua scripts must be moved into the appropriate folder.
  • Avoid re-editing modified maps: if an edited lump is smaller than the previous one, it will fit and overwrite the latter. But otherwise it will be located at the end of the file, wasting a whole lot of disk space, because freed space cannot be reused and there is no defragmentation! Be aware that Previous (aka. version n - 1) is not Original (aka. version 1).
  • Originally posted by About cubemaps and other embedded content:
    When you change the map file name, a few folders in the ZIP file in LUMP_PAKFILE need to be renamed according to the .bsp name. This does not only affect this tool.
  • If the game crashes early during the map loading process, then the map is probably corrupted.
  • If the game crashes near the end of the map loading process with entities moved into Lua, then you probably have entities that should be excluded from Lua. Please open the .mdmp crash dump file in a text editor that accepts binary files (such as Windows' Notepad or Notepad++) and browse it to the section -Lua Stack Traces- -> Server. If you see a Lua stack trace then check which entity has caused a crash by browsing the mentioned Lua script. Please report such entities in the comment section below!
  • Under investigation: do not mix compressed lumps in a map with mostly uncompressed lumps, and vice-versa: the game may crash.
  • The API is not documented separately from the code.

The button Remove many entities & put them into a Lua file
This is the magic button that pulls away as many entities in the LUMP_ENTITIES as it reasonably can and transfers them into a Lua file that you should keep on your server very privately!
Read about the associated hooks to gain some control about the process!

Recommended

System requirements
  • Operating system: Garry's Mod
  • Display adapter: EGA 640x350 with 16 colors
  • Random Access Memory: DRAM 8 GiB, preferably EDO
  • Central Processing Unit: Intel Pentium Pro 133 MHz or equivalent with enabled Physical Address Extension
  • Sound adapter: Internal speaker recommended (unused by this tool)
Popular Discussions View All (3)
6
Jun 22, 2023 @ 11:33am
PINNED: What can I do with Momo's Map Manipulation Tool?
Alban CHAMPIGNON [GiletJaune]
45 Comments
Alban CHAMPIGNON [GiletJaune]  [author] Jul 6, 2023 @ 1:51pm 
Huh. Okay well, I don't know how to make the job easy.
In the LUMP_ENTITIES you normally find light entities, which are mostly "light" entities, maybe "light_dynamic" if they are linked to a switch, along with other light entity classes I can't remember.
So you can extract the LUMP_ENTITIES as text, edit it, and import it back. Then you save the modified map.
After this, you can run vrad on your modified map file and the lights should be altered. Maybe you need to run vvis prior to vrad, but I don't think so.
[Chill] Dark Aloibou Jul 5, 2023 @ 7:26am 
Hello, how can i delete all indoor light of a map (NY city)
Alban CHAMPIGNON [GiletJaune]  [author] Jun 22, 2023 @ 11:28am 
Possibility 1: I think I did not implement it. I don't remember so far. 😂
Possibility 2: You need to start a game using the map that you opened in the tool.
Synorem Jun 1, 2023 @ 3:09pm 
Entity editing mode is disabled for me. Why is this?
clone124642 Feb 18, 2023 @ 4:06pm 
nice
Alban CHAMPIGNON [GiletJaune]  [author] Feb 18, 2023 @ 4:05pm 
If you want to open whatever file anywhere in Garry's Mod, you need to have it located in the Garry's Mod folder. The only exception is about mounted Workshop add-ons and mounted games.
clone124642 Feb 18, 2023 @ 6:00am 
so is it possible to edit maps witch don't show up on my addons or maps list?
Alban CHAMPIGNON [GiletJaune]  [author] Dec 28, 2022 @ 1:35pm 
Tu m'étonnes ! 😋❤
Famoso Dec 6, 2022 @ 4:24am 
t'es un bon momo wlh
Alban CHAMPIGNON [GiletJaune]  [author] Mar 4, 2022 @ 12:04pm 
Well, I explored this possibility, but I could not find a way to do it with my current knowledge, unfortunately.