Raised This Month: $9 Target: $400
 2% 

Solved How to replace the entire map entity text?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 07-27-2021 , 17:25   How to replace the entire map entity text?
Reply With Quote #1

A long time ago I remember finding a plugin that read entities from a file and did a total replace of the map entities with the ones in the file.
I can't find that plug in now.
Does anyone remember this?

If not can you give me some direction on what to do in a plug in to do the entity replace?
I have written a lot of plugins in but don't have any idea how to do the entity replace on map load.

Last edited by Austin; 09-13-2021 at 04:31.
Austin is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-27-2021 , 18:18   Re: How to replace the entire map entity text?
Reply With Quote #2

Maybe you are looking for the "Stripper" extension.

Check here: https://forums.alliedmods.net/showthread.php?t=39439
__________________
Marttt is offline
Austin
Senior Member
Join Date: Oct 2005
Old 07-27-2021 , 19:10   Re: How to replace the entire map entity text?
Reply With Quote #3

It was a sourcemod plugin not a metamod plugin / stripper.

It was a proof of concept Sourcemod plugin in that did an entire replace of the map entity text.

Last edited by Austin; 07-27-2021 at 19:10.
Austin is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-30-2021 , 05:47   Re: How to replace the entire map entity text?
Reply With Quote #4

The ability to modify the entity lump text has been removed from SM 1.11 as it could cause crashes.
__________________
asherkin is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 07-30-2021 , 07:06   Re: How to replace the entire map entity text?
Reply With Quote #5

Quote:
Originally Posted by asherkin View Post
The ability to modify the entity lump text has been removed from SM 1.11 as it could cause crashes.
I'm changing entities in OnLevelInit and I'm not having any problem on 70 maps, but these maps have lower size in entity lump than that 2mb limit.
I also use the OnLevelInit to get entity outputs.

I'm hoping we'll have a stable function where we can manipulate entity lumps when 1.11 becomes stable.

Quote:
Originally Posted by Austin View Post
It was a sourcemod plugin not a metamod plugin / stripper.

It was a proof of concept Sourcemod plugin in that did an entire replace of the map entity text.
The plugin you are looking for might be this: https://github.com/nosoop/SM-LevelKeyValues
__________________

Last edited by Ilusion9; 07-30-2021 at 07:07.
Ilusion9 is offline
Austin
Senior Member
Join Date: Oct 2005
Old 07-30-2021 , 08: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 08:31.
Austin is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 07-30-2021 , 09:47   Re: How to replace the entire map entity text?
Reply With Quote #7

https://github.com/Ilusion9/mapentites-sm

You have some examples in configs/mapentities
__________________
Ilusion9 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-30-2021 , 10:41   Re: How to replace the entire map entity text?
Reply With Quote #8

Quote:
Originally Posted by Austin View Post
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.
Stripper:Source should be working fine in CS:GO, a lot of people are using it and there have been no issues filed. Make sure you're using an up to date snapshot build.
__________________
asherkin is offline
Austin
Senior Member
Join Date: Oct 2005
Old 07-30-2021 , 17:45   Re: How to replace the entire map entity text?
Reply With Quote #9

The latest of everything is definitely not working for me on CSGO.
CSGO DS + MM + Stripper

I been with this for a long time so I know everything I am doing is correct.

1) I installed a clean from scratch CSGO DS with all updates
2) I set the configs for classic casual with bots
3) I installed correctly
mmsource-1.11.0-git1145-windows.zip
stripper-1.2.2-git129-windows.zip
sourcemod-1.10.0-git6510-windows.zip

And they are running.

meta list
Listing 5 plugins:
[01] SourceMod (1.10.0.6510) by AlliedModders LLC
[02] Stripper (1.2.2) by BAILOPAN
[03] CS Tools (1.10.0.6510) by AlliedModders LLC
[04] SDK Tools (1.10.0.6510) by AlliedModders LLC
[05] SDK Hooks (1.10.0.6510) by AlliedModders LLC

4) I am using my MapHack plugins that generates the stripper files, but it has been working fine for years.
https://forums.alliedmods.net/showth...hlight=maphack

but to be sure I 2x checked the stripper add: that it generates and the stripper .cfg file is correct and I 2x the cords with a getpos and all looks (and has been for years) correct.

This config is for de_dust2 at the ts spawn area and after a map load there is no ak47.

Standing at the ts spawn area de_dust2
getpos
setpos -645.861328 -836.457336 180.388412;setang 9.404992 90.720322 0.000000

de_dust2.cfg
add:
{
"origin" "-645.8 -836.4 116.3"
"angles" "0.0 90.7 0.0"
"ammo" "90"
"classname" "weapon_ak47"
}

One other person DarenArk in the Stripper topic area mentioned the latest MM+Stripper doesn’t work.

(On a side note: The topic of his post is how confusing the Stripper download page is and he has a 100% valid point.
Any end user would be TOTALLY confused to what version to DL looking at the stripper snapshot DL page.)

But he adds at the end of the post

“stripper-1.2.2 doesn't work! together with
Metamod: Source version 1.11.0-dev + 1144”

https://forums.alliedmods.net/showth...39439&page=178

Not sure what he means with 1144 but again the latest of everything stopped working at least for add:
I don’t know when it stopped because I was away from CSGO for months and just got back.

Stripper is right now working fine on a L4D2 server.

Last edited by Austin; 07-30-2021 at 18:19.
Austin is offline
Austin
Senior Member
Join Date: Oct 2005
Old 08-03-2021 , 17:18   Re: How to replace the entire map entity text?
Reply With Quote #10

The latest CSGO+Stripper is broken with add: classnames of weapon_*

The following dust.cfg adds the hostage but nothing else.
PHP Code:
;Example adding a hostage in the T spawn
add
:
{
"origin" "1376 3168 -112"
"HostageType" "0"
"angles" "0 111 0"
"classname" "hostage_entity"
}
{
"origin" "1376 3168 -112"
"angles" "0 111 0"
"classname" "weapon_aug"
}
{
"origin" "1376 3168 -112"
"angles" "0 111 0"
"classname" "weapon_hegrenade"
}
{
"origin" "1376 3168 -112"
"angles" "0 111 0"
"classname" "weapon_deagle"
}
{
"origin" "1376 3168 -112"
"angles" "0 111 0"
"classname" "weapon_mac10"
}
{
"origin" "1376 3168 -112"
"angles" "0 111 0"
"classname" "weapon_m249"
}
{
"origin" "1376 3168 -112"
"angles" "0 111 0"
"classname" "weapon_m4a1_silencer"
}
{
"origin" "1376 3168 -112"
"angles" "0 111 0"
"classname" "weapon_aug"
}
{
"origin" "1376 3168 -112"
"angles" "0 111 0"
"classname" "ammo_556mm_box"


The add of weapon_ class names broke on a CSGO update somewhere in the ~last two weeks

Last edited by Austin; 08-03-2021 at 17:28.
Austin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:12.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode