AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved Items are glow (https://forums.alliedmods.net/showthread.php?t=297932)

phoenix0001 05-27-2017 22:39

Items are glow
 
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

Visual77 05-28-2017 14:23

Re: [L4D2]Items are glow
 
1 Attachment(s)
I coded something very quickly, you can test it. You will need the latest sourcemod 1.8 build.

leaffan 05-29-2017 10:34

Re: [L4D2]Items are glow
 
Quote:

Originally Posted by Visual77 (Post 2524268)
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.

Silvers 05-29-2017 19:23

Re: [L4D2]Items are glow
 
Quote:

Originally Posted by leaffan (Post 2524500)
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" 


Visual77 05-29-2017 20:04

Re: [L4D2]Items are glow
 
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.

Lux 05-29-2017 20:51

Re: [L4D2]Items are glow
 
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 :D
PHP Code:

HookEntityOutput("weapon_pistol""OnPlayerUse"ChickenOutPut); 


phoenix0001 05-29-2017 23:10

Re: [L4D2]Items are glow
 
Quote:

Originally Posted by Visual77 (Post 2524268)
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..................

Visual77 05-30-2017 06:32

Re: [L4D2]Items are glow
 
Quote:

Originally Posted by Lux (Post 2524617)
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 :D
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.

Lux 05-30-2017 18:08

Re: [L4D2]Items are glow
 
Quote:

Originally Posted by Visual77 (Post 2524671)
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 :P
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

Visual77 05-31-2017 06:19

Re: [L4D2]Items are glow
 
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");
        }
}



All times are GMT -4. The time now is 02:11.

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