[HL2DM] Remove Map Overlays, Map game_ext and Map Music

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

[HL2DM] Remove Map Overlays, Map game_ext and Map Music

Postby Painkiller » Fri Oct 28, 2016 10:24 am

Hi can anybody wrote a script for remove map overlays?

The Similar this plugin: https://forums.alliedmods.net/showthread.php?p=892142

but for overlays in bsp file.

Thanks in Advance

Painkiller
Last edited by Painkiller on Wed Jan 26, 2022 1:09 pm, edited 1 time in total.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2DM] Remove Map Overlays

Postby L'In20Cible » Fri Oct 28, 2016 10:55 am

Syntax: Select all

from entities import BaseEntityGenerator
from entities.entity import BaseEntity
from entities.helpers import baseentity_from_edict
from listeners import OnEntityCreated
from listeners import OnServerActivate
from memory import get_object_pointer
from memory import make_object

_marked_for_deletion = set()

@OnServerActivate
def on_server_activate(edicts, edict_count, max_clients):
_marked_for_deletion.clear()
for edict in edicts:
if edict.classname != 'game_text':
continue
_marked_for_deletion.add(
get_object_pointer(edict.server_unknown).address)

@OnEntityCreated
def on_entity_created(base_entity):
ptr = get_object_pointer(base_entity).address
if ptr not in _marked_for_deletion:
return
_marked_for_deletion.remove(ptr)
base_entity.remove()
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2DM] Remove Map Overlays

Postby Painkiller » Fri Oct 28, 2016 11:14 am

You have invite game_text what is the command for overlay?

r_screenoverlay?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2DM] Remove Map Overlays

Postby L'In20Cible » Fri Oct 28, 2016 11:45 am

User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2DM] Remove Map Overlays

Postby Painkiller » Fri Oct 28, 2016 12:51 pm

I have

Code: Select all

if edict.classname != 'game_text':
replace to
if edict.classname != 'env_screenoverlay':


It is still displayed



Is this plugin only for map.bsp overlays
or remove this my kill overlays ?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2DM] Remove Map Overlays

Postby L'In20Cible » Fri Oct 28, 2016 1:04 pm

This remove only those created by the map.
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2DM] Remove Map Overlays

Postby Painkiller » Fri Oct 28, 2016 1:38 pm

So i have test it.
This work not for me.


Image

Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: [HL2DM] Remove Map Overlays

Postby iPlayer » Fri Oct 28, 2016 1:52 pm

Try removing point_clientcommand
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2DM] Remove Map Overlays

Postby Painkiller » Sat Oct 29, 2016 11:47 am

Sry not work.

Is there still another solution for the problem?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [HL2DM] Remove Map Overlays

Postby Ayuto » Mon Oct 31, 2016 8:08 pm

Start your client, create a new game on that map and enter the following commands in your console:

Code: Select all

sv_cheats 1
developer 1
ent_text *
This should create debug overlays for all entities. Then go to the overlays, make a screenshot and post it here. If you have done that, we will know which entities we need to delete.
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: [HL2DM] Remove Map Overlays

Postby iPlayer » Tue Nov 01, 2016 1:23 am

I should've mentioned this, but I decompiled the map and the entity to create the overlay was indeed env_screenoverlay
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2DM] Remove Map Overlays

Postby L'In20Cible » Tue Nov 01, 2016 7:37 am

What is the map in question?
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: [HL2DM] Remove Map Overlays

Postby iPlayer » Tue Nov 01, 2016 10:56 am

dm_stalker_pripyat_aw_kb
FastDL
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2DM] Remove Map Overlays

Postby L'In20Cible » Tue Nov 01, 2016 1:20 pm

Okay, I tested and it seems that on HL2:DM, OnServerActivate is called AFTER the entities has been created so the entity is never marked for deletion. Since this is for a single map, and that we know the index, I guess we can safely do the following:

Syntax: Select all

from engines.server import global_vars
from listeners import OnEntityCreated

# Index of the env_screenoverlay to remove...
INDEX = 23

@OnEntityCreated
def on_entity_created(base_entity):
if global_vars.map_name != 'dm_stalker_pripyat_aw_kb':
return

if base_entity.classname != 'env_screenoverlay':
return

if base_entity.index != INDEX:
return

base_entity.remove()
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: [HL2DM] Remove Map Overlays

Postby iPlayer » Tue Nov 01, 2016 3:00 pm

Why not check hammerid instead? Is index in this case guaranteed to be the same?
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2DM] Remove Map Overlays

Postby L'In20Cible » Tue Nov 01, 2016 3:24 pm

iPlayer wrote:Why not check hammerid instead?

Because this listener is called when it is allocated and added to the global list while a lot of stuff is done/linked in the post constructor. Which is the main reason why we manually link m_pNetworkable on the edict_t instance before calling the registered callbacks otherwise our conversion functions are raising due to unlinked instances they need. In short, trying to get hammerid at this stage will simply return 0 (or -1).

iPlayer wrote:Is index in this case guaranteed to be the same?
Yes, it should always use the same index when the map is loading.
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2DM] Remove Map Overlays

Postby Painkiller » Tue Nov 01, 2016 3:30 pm

L'In20Cible wrote:Okay, I tested and it seems that on HL2:DM, OnServerActivate is called AFTER the entities has been created so the entity is never marked for deletion. Since this is for a single map, and that we know the index, I guess we can safely do the following:

Syntax: Select all

from engines.server import global_vars
from listeners import OnEntityCreated

# Index of the env_screenoverlay to remove...
INDEX = 23

@OnEntityCreated
def on_entity_created(base_entity):
if global_vars.map_name != 'dm_stalker_pripyat_aw_kb':
return

if base_entity.classname != 'env_screenoverlay':
return

if base_entity.index != INDEX:
return

base_entity.remove()


Hello, that does not work.
And I have there are several maps that have exactly the same.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2DM] Remove Map Overlays

Postby L'In20Cible » Tue Nov 01, 2016 3:32 pm

Painkiller wrote:Hello, that does not work.
You are doing something wrong. I tested it and it work just fine.
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: [HL2DM] Remove Map Overlays

Postby iPlayer » Tue Nov 01, 2016 3:37 pm

And I have there are several maps that have exactly the same.


Well, you'll have to have individual approach for each map.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2DM] Remove Map Overlays

Postby L'In20Cible » Tue Nov 01, 2016 3:47 pm

At this point, I think you want to remove them all no matter what:

Syntax: Select all

from listeners import OnEntityCreated

@OnEntityCreated
def on_entity_created(base_entity):
if base_entity.classname != 'env_screenoverlay':
return

base_entity.remove()


Since you seem to have trouble installing the codes, please read the following article: http://wiki.sourcepython.com/developing ... rst-plugin

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 15 guests