Page 1 of 2

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

Posted: Fri Oct 28, 2016 10:24 am
by Painkiller
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

Re: [HL2DM] Remove Map Overlays

Posted: Fri Oct 28, 2016 10:55 am
by L'In20Cible

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()

Re: [HL2DM] Remove Map Overlays

Posted: Fri Oct 28, 2016 11:14 am
by Painkiller
You have invite game_text what is the command for overlay?

r_screenoverlay?

Re: [HL2DM] Remove Map Overlays

Posted: Fri Oct 28, 2016 11:45 am
by L'In20Cible

Re: [HL2DM] Remove Map Overlays

Posted: Fri Oct 28, 2016 12:51 pm
by Painkiller
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 ?

Re: [HL2DM] Remove Map Overlays

Posted: Fri Oct 28, 2016 1:04 pm
by L'In20Cible
This remove only those created by the map.

Re: [HL2DM] Remove Map Overlays

Posted: Fri Oct 28, 2016 1:38 pm
by Painkiller
So i have test it.
This work not for me.


Image

Image

Re: [HL2DM] Remove Map Overlays

Posted: Fri Oct 28, 2016 1:52 pm
by iPlayer
Try removing point_clientcommand

Re: [HL2DM] Remove Map Overlays

Posted: Sat Oct 29, 2016 11:47 am
by Painkiller
Sry not work.

Is there still another solution for the problem?

Re: [HL2DM] Remove Map Overlays

Posted: Mon Oct 31, 2016 8:08 pm
by Ayuto
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.

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 1:23 am
by iPlayer
I should've mentioned this, but I decompiled the map and the entity to create the overlay was indeed env_screenoverlay

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 7:37 am
by L'In20Cible
What is the map in question?

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 10:56 am
by iPlayer
dm_stalker_pripyat_aw_kb
FastDL

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 1:20 pm
by L'In20Cible
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()

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 3:00 pm
by iPlayer
Why not check hammerid instead? Is index in this case guaranteed to be the same?

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 3:24 pm
by L'In20Cible
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.

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 3:30 pm
by Painkiller
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.

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 3:32 pm
by L'In20Cible
Painkiller wrote:Hello, that does not work.
You are doing something wrong. I tested it and it work just fine.

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 3:37 pm
by iPlayer
And I have there are several maps that have exactly the same.


Well, you'll have to have individual approach for each map.

Re: [HL2DM] Remove Map Overlays

Posted: Tue Nov 01, 2016 3:47 pm
by L'In20Cible
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