Raised This Month: $32 Target: $400
 8% 

Solved Items are glow


Post New Thread Reply   
 
Thread Tools Display Modes
leaffan
Senior Member
Join Date: Jan 2013
Old 06-04-2017 , 23:11   Re: [L4D2]Items are glow
Reply With Quote #21

Quote:
Originally Posted by Visual77 View Post
Here's a non sdkhooks of the progress so far. I've only tested it in versus.

Delete old l4d2_items_glow.cfg in l4d2_items_glow in left4dead2\cfg\sourcemod and let the server generate a new one so you can change settings as you like.
https://i.hizliresim.com/4MYaEJ.jpg - 1
https://i.hizliresim.com/AkZ19r.jpg - 2
https://i.hizliresim.com/0BbEYo.jpg - 2-2

Thanks for the effort.

It's a minor problem.

Edit: Just bomb

Last edited by leaffan; 06-04-2017 at 23:11.
leaffan is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-05-2017 , 01:31   Re: [L4D2]Items are glow
Reply With Quote #22

It could be that m_itemCount or the spawner_grab event isn't working on the grenade launcher, I'll check later.
Edit: What custom map is that btw?

I think the solution could be to check for m_itemCount 1 or 0. GetEntProp(entity, Prop_Data, "m_itemCount") <= 1)
But I'd like to try on a map that has the grenade_launcher_spawn.

Last edited by Visual77; 06-05-2017 at 05:24.
Visual77 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-05-2017 , 05:34   Re: [L4D2]Items are glow
Reply With Quote #23

Quote:
Originally Posted by Visual77 View Post
It could be that m_itemCount or the spawner_grab event isn't working on the grenade launcher, I'll check later.
Edit: What custom map is that btw?

I think the solution could be to check for m_itemCount 1 or 0. GetEntProp(entity, Prop_Data, "m_itemCount") <= 1)
But I'd like to try on a map that has the grenade_launcher_spawn.
PHP Code:
        HookEvent("spawner_give_item",            Event_SpawnerGiveItem);

    new 
flag GetEntProp(entProp_Data"m_spawnflags");
    if( 
flag & (1<<3) ) return;    // Infinite ammo
    
new value GetEntProp(entProp_Data"m_itemCount");
    if( 
value )    return;        // We only need to delete if theres 1 item at the spawn 
etc, from Gear Transfer.
__________________
Silvers is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-05-2017 , 06:01   Re: [L4D2]Items are glow
Reply With Quote #24

Quote:
Originally Posted by Silvers View Post
PHP Code:
        HookEvent("spawner_give_item",            Event_SpawnerGiveItem);

    new 
flag GetEntProp(entProp_Data"m_spawnflags");
    if( 
flag & (1<<3) ) return;    // Infinite ammo
    
new value GetEntProp(entProp_Data"m_itemCount");
    if( 
value )    return;        // We only need to delete if theres 1 item at the spawn 
etc, from Gear Transfer.
Yeah, I was only checking for m_itemCount == 1, which seems to be wrong when it comes to the grenade launcher.

Before:
https://steamuserimages-a.akamaihd.n...8370BEACBED58/
After:
https://steamuserimages-a.akamaihd.n...7F5AECB3059F7/

Version 1.1.6
-m_itemCount fix.
-The chainsaw is now classed as melee rather than a weapon.

To do list:
Make it compatible with sdkhooks (OnEntityCreated and SDKHook_WeaponDropPost but I've only faced bugs so far)
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_items_glow.sp - 461 views - 11.9 KB)

Last edited by Visual77; 06-05-2017 at 07:00.
Visual77 is offline
leaffan
Senior Member
Join Date: Jan 2013
Old 06-05-2017 , 14:49   Re: [L4D2]Items are glow
Reply With Quote #25

Quote:
Originally Posted by Visual77 View Post
Yeah, I was only checking for m_itemCount == 1, which seems to be wrong when it comes to the grenade launcher.

Before:
https://steamuserimages-a.akamaihd.n...8370BEACBED58/
After:
https://steamuserimages-a.akamaihd.n...7F5AECB3059F7/

Version 1.1.6
-m_itemCount fix.
-The chainsaw is now classed as melee rather than a weapon.

To do list:
Make it compatible with sdkhooks (OnEntityCreated and SDKHook_WeaponDropPost but I've only faced bugs so far)
Thank you very much!
leaffan is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-05-2017 , 18:39   Re: [L4D2]Items are glow
Reply With Quote #26

Quote:
Originally Posted by leaffan View Post
Thank you very much!
No problem.

Version 1.1.7 - some minor bug fixes.

-Removed c7m3 from IsGasCanFinale (generator map)
-Gascans on c1m4 and c6m3 will not glow before the elevator has been started.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_items_glow.sp - 513 views - 12.0 KB)

