View Single Post
Austin
Senior Member
Join Date: Oct 2005
Old 07-30-2021 , 07:14   Re: How to replace the entire map entity text?
Reply With Quote #6

Yes, I found this late last night. Thanks.
https://github.com/alliedmodders/sou...ull/1534/files
And other interesting discussions....
https://github.com/nosoop/SM-LevelKe.../entitylumpext

What I need and many others need is a stable way to manipulate the entities.
Stripper was great for all these years (I started using it with botmans version around 2002)
but it keeps breaking and it is currently broken for CSGO and I/we don't know if it will be fixed or when.

Back then I was also using ripent from zoners hl tools to totally replace the ent lump with an edited version.
This method works great but it is modifying the bsp.

I fixed some bugs in ripent (it had a fixed memory allocation for the ent lump that was too small for some maps) and I also created a C++ application that had a decient gui interface to modify the lump in the bsp.

It is still being downloaded and I guess used for HL/CS/CZ with over 7K downloads.
The C++ MFC source code and project file is included in the DL.
I did a port of this to Source but only for reading the BSP and never published it.
It would only take about a day to add writing a source BSP but again I don't want to modify maps or even encourage it.

http://filebase.bots-united.com/inde...ct=view&id=177

What I think would be a great solution would be to create a much simpler version of stripper that just reads a text file and does a simple total replace of the ent lump.
I describe my idea here:
https://forums.alliedmods.net/showth...39439&page=178
You dump the entire lump ent text, modify it, and then all the "new" version of stripper would do is a simple total replace of the ent lump from the file.

Really having this ability in a Sourcemod plugin would be #1 best.
Give us a way to
1) get the complete ent lump as the raw text.
We can then modify it any way we want or
2) best yet just replace it totally with text from a file.

This is soo much simpler for the devs and the users than the match and replace of stripper.
You hack something out of the ent lump it is gone first try no hit and miss matching,
and same for changes and additions.

I could do the dev work to create this new version of Stripper but haven't had time to do the research on how to set up a MM dev environment to do the build of the existing Stripper to start with. Any link to the best place for info on how to get a MM Stripper build environment set up?

Ilusion9
Do you have a small example of how you are using OnLevelInit to modifly the ents?
I haven't tried creating a test plugin yet but to do a total simple swap of the ent lump would it be something like this?

PHP Code:
public Action OnLevelInit(const char[] mapNamechar mapEntities[2097152]) 
{
    
// use the existing buffer and overwite it with the ents from a ent (text) file in the maps folder!
    
ReadMapEnts(mapEntities,"mapName.ent");    

    return 
Plugin_Changed;

mapName.ent would be a text file of the ents, created initially from a stripper_dump then modified.

Thanks for all the great work everyone.

Last edited by Austin; 07-30-2021 at 07:31.
Austin is offline