Raised This Month: $51 Target: $400
 12% 

Solved Items are glow


Post New Thread Reply   
 
Thread Tools Display Modes
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 05-31-2017 , 06:39   Re: [L4D2]Items are glow
Reply With Quote #11

Quote:
Originally Posted by Visual77 View Post
This is really weird but AcceptEntityInput(entity, "kill"); will work, killing the weapon_pipe_bomb_spawn entity and its glow while still giving the weapon_pipe_bomb to the client.

Code:
HookEvent("spawner_give_item", Event_GrabbedItem);

public Action Event_GrabbedItem(Event event, const char[] name, bool dontBroadcast)
{
	if (cvarIsEnabled.IntValue != 1) return;
	
	int entity = event.GetInt("spawner");
	if (entity <= 0 || entity >= 2048 || !IsValidEntity(entity)) return;
	
	char item[32];
	GetEdictClassname(entity, item, sizeof(item));	

	if (StrEqual(item, "weapon_pipe_bomb_spawn", false) || StrEqual(item, "weapon_molotov_spawn", false))
	{
		DeleteGlow(entity, cvarGlowColor_throwables);	
	}
}

stock void DeleteGlow(int entity, ConVar cvar)
{
	if (GetEntProp(entity, Prop_Send, "m_iGlowType") > 0 
	&& GetEntProp(entity, Prop_Send, "m_glowColorOverride") == GetColor(cvar))
	{
		PrintToChatAll("Deleting glow on entity %d", entity);

		SetEntProp(entity, Prop_Send, "m_iGlowType", 0);
		SetEntProp(entity, Prop_Send, "m_nGlowRange", 0);
		SetEntProp(entity, Prop_Send, "m_glowColorOverride", 0);

		AcceptEntityInput(entity, "kill"); 
	}
}
That's because the entity is still there because it's a spawner, non spawners like weapon_pistol you won't need to remove the glow.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 05-31-2017 , 07:38   Re: [L4D2]Items are glow
Reply With Quote #12

Is it still fine to delete the spawner though? I guess that means no new pipe bomb can reappear on that spot, at least not until the next round starts.

Now I need to find a way to readd the glow back on a dropped entity. The weapon_drop event seems like the best place to do that, but all the checks against weapon types, color settings etc, will be a bitch.
Visual77 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-31-2017 , 08:41   Re: [L4D2]Items are glow
Reply With Quote #13

Use SDKHooks, OnEntityCreated, some plugin somewhere will have all this for weapons already. Add the glow in this function and you don't need it elsewhere. Glow staying bug, hmm... from my Extinguisher plugin:

PHP Code:
SetEntProp(entityProp_Send"m_nGlowRange"350);
SetEntProp(entityProp_Send"m_iGlowType"2);
SetEntProp(entityProp_Send"m_glowColorOverride"g_iCvarGlowS);
AcceptEntityInput(entity"StartGlowing");

SetVariantString("OnKilled !self:StopGlowing::0:1"); 

Tried? AcceptEntityInput(entity, "StopGlowing");

Or look at my Footlocker plugin, this had issues with objects glowing on the return journey of Hard Rain. I might of fixed it there, or that was the reason I made the boxes respawn in the same spot with the same items. Can't remember. If it's only the spawner which is stuck, then check it's object count when it's picked up (again code in Footlocker), and delete if it's no longer giving items.
__________________

Last edited by Silvers; 05-31-2017 at 08:44.
Silvers is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 05-31-2017 , 11:33   Re: [L4D2]Items are glow
Reply With Quote #14

StopGlowing had no effect. Here's a new version. It won't add glow to prop_ classtypes. Think I found a gas can that wasn't glowing because it was a prop_physics which would require modelname checks. I'll try and fix that.

I'm still using m_iGlowType 1 because 2 isn't working on all items. m_iGlowType 3 would clearly have been the best one to use if it wasn't for the wallhack issue.
m_iGlowType 1 and 2 seems to have glitches when one is not directly looking at the item, causing the glow to flash on and off while in motion.

If anyone wants to rewrite this, be my guest. Including sdkhooks would probably be more effecient.

edit: It got me thinking. All this must surely already exist in some kind of workshop VPK mod?
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_items_glow.sp - 340 views - 6.7 KB)

Last edited by Visual77; 05-31-2017 at 18:49.
Visual77 is offline
phoenix0001
Senior Member
Join Date: Apr 2010
Location: China
Old 06-01-2017 , 11:57   Re: [L4D2]Items are glow
Reply With Quote #15