Last edited by Visual77; 06-05-2017 at 18:42.
Visual77 is offline
leaffan
Senior Member
Join Date: Jan 2013
Old 06-06-2017 , 00:02   Re: [L4D2]Items are glow
Reply With Quote #27

Quote:
Originally Posted by Visual77 View Post
No problem.

Version 1.1.7 - some minor bug fixes.

-Removed c7m3 from IsGasCanFinale (generator map)
-Gascans on c1m4 and c6m3 will not glow before the elevator has been started.
Well, your health. I do not have a problem anymore.
leaffan is offline
phoenix0001
Senior Member
Join Date: Apr 2010
Location: China
Old 06-07-2017 , 04:54   Re: [L4D2]Items are glow
Reply With Quote #28

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.
yes!! Thank you
This will help the player to find more things.
Attached Images
File Type: jpg QQ??20170607174112.jpg (51.6 KB, 207 views)
__________________
I like this BBS sharing of spirit

I come from China, my English is poor

Last edited by phoenix0001; 06-07-2017 at 05:44.
phoenix0001 is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-13-2017 , 05:23   Re: [L4D2]Items are glow
Reply With Quote #29

Silvers, how do you make items in the footlocker glow? Here's my code but no success.

Code:
public Action Event_PlayerUse(Event event, const char[] name, bool dontBroadcast)
{
	int entity = event.GetInt("targetid");
	if (entity <= 0 || entity >= 2048 || !IsValidEntity(entity)) return;

	char buffer[32];
	GetEntPropString(entity, Prop_Data, "m_iName", buffer, sizeof(buffer));

	if (StrContains(buffer, "button_locker", false) != -1)
	{
		float lockerPos[3];
		GetEntPropVector(entity, Prop_Send, "m_vecOrigin", lockerPos);

		DataPack data;
		CreateDataTimer(1.0, timerDelay, data, TIMER_FLAG_NO_MAPCHANGE); 

		data.WriteFloat(lockerPos[0]);
		data.WriteFloat(lockerPos[1]);
		data.WriteFloat(lockerPos[2]);
	}
}

public Action timerDelay(Handle timer, DataPack data)
{
	float lockerPos[3], itemPos[3];
	int ent = -1;
	char items[32];

	data.Reset();

	lockerPos[0] = data.ReadFloat();
	lockerPos[1] = data.ReadFloat();
	lockerPos[2] = data.ReadFloat();

	while ((ent = FindEntityByClassname(ent, "prop_dynamic")) != -1)
	{	
		GetEntPropVector(ent, Prop_Send, "m_vecOrigin", itemPos);
		GetEntPropString(ent, Prop_Data, "m_iName", items, sizeof(items));

		if (StrContains(items, "molotov", false) != -1 
		|| StrContains(items, "pipebomb", false) != -1
		|| StrContains(items, "vomitjar", false) != -1)
		{
			if (GetVectorDistance(lockerPos, itemPos) < 150.0)
			{
				PrintToChatAll("setting glow on %s, pos %f", items, itemPos);
				SetGlowItem(ent, GetColor(cvarGlowColor_throwables), 2);
			}
		}

		if (StrContains(items, "adrenaline", false) != -1 
		|| StrContains(items, "pills", false) != -1
		|| StrContains(items, "first_aid", false) != -1)
		{
			if (GetVectorDistance(lockerPos, itemPos) < 150.0)
			{
				PrintToChatAll("setting glow on %s, pos %f", items, itemPos);
				SetGlowItem(ent, GetColor(cvarGlowColor_health), 2);
			}
		}
	}
}
Result https://steamuserimages-a.akamaihd.n...D9810DCDFAF80/

Edit: It only works if you don't put glow on the actual footlocker. And items must be of glowtype 3.
https://steamuserimages-a.akamaihd.n...CA5D62BEE4993/

Plus it seems like there are 2 weapon_pain_pills_spawn and the rest are prop_pills. You can't get nothing perfect in this game.

Another idea could be changing glowtype 3 to 0 as the foot locker is opend and then set glowtype 3 on its items.

Last edited by Visual77; 06-13-2017 at 05:52.
Visual77 is offline
leaffan
Senior Member
Join Date: Jan 2013
Old 06-22-2017 , 17:21   Re: [L4D2]Items are glow
Reply With Quote #30

Quote:
Originally Posted by Visual77 View Post
Silvers, how do you make items in the footlocker glow? Here's my code but no success.
Hi!


I found a problem

- I tried deleting your plugin in Scavenge Mod
- I tried Scavenge Mode while installing your plugin

The problem is removing the add-on bins the bins do not appear on the back but the add-on is appearing when I remove the bins

Scavenge Mode is not played.

Thanks.
leaffan 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 21:58.


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