Fortress Forever

Fortress Forever (https://forums.fortress-forever.com/index.php)
-   Modding (https://forums.fortress-forever.com/forumdisplay.php?f=45)
-   -   (Released) [SM Plugin] Flag Assist Points (https://forums.fortress-forever.com/showthread.php?t=18987)

hlstriker 02-13-2009 01:33 AM

[SM Plugin] Flag Assist Points
 
Another plugin for SourceMod.
You can download it HERE:

Copy and pasted from the AM forums:
Quote:

ALERT: After installing this plugin your server may need a restart.

+description+
- This plugin gives fortress points to players that helped assist a flag capture.

- The points are given in a percentage depending on how long a player held the flag compared to other assistants.

- The flag capturer receives the default capture points, but no assist points.

- This plugin only works on CTF maps as long as they contain correct logging data.

+server cvars+
- sv_assistpool <Number of points>
+ Sets the amount of points in the flag cap assist pool.

- sv_defendpoints <Number of points>
+ Sets the amount of points a player gets for defending the flag.

+client commands+
- flagstatus
+ Shows the player the status of their teams flag and the enemy teams flag.

+logging actions+
- flag_defend_carrier: The logged player killed the enemy team flag carrier.
- flag_defend: The logged player killed an enemy player near the flag.
- flag_assist: The logged player helped assist teammates for a flag capture.

+installation+
- Place the FlagAssists.smx file inside of the addons/sourcemod/plugins/ folder.

+credits+
- [Rawh]: Providing a Linux box to test on, testing plugin, and finding bugs.
- [psychonic]: Pointing out exploits and ideas.
- [Tyrant]: Helped test plugin.
- [PartialSchism]: Helped test plugin.
- [TonyCip]: Helped test plugin.
- [Bully]: Helped test plugin.

+changelog+
Version 1.0 ( 02-12-2009 )
-- Initial release.

Version 1.1 ( 02-13-2009 )
-- Added logging of the flag assists for stats programs.
-- Added hooks for say_team and say2 to remove exploiting (thanks psychonic).

Version 1.2 ( 02-24-2009 )
-- Added flaginfo command for players to view the status of the flags.
-- Added points for players that help defend the flag.
-- Added logging for defending the flag (logs as flag_defend).
-- Added cvar sv_assistpool to set the amount of points in the flag capture pool.
-- Added cvar sv_defendpoints to set the amount of points a player gets from defending the flag.
-- Fixed some problems plugin was having on Linux machines.

Version 1.3 ( 02-25-2009 )
-- Fixed variables that needed reset on map change.
-- Added the flags location to the flaginfo command.
-- Colorized the flaginfo command.

Version 1.4 ( 02-28-2009 )
-- Added check to see if the map is CTF. If not a CTF map the plugin will 'unload'.
-- Added flag defend points for killing players within a certain distance of the flag.
-- Added a new logging feature for killing the flag carrier: 'flag_defend_carrier'.
-- Changed 'flag_defend' logging. This now represents that you killed someone near your flag.
-- Changed 'flaginfo' command to 'flagstatus' due to flaginfo already existing in FF.
-- Added message to inform connected players about the flagstatus command.
-- Fixed bug where player carrying a flag would disconnect; which would cause wrong flag status.

Version 1.5 ( 03-02-2009 )
-- Fixed bugs in the location message hook.
-- Fixed a bug in the client disconnect hook.
-- Fixed bug where plugin tried to give non-player entities Fortress-Points.

Version 1.6 ( 03-05-2009 )
-- Fixed showing the dead players flagstatus.
-- Optimized the SayText function so it no longer needs the extra name checks.

Dinosaur Gas 02-13-2009 03:57 AM

Does it use a trigger event for the logs so hlstatsx can track it?

hlstriker 02-13-2009 04:14 AM

Well it uses the trigger events, but do you mean does it create new events for the assist points?

If that's what you mean then no, but I can look into adding it for you if this is what you want (just let me know how you want it formatted).

Ihmhi 02-13-2009 06:43 AM

- The points are given in a percentage depending on how long a player held the flag compared to other assistants.

Could you elaborate on this? Are they given a percentage of a fixed amount, or does it go up over time? 'cause, you know... people just holding the flag for points and all that.

hlstriker 02-13-2009 07:29 AM

Most CTF maps give 1000 fortress points per cap so I based it on that. This percentage also includes the person that capped the flag even though they don't get the assist points.

Example:
Player 1: Holds flag for 10 seconds (20%).
Player 2: Holds flag for 20 seconds (40%).
Player 3: Holds flag for 10 seconds (20%).
Player 4: Holds flag for 10 seconds (20%).
Total seconds = 50.

Player 3 captures the flag.

Player 1: Gets 200 assist points.
Player 2: Gets 400 assist points.
Player 3: Gets 0 assist points AND 1000 points for the flag capture.
Player 4: Gets 200 assist points.

Notice the assist points only total to 800 instead of 1000 since the flag capturer didn't get any assist points.

Ihmhi 02-13-2009 01:31 PM

Wow, that's actually pretty damn balanced. Nice dude.

KubeDawg 02-13-2009 02:12 PM

Well what if they hold it for 30 seconds? It's not uncommon to see people with the flag multiple times totaling to about 30 or 40 seconds till it's actually captured?

Jester 02-13-2009 04:49 PM

Say it takes me 10 seconds to bring the flag back to my base, then I get gibbed by someone. A teammate grabs the flag and holds it in the respawn for a full minute then captures. I get 142 points for doing all the work and they get the 1000 for camping with it?

hlstriker 02-13-2009 06:47 PM

@KubeDawg: Even if you drop the flag multiple times it will keep addind those times together until the flag is capped, then it resets.

@Jester: This is why I give the person that caps the flag the full amount of default flag cap points and 0 assist points. Otherwise people probably would try to camp around before capping just to get more assist points.

GeoKill-----> 02-14-2009 11:12 PM

After some technical issues I got this working on the e0 server :)

xks 02-24-2009 02:32 AM

Quote:

Originally Posted by Jester (Post 426619)
Say it takes me 10 seconds to bring the flag back to my base, then I get gibbed by someone. A teammate grabs the flag and holds it in the respawn for a full minute then captures. I get 142 points for doing all the work and they get the 1000 for camping with it?

The 142 is more than you would get without this plugin ;)

This plugin should be built into the Fortress points system in 2.4 or a future FF release imo.

MonoXideAtWork 02-24-2009 06:52 PM

TO THE E0 SERVER!!!

hlstriker 02-24-2009 08:01 PM

Plugin updated, see change log.

Note: Server might need a full restart after adding the plugin. On Rawh's server we tested and it didn't work until the server restarted.

GeoKill-----> 02-24-2009 10:39 PM

Sweet, got it working perfectly on the e0 server

Rawh 02-25-2009 02:42 PM

Quote:

Originally Posted by hlstriker (Post 428582)
Plugin updated, see change log.

Note: Server might need a full restart after adding the plugin. On Rawh's server we tested and it didn't work until the server restarted.

You're saying it wrong :P
The server crashed last time, got restarted automatically and the plugin seemed to work after that.
The crash was in no way related to the plugin by the way :)

Quote:

Originally Posted by Dinosaur Gas (Post 426483)
Does it use a trigger event for the logs so hlstatsx can track it?

Yes it does.

The logs show it as:
Quote:

L 02/24/2009 - 00:54:34: "hlstriker<3><STEAMID><#FF_TEAM_BLUE>" triggered "flag_assist" (points "-1073741824")
L 02/24/2009 - 00:55:14: "Rawh<5><STEAMID><#FF_TEAM_BLUE>" triggered "flag_assist" (points "933")
L 02/24/2009 - 00:56:08: "Rawh<5><STEAMID><#FF_TEAM_BLUE>" triggered "flag_assist" (points "933")
L 02/24/2009 - 00:57:17: "hlstriker<3><STEAMID><#FF_TEAM_BLUE>" triggered "flag_assist" (points "941")
  • On hlstatx, login as admin and go to gamesettings --> fortressforever --> actions.
  • Use "flag_assist" as action code, put a [v] in player action and give it some points (optional: give it a description).
  • Next go to "Plyr Action Awards", use the dropdown menu of "Actions" and select flag_assist.
  • Optional: fill in an award name and some verb plural.
  • Save your settings.
  • Restart the daemon.

The above shows up on the dailyaward site. You'll have to wait for 1 day till hlstats-awards.pl gets executed and you see the action awards on the dailyaward part.

Optional:
If you wish to see if it already works, use hlstats-awards.pl.
Since it creates stats for the day before the current date, be sure to set the current day + 1.
Code:

./hlstats-awards.pl --date=YYYY-MM-DD
I used 2009-02-25 to get dailystats for 2009-02-24 which shows "Santa's little helper" (flag_assist) and "Flag defender" (flag_defend)

Important: The points you get for flagassist / flagdefend during the playtime on a map, ingame, are not the same as the points you get in hlstatsx.

hlstriker 02-25-2009 04:01 PM

Updated to 1.3 which fixed a big problem that could cause the plugin to stop working after map change.

fishBurger 02-25-2009 04:19 PM

How do flag defense points work?

hlstriker 02-25-2009 04:23 PM

If you kill someone with your teams flag you get flag defense points.

fishBurger 02-26-2009 10:05 PM

Sweet. Any chance this could include killing an enemy within a certain distance of a downed flag?

hlstriker 02-28-2009 08:05 AM

@fishBurger: Yes, see update ;)

-----

Updated to 1.4; Please see the change log for a few big changes. Admins using hlststs will want to read the change log especially carefully.

And remember, after installing the update your server might need a full restart.


All times are GMT. The time now is 06:51 AM.

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