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

[L4D1 & L4D2] HP Laser [v1.0.9 | 14-November-2021]


Post New Thread Reply   
 
Thread Tools Display Modes
3aljiyavslgazana
Member
Join Date: Dec 2018
Old 02-18-2021 , 12:12   Re: [L4D1 & L4D2] HP Laser [v1.0.4 | 18-February-2021]
Reply With Quote #11

Yes, It's working wonderfully
Thank you!
3aljiyavslgazana is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-22-2021 , 22:02   Re: [L4D1 & L4D2] HP Laser [v1.0.6 | 22-February-2021]
Reply With Quote #12

Wow, you finally did it. Nice one!
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Proaxel
Member
Join Date: Oct 2014
Old 03-27-2021 , 00:38   Re: [L4D1 & L4D2] HP Laser [v1.0.7 | 23-February-2021]
Reply With Quote #13

I have a suggestion, is it possible to add an option for the player to not see them? Like a player can type !hidelaser or something like that and it hides all the bars for just them but they still show up for everyone else that doesn't use that command.
Proaxel is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-27-2021 , 01:04   Re: [L4D1 & L4D2] HP Laser [v1.0.7 | 23-February-2021]
Reply With Quote #14

Already exists a command with this feature in the main post, added in the version 1.0.6 (22-February-2021).

Check if it fits your needs, otherwise tell me what is missing or not working.

Quote:
Originally Posted by Marttt View Post
Public Commands
  • sm_hplaser => Open a menu to toogle the laser beam HP for the client.
  • sm_hidehplaser => Disable laser beam HP for the client.
  • sm_showhplaser => Enable laser beam HP for the client.
__________________

Last edited by Marttt; 03-27-2021 at 01:12.
Marttt is offline
Proaxel
Member
Join Date: Oct 2014
Old 03-27-2021 , 03:13   Re: [L4D1 & L4D2] HP Laser [v1.0.7 | 23-February-2021]
Reply With Quote #15

Quote:
Originally Posted by Marttt View Post
Already exists a command with this feature in the main post, added in the version 1.0.6 (22-February-2021).

Check if it fits your needs, otherwise tell me what is missing or not working.
I'm dumb and somehow completely missed that when reading, sorry.
Thanks for adding this option! The only ways I can think of to improve are maybe change some cvars to client settings instead. l4d_hp_laser_si and l4d_hp_laser_sight seem to be prime candidates for those but I'm not sure.

Also when a survivor is grabbed by a Hunter, Jockey, or Charger oftentimes their heath bars are on top of each other. Maybe when this happens check if both survivor and infected health bars are enabled and increase the height of one of them if this is the case?

Last edited by Proaxel; 03-27-2021 at 04:26.
Proaxel is offline
kazya3
Member
Join Date: Aug 2019
Location: CN
Old 04-02-2021 , 13:20   Re: [L4D1 & L4D2] HP Laser [v1.0.7 | 23-February-2021]
Reply With Quote #16

Nice work man! however it seems a little lag with the hp-bar when the survivors or tank moving, jumping etc.. what about use setparentattchment and then setparent? i usually use that way to let the entities moving with target together in less lag when mapping ,maybe that possible in plugins? i dont know..Anyway ,the plugins you made is cool and fantacy.
kazya3 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 04-02-2021 , 13:28   Re: [L4D1 & L4D2] HP Laser [v1.0.7 | 23-February-2021]
Reply With Quote #17

Unfortunately, it is not possible. The plugin uses TE_SetupBeamPoints to display the laser according to every client's point of view and there is no such config to attach it to something.

That's why the "little lag", since I need to teleport it manually every 0.1s.
There is a cvar that sets it on every frame but is resource expensive (disabled by default).
Depending on your server config it can increase the networking a lot.

Maybe there is some way to attach but I wasn't able to find it.

If you want something more real-time attached to the client then you would have to use something like my other plugin [L4D1 & L4D2] HP Sprite.

