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

[TF2] Yet Another Dodgeball Plugin v1.4.1 (1/19/2019)


Post New Thread Reply   
 
Thread Tools Display Modes
jofuturo01
Junior Member
Join Date: Jul 2017
Old 07-23-2017 , 00:34   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #41

Quote:
Originally Posted by SnowTigerVidz View Post
What do you mean, like reflect it? You simply right click.




I know, I'm asking how I can change the rocket target, to the player closer, because the rocket goes to the player farther away.
jofuturo01 is offline
cigzag
AlliedModders Donor
Join Date: Nov 2014
Location: NZ
Old 07-23-2017 , 01:40   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #42

Quote:
Originally Posted by jofuturo01 View Post
I know, I'm asking how I can change the rocket target, to the player closer, because the rocket goes to the player farther away.
I'm not sure, but that would probably just cause everyone to goto the outskirts
cigzag is offline
jofuturo01
Junior Member
Join Date: Jul 2017
Old 07-23-2017 , 11:27   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #43

Quote:
Originally Posted by SnowTigerVidz View Post
I'm not sure, but that would probably just cause everyone to goto the outskirts
Do not have the rocket possibily go to the nearest player?
jofuturo01 is offline
cigzag
AlliedModders Donor
Join Date: Nov 2014
Location: NZ
Old 07-23-2017 , 14:32   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #44

Quote:
Originally Posted by jofuturo01 View Post
Do not have the rocket possibily go to the nearest player?
Yeah, and it'll make it odd and just ruin long part away 1v1s mid round and vsing bot would be awkward

FUN FACT: backflicking goes to the closest person

Last edited by cigzag; 07-23-2017 at 14:33.
cigzag is offline
jofuturo01
Junior Member
Join Date: Jul 2017
Old 07-23-2017 , 16:55   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #45

Quote:
Originally Posted by SnowTigerVidz View Post
Yeah, and it'll make it odd and just ruin long part away 1v1s mid round and vsing bot would be awkward

FUN FACT: backflicking goes to the closest person



How can I configure the rocket to a closer person?
jofuturo01 is offline
cigzag
AlliedModders Donor
Join Date: Nov 2014
Location: NZ
Old 07-23-2017 , 21:41   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #46

Quote:
Originally Posted by jofuturo01 View Post
How can I configure the rocket to a closer person?
You can't
cigzag is offline
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 07-27-2017 , 22:03   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #47

Thanks for bringing this plugin alive!
RumbleFrog is offline
Dr.Doctor
AlliedModders Donor
Join Date: Feb 2017
Location: Hong Kong
Old 07-28-2017 , 01:35   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #48

I recommend:
Quote:
CPrintToChat(iClient, "You stole %i rockets and got slayed", g_hCvarStealPreventionNumber);
Dr.Doctor is offline
cigzag
AlliedModders Donor
Join Date: Nov 2014
Location: NZ
Old 07-28-2017 , 18:23   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #49

Quote:
Originally Posted by RumbleFrog View Post
Thanks for bringing this plugin alive!
No worries

Dr. Doctor i will edit when I get home since I just got my appendix removed

Last edited by cigzag; 07-29-2017 at 13:55.
cigzag is offline
Honey Senpai
New Member
Join Date: Apr 2017
Old 08-17-2017 , 00:43   Re: [TF2] Yet Another Dodgeball Plugin v1.3.2 (7/21/2017)
Reply With Quote #50

Quote:
Originally Posted by SnowTigerVidz View Post
You can't
You can
Find this part of code in the tools part in the tf2_dodgeball.sp file in scripts

Code:
stock int SelectTarget(int iTeam, int iRocket = -1)
{
	int iTarget			 = -1;
	float fTargetWeight = 0.0;
	float fRocketPosition[3];
	float fRocketDirection[3];
	float fWeight;
	bool bUseRocket;

	if (iRocket != -1)
	{
		int iClass = g_iRocketClass[iRocket];
		int iEntity = EntRefToEntIndex(g_iRocketEntity[iRocket]);

		GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fRocketPosition);
		CopyVectors(g_fRocketDirection[iRocket], fRocketDirection);
		fWeight = g_fRocketClassTargetWeight[iClass];

		bUseRocket = true;
	}

	for (int iClient = 1; iClient <= MaxClients; iClient++)
	{
		// If the client isn't connected, skip.
		if (!IsValidClient(iClient, true)) continue;
		if (iTeam && GetClientTeam(iClient) != iTeam) continue;

		// Determine if this client should be the target.
		float fNewWeight = GetURandomFloatRange(0.0, 100.0);

		if (bUseRocket == true)
		{
			float fClientPosition[3]; GetClientEyePosition(iClient, fClientPosition);
			float fDirectionToClient[3]; MakeVectorFromPoints(fRocketPosition, fClientPosition, fDirectionToClient);
			fNewWeight += GetVectorDotProduct(fRocketDirection, fDirectionToClient) * fWeight;
		}

		if ((iTarget == -1) || fNewWeight >= fTargetWeight)
		{
			iTarget = iClient;
			fTargetWeight = fNewWeight;
		}
	}

	return iTarget;
}
and replace it with this

Code:
stock int SelectTarget(int iTeam, int iRocket = -1)
{
	int iTarget = -1;
	float fRocketPosition[3];
	float fRocketDirection[3];
	bool bUseRocket;
	float flBestLength = 99999.9;
	
	if (iRocket != -1)
	{
		int iEntity = EntRefToEntIndex(g_iRocketEntity[iRocket]);
		GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fRocketPosition);
		
	}
	
	for (int i = 1; i <= MaxClients; i++)
	{
		// If the client isn't connected, skip.
		if (!IsValidClient(i, true))continue;
		if (iTeam && GetClientTeam(i) != iTeam)continue;
		float flPos2[3];
		GetClientEyePosition(i, flPos2);
		
		float flDistance = GetVectorDistance(fRocketPosition, flPos2);
		
		//if(flDistance < 70.0) continue;
		
		if (flDistance < flBestLength)
		{
			iTarget = i;
			flBestLength = flDistance;
		}
		
	}
	return iTarget;
}
then save it as something different like tf2_dodgeball2.sp
compile it.
move original to disabled or delete which ever.
put the smx file you got from compiling it into the plugin folder.
then boom targets the closest.

NOTE: spawn rockets will target the closest as well.

Its what I use on my version of the original plugin. I ripped it from the rtd effect homing rockets and mashed it in there. It should work cause it seem that the tools part was the only thing you didn't touch much.
Oh and by the way I love that some one actually made the plugin better and more easily available.
here is my version if you want to take a gander it uses the original plugin though. it replaces the rocket with flares. the reason is that rockets have a lot of particles that will hurt people who have low frame rates (most of my friends). so i chose to replace the entity with a flare because it has much less particles compared to rockets though I had to add a light entity to it to let people see it.
so let me know if it works for you.

EDIT: I just adjusted it to work for the plugin and all ready did the changes in the sp file so you just have to use the bottom one.
Attached Files
File Type: sp Get Plugin or Get Source (TF2_Dodgeball 4 FINAL 2.sp - 107 views - 78.6 KB)
File Type: sp Get Plugin or Get Source (tf2_dodgeball.sp - 108 views - 81.7 KB)

Last edited by Honey Senpai; 08-17-2017 at 01:07. Reason: Bad at grammer, and just tested it.
Honey Senpai is offline
Reply


Thread Tools
Display Modes

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 08:28.


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