Quote:
Originally Posted by Visual77 View Post
StopGlowing had no effect. Here's a new version. It won't add glow to prop_ classtypes. Think I found a gas can that wasn't glowing because it was a prop_physics which would require modelname checks. I'll try and fix that.

I'm still using m_iGlowType 1 because 2 isn't working on all items. m_iGlowType 3 would clearly have been the best one to use if it wasn't for the wallhack issue.
m_iGlowType 1 and 2 seems to have glitches when one is not directly looking at the item, causing the glow to flash on and off while in motion.

If anyone wants to rewrite this, be my guest. Including sdkhooks would probably be more effecient.

edit: It got me thinking. All this must surely already exist in some kind of workshop VPK mod?
The walls blocked the glow
__________________
I like this BBS sharing of spirit

I come from China, my English is poor
phoenix0001 is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-04-2017 , 06:56   Re: [L4D2]Items are glow
Reply With Quote #16

Quote:
Originally Posted by phoenix0001 View Post
The walls blocked the glow
Do you actually want the items to glow through walls? You'd want to force m_iGlowtype 3 on everything then.

I have a question as to regarding sdkhooks. OnEntityCreated doesn't seem to fire for prop_physics?

Code:
public void OnEntityCreated(int entity, const char[] classname)
{
	if (StrEqual(classname, "prop_physics", false))
	{
		PrintToChatAll("physics - now lets check model");
	}
}
Does nothing.

A fix for the gascans on these 3 maps is also needed - c7m3, c6m3 and c1m4. I suppose the gas cans should have glowtype 3 and glow range 0
so they become visible as they should.

Last edited by Visual77; 06-04-2017 at 06:57.
Visual77 is offline
leaffan
Senior Member
Join Date: Jan 2013
Old 06-04-2017 , 09:07   Re: [L4D2]Items are glow
Reply With Quote #17

Quote:
Originally Posted by Visual77 View Post
Do you actually want the items to glow through walls? You'd want to force m_iGlowtype 3 on everything then.

I have a question as to regarding sdkhooks. OnEntityCreated doesn't seem to fire for prop_physics?

Code:
public void OnEntityCreated(int entity, const char[] classname)
{
	if (StrEqual(classname, "prop_physics", false))
	{
		PrintToChatAll("physics - now lets check model");
	}
}
Does nothing.

A fix for the gascans on these 3 maps is also needed - c7m3, c6m3 and c1m4. I suppose the gas cans should have glowtype 3 and glow range 0
so they become visible as they should.
1- https://i.hizliresim.com/YN3jBa.jpg
2- https://i.hizliresim.com/29vYg0.jpg
3- https://i.hizliresim.com/VM2gVq.jpg

There is a small mistake.

It's on the guns, but it just leaves a mark on the guns.
leaffan is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-04-2017 , 09:20   Re: [L4D2]Items are glow
Reply With Quote #18

Quote:
Originally Posted by leaffan View Post
1- https://i.hizliresim.com/YN3jBa.jpg
2- https://i.hizliresim.com/29vYg0.jpg
3- https://i.hizliresim.com/VM2gVq.jpg

There is a small mistake.

It's on the guns, but it just leaves a mark on the guns.
Ty, I'll try to fix that soon.
Visual77 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-04-2017 , 09:20   Re: [L4D2]Items are glow
Reply With Quote #19

Quote:
Originally Posted by Visual77 View Post
Do you actually want the items to glow through walls? You'd want to force m_iGlowtype 3 on everything then.

I have a question as to regarding sdkhooks. OnEntityCreated doesn't seem to fire for prop_physics?

Code:
public void OnEntityCreated(int entity, const char[] classname)
{
	if (StrEqual(classname, "prop_physics", false))
	{
		PrintToChatAll("physics - now lets check model");
	}
}
Does nothing.
"physics_prop" and "prop_physics"
__________________

Last edited by Silvers; 06-04-2017 at 09:21.
Silvers is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-04-2017 , 10:00   Re: [L4D2]Items are glow
Reply With Quote #20

Quote:
Originally Posted by Silvers View Post
"physics_prop" and "prop_physics"
Ok. Found another problem which I dislike with OnEntityCreated. A 0.1 second timer is needed on some entities or otherwise glow won't appear on it. Took me a while to figure out why certain items wouldn't glow lol.
If it has glitches like that, it's safer to use a timer for every entity.

Last edited by Visual77; 06-04-2017 at 10:01.
Visual77 is offline
Reply



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 15:18.


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