Even then being similar, both behave differently, so is all about pros vs cons.
__________________

Last edited by Marttt; 04-02-2021 at 13:51.
Marttt is offline
TrueDarkness
Junior Member
Join Date: May 2021
Old 07-14-2021 , 03:50   Re: [L4D1 & L4D2] HP Laser [v1.0.7 | 23-February-2021]
Reply With Quote #18

The laser doesn't show up that I used the "Last Boss" script. Although it's now a unapproved script, but it works fine on my server for sooo long. But the HP laser doesn't show on this boss. It's ok when it becomes a normal tank. Does anyone has a solution?

https://forums.alliedmods.net/showpo...&postcount=136
TrueDarkness is offline
ChrisP
Member
Join Date: Jan 2010
Old 10-16-2021 , 02:11   Re: [L4D1 & L4D2] HP Laser [v1.0.7 | 23-February-2021]
Reply With Quote #19

Quote:
Originally Posted by Marttt View Post
Unfortunately, it is not possible. The plugin uses TE_SetupBeamPoints to display the laser according to every client's point of view and there is no such config to attach it to something.

That's why the "little lag", since I need to teleport it manually every 0.1s.
There is a cvar that sets it on every frame but is resource expensive (disabled by default).
Depending on your server config it can increase the networking a lot.

Maybe there is some way to attach but I wasn't able to find it.

If you want something more real-time attached to the client then you would have to use something like my other plugin [L4D1 & L4D2] HP Sprite.

Even then being similar, both behave differently, so is all about pros vs cons.

Hello Marttt! First off, this plugin is a great idea and its well executed, nicely done.

I've been working on Rochelle's smoker tongue ninja rope in XPMod and encountered the same issue you mentioned. I did some digging and found someone able to attach TempEnts using dummy entities. Putting some examples together and changing it a bit, I was very excited to have a working "rope" attached to two controllable entities. I thought I would share my findings with you and if you have the time to take a look at this, maybe it could be used with your plugin to reduce some overhead and "lag" that was mentioned.

This is taken directly from XPMod, so not everything will work standalone without editing, but just some small changes and it'll work. I think if you create the dummy entities at your beam start/end points, then use CreateBeamEntity, and lastly move dummy entities as needed to indicate the players health, it could work.

Code:
int CreateDummyEntity(
	float xyzLocation[3],
	float fLifetime = -1.0,
	int iEntityToAttachTo = -1,
	char[] strAttachmentPoint = "NONE")
{
	// Create the entity
	int iEntity = CreateEntityByName("prop_dynamic");
	if (RunEntityChecks(iEntity) == false)
		return -1;
	
	// Set up the values needed
	char strEntity[30];	
	Format(strEntity, sizeof(strEntity), "start%i", iEntity);	// start/end, doesn't seem to matter if both are specified
	DispatchKeyValue(iEntity, "targetname", strEntity); 
	DispatchKeyValue(iEntity, "model", "models/NULL.mdl"); 	// confirmed that this is required, but doesn't matter if the model exists
	DispatchKeyValue(iEntity, "solid", "0");
	DispatchKeyValue(iEntity, "rendermode", "10");

	// Teleport the entity to appropriate location
	if (RunEntityChecks(iEntityToAttachTo) ==  true)
	{
		float xyzAngles[3];
		GetEntPropVector(iEntityToAttachTo, Prop_Send, "m_vecOrigin", xyzLocation);
		GetClientEyeAngles(iEntityToAttachTo, xyzAngles);

		TeleportEntity(iEntity, xyzLocation, xyzAngles, NULL_VECTOR);
	}
	else
	{
		TeleportEntity(iEntity, xyzLocation, NULL_VECTOR, NULL_VECTOR);
	}	

	// Attachment if required
	if (RunEntityChecks(iEntityToAttachTo) ==  true)
	{
		SetVariantString("!activator");
		AcceptEntityInput(iEntity, "SetParent", iEntityToAttachTo, iEntity, 0);
		SetVariantString(strAttachmentPoint);
		AcceptEntityInput(iEntity, "SetParentAttachmentMaintainOffset", iEntity, iEntity, 0);
	}

	DispatchSpawn(iEntity);
	ActivateEntity(iEntity);

	if (fLifetime > 0.0)
		PrintToChatAll("CreateDummyEntity: fLifeTime not implemented yet.");

	return iEntity;
}

void CreateBeamEntity(
	int iStartEntity,
	int iEndEntity,
	int iPrecachedModelIndex,
	int iRed = 255, int iGreen = 255, int iBlue = 255, int iAlpha = 255,
	float fLifeTime = 120.0,
	float fStartWidth = 5.0, 
	float fEndWidth = 5.0,
	int iFadeLength = 100,
	float fAmplitude = 0.1,
	int iSpeed = 1,
	int iFrameRate = 60)
{		
	TE_Start("BeamEnts");
	TE_WriteEncodedEnt("m_nStartEntity", iStartEntity);
	TE_WriteEncodedEnt("m_nEndEntity", iEndEntity);
	TE_WriteNum("m_nModelIndex", iPrecachedModelIndex);
	TE_WriteNum("m_nHaloIndex", g_iSprite_Halo);
	TE_WriteNum("r", iRed);
	TE_WriteNum("g", iGreen);
	TE_WriteNum("b", iBlue);
	TE_WriteNum("a", iAlpha);
	TE_WriteFloat("m_fLife", fLifeTime);
	TE_WriteFloat("m_fWidth", fStartWidth);
	TE_WriteFloat("m_fEndWidth", fEndWidth);
	TE_WriteNum("m_nFadeLength", iFadeLength);
	TE_WriteFloat("m_fAmplitude", fAmplitude);
	TE_WriteNum("m_nSpeed", iSpeed);
	TE_WriteNum("m_nStartFrame", 0);
	TE_WriteNum("m_nFrameRate", iFrameRate);

	TE_SendToAll();
}

void CreateSmokerTongueNinjaRope(int iClient)
{
	float xyzLocation[3];
	g_iRochelleRopeDummyEntityAttachmentHand[iClient] = CreateDummyEntity(xyzLocation, -1.0, iClient, "muzzle_flash");
	g_iRochelleRopeDummyEntityAttachmentWall[iClient] = CreateDummyEntity(g_xyzRopeEndLocation[iClient]);
	
	CreateBeamEntity(
		g_iRochelleRopeDummyEntityAttachmentHand[iClient], 
		g_iRochelleRopeDummyEntityAttachmentWall[iClient],
		g_iSprite_SmokerTongue);
}

void KillAllNinjaRopeEntities(int iClient)
{
	KillEntitySafely(g_iRochelleRopeDummyEntityAttachmentWall[iClient]);
	KillEntitySafely(g_iRochelleRopeDummyEntityAttachmentHand[iClient]);
}

bool KillEntitySafely(int iEntity)
{
	if (RunEntityChecks(iEntity) == false)
		return false;

	AcceptEntityInput(iEntity, "Kill");
	return true;
}

//These are in my precache function
g_iSprite_SmokerTongue 	= PrecacheModel("materials/particle/smoker_tongue_beam.vmt");
g_iSprite_Halo 			= PrecacheModel("materials/sprites/halo01.vmt");
ChrisP is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 10-16-2021 , 09:11   Re: [L4D1 & L4D2] HP Laser [v1.0.8 | 24-July-2021]
Reply With Quote #20

Hi @ChrisP, thanks for feedback and the snippet code. I will check.

I already have played on XPMod server and it has nice features and concepts.

For dummy entities, I recommend using an "info_target" entity which is less expensive.

The problem with the HP laser is that I have to calculate the angles for each player every moment to teleport it correctly for the player's view.

I know someone with a similar plugin and AFAIK is not public but is better than mine.

I have the HP Sprite plugin aswell, which is good but need FastDL to use the custom sprite.
__________________
Marttt 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 06:33.


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