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

Solved Items are glow


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
phoenix0001
Senior Member
Join Date: Apr 2010
Location: China
Old 05-27-2017 , 22:39   Items are glow
Reply With Quote #1

Items are green glow
This will help the player find more items
I found a lot of items players can not find a waste
I want the player to find all the items
__________________
I like this BBS sharing of spirit

I come from China, my English is poor

Last edited by phoenix0001; 07-21-2017 at 22:16. Reason: The problem has been solved.thank you all.
phoenix0001 is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 05-28-2017 , 14:23   Re: [L4D2]Items are glow
Reply With Quote #2

I coded something very quickly, you can test it. You will need the latest sourcemod 1.8 build.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_glow_items.sp - 865 views - 2.5 KB)

Last edited by Visual77; 05-28-2017 at 14:26.
Visual77 is offline
leaffan
Senior Member
Join Date: Jan 2013
Old 05-29-2017 , 10:34   Re: [L4D2]Items are glow
Reply With Quote #3

Quote:
Originally Posted by Visual77 View Post
I coded something very quickly, you can test it. You will need the latest sourcemod 1.8 build.
There are some minor faults.

Https://i.hizliresim.com/nRv2v1.jpg - There is a trace.
Https://i.hizliresim.com/O0W9n0.jpg - After.
Https://i.hizliresim.com/ALo6ZX.jpg - Before.
Https://i.hizliresim.com/YD1W5z.jpg - The chest does not work.
Https://i.hizliresim.com/ldor0k.jpg - The chest does not work.
Https://i.hizliresim.com/DPL6E6.jpg - Before.
Https://i.hizliresim.com/qbg83D.jpg - After.

Thanks! - Thanks for the effort.
leaffan is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-29-2017 , 19:23   Re: [L4D2]Items are glow
Reply With Quote #4

Quote:
Originally Posted by leaffan View Post
Https://i.hizliresim.com/YD1W5z.jpg - The chest does not work.
Https://i.hizliresim.com/ldor0k.jpg - The chest does not work.
Because the object is only created once the Footlocker is opened. Use the Footlocker cvars to make the whole chest glow:

PHP Code:
// 0=Off. Any other value is the range at which the glow will turn on.
l4d2_footlocker_glow "100"

// 0=Default glow color. Three values between 0-255 separated by spaces. RGB Color255 - Red Green Blue.
l4d2_footlocker_glow_color "0 255 0" 
__________________
Silvers is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 05-29-2017 , 20:04   Re: [L4D2]Items are glow
Reply With Quote #5

Some more testing. m_iGlowType 3 is not ideal because it causes items to glow through walls and ceilings, giving the survivor some kind of wall hack for spotting items. (m_iGlowType 1 dosen't appear to have that effect).

I'm still not sure what causes the glow bug after picking up pipes and molotoves. Tried hooking the grab event (spawner_give_item) to remove the glow on the entity but it didn't work, sadly.

If I get more time, I will investigate further.

Last edited by Visual77; 05-29-2017 at 20:05.
Visual77 is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 05-29-2017 , 20:51   Re: [L4D2]Items are glow
Reply With Quote #6

PHP Code:
enum L4D2GlowType
{
    
L4D2Glow_None 0,
    
L4D2Glow_OnUse,
    
L4D2Glow_OnLookAt,
    
L4D2Glow_Constant

if the glow sticks after you pick it up try hook entity input use and disable glow then?

Edit: here is kinda what i mean
PHP Code:
HookEntityOutput("weapon_pistol""OnPlayerUse"ChickenOutPut); 
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 05-29-2017 at 20:56.
Lux is offline
phoenix0001
Senior Member
Join Date: Apr 2010
Location: China
Old 05-29-2017 , 23:10   Re: [L4D2]Items are glow
Reply With Quote #7

Quote:
Originally Posted by Visual77 View Post
I coded something very quickly, you can test it. You will need the latest sourcemod 1.8 build.
Thank you very much for your timely reply, and add glow options,Thank you..................
__________________
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 05-30-2017 , 06:32   Re: [L4D2]Items are glow
Reply With Quote #8

Quote:
Originally Posted by Lux View Post
PHP Code:
enum L4D2GlowType
{
    
L4D2Glow_None 0,
    
L4D2Glow_OnUse,
    
L4D2Glow_OnLookAt,
    
L4D2Glow_Constant

if the glow sticks after you pick it up try hook entity input use and disable glow then?

Edit: here is kinda what i mean
PHP Code:
HookEntityOutput("weapon_pistol""OnPlayerUse"ChickenOutPut); 
There is no "OnPlayerPickUp" or "OnPlayerUse" for weapon_pipe_bomb_spawn
and weapon_molotov_spawn according to valve developer page. I'm trying to look at AcceptEntityInput options.

Last edited by Visual77; 05-30-2017 at 06:32.
Visual77 is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 05-30-2017 , 18:08   Re: [L4D2]Items are glow
Reply With Quote #9

Quote:
Originally Posted by Visual77 View Post
There is no "OnPlayerPickUp" or "OnPlayerUse" for weapon_pipe_bomb_spawn
and weapon_molotov_spawn according to valve developer page. I'm trying to look at AcceptEntityInput options.
Don't use the Dev page
Use hammer instead to view entity inputs. outputs and keyvalues also makesure you disable smart edit(Dev page is wrong for working with sourcemod)

Use this event to detect pickups use classnames to check entity

https://wiki.alliedmods.net/Left_4_D...nts#player_use
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 05-31-2017 at 03:11.
Lux is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 05-31-2017 , 06:19   Re: [L4D2]Items are glow
Reply With Quote #10

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"); 
	}
}

Last edited by Visual77; 05-31-2017 at 06:30.
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 04:24.


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