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

FF2 [Updated] Boss Custom Attribute Adapter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NoloZero01
Member
Join Date: May 2020
Location: Async Research Institute
Old 06-02-2020 , 07:01   [Updated] Boss Custom Attribute Adapter
Reply With Quote #1

This plugin allows Freak Fortress bosses to have custom attributes applied to their weapons via configuration files.
Works with spawn-in weapons (specified with weaponX) and weapons received at any point in the game (for example with rages). Weapon Index sections can contain multiple attributes.


Usually you would need to write boss abilities to change how weapons behave. This simplifies the process and instead applies custom attributes that use the Custom Attributes Framework by nosoop.

Installation:

Code:
  1. - Install TF2 Custom Attribute Framework .
  2. - Put the plugin into your addons/sourcemod/plugins/ folder and load it. There is no need to rename it into .ff2.
  3. - Install your desired custom attributes. You can write your own or use the ones listed at Custom Attribute Public Sets.

Now you can open your boss configuration file and add your desired custom attributes. Add the following structure inside the root "characters" section (alongside weaponX, abilityX etc).

Code:
           "Custom Attributes"
	{
		"Weapon Index" //weapon index that the boss might get
		{
			"custom attribute" "value"
		}
		"Weapon Index"  //weapon index that the boss might get
		{
			"custom attribute" "value"
		}
		...
	}
Now whenever the boss receives a weapon with the corresponding index, all specified custom attributes will be added to it.
If you wish to see debug information from this plugin whenever it applies custom attributes to a boss, turn FF2's ff2_debug ConVar on.

Changelog:
  • 02-06-2020 - Initial release
  • 22.01.2022 - Version 2.0 released, (almost) full code rewrite, now can apply custom attrubutes to any weapons, not only ones that the boss spawns in with.

GitHub: https://github.com/Nolo001-Aha/ff2_c...ribute_adapter

Updated because I felt reponsible for making the mess that was ver. 1.0 public.

Plugin compiled and tested under SourceMod 1.10.0.6528 for Windows.
Attached Files
File Type: sp Get Plugin or Get Source (ff2_custom_attribute_adapter.sp - 63 views - 3.8 KB)
File Type: smx ff2_custom_attribute_adapter.smx (10.4 KB, 77 views)

Last edited by NoloZero01; 01-22-2022 at 16:35. Reason: GitHub
NoloZero01 is offline
BaconPlague
Junior Member
Join Date: Sep 2017
Old 06-07-2020 , 18:41   Re: Boss Custom Attribute Adapter
Reply With Quote #2

Hey there NoloZero01! Thanks for making this excellent plugin! Everything works smoothly for the most part, through I am here to report a bug on the plugin. I am currently running freak fortress 2 version 1.19.9 (Batfox's Fork) and the server seems to crash if the hale takes shield bash damage. I am not sure if it is a compatibility issue between this plugin and freak fortress ver. 1.19.9, unfortunately the server did not provide any error/crash details in the server logs or console. Removing the specific custom attribute plugin that a hale uses or removing the adapter itself seems to fix the issue. Overall, really nice work with the plugin and I hope to use it more in the future.
BaconPlague is offline
BaconPlague
Junior Member
Join Date: Sep 2017
Old 06-07-2020 , 20:29   Re: Boss Custom Attribute Adapter
Reply With Quote #3

After doing some further testing, it might be a problem with weapon_overheat instead of the plugin. Sorry for the confusion!
BaconPlague is offline
NoloZero01
Member
Join Date: May 2020
Location: Async Research Institute
Old 06-08-2020 , 10:40   Re: Boss Custom Attribute Adapter
Reply With Quote #4

Yeah, some of the custom attributes are not "ideal", some may be missing validity checks or similar. I've had a few cases where certain ones spam errors. One day Ill get everything I've encountered into a list and open an issue on GitHub. If you're interested, I could send my version of overheat that seems stable.
NoloZero01 is offline
BaconPlague
Junior Member
Join Date: Sep 2017
Old 06-08-2020 , 12:34   Re: Boss Custom Attribute Adapter
Reply With Quote #5

Quote:
Originally Posted by NoloZero01 View Post
Yeah, some of the custom attributes are not "ideal", some may be missing validity checks or similar. I've had a few cases where certain ones spam errors. One day Ill get everything I've encountered into a list and open an issue on GitHub. If you're interested, I could send my version of overheat that seems stable.
I would definitely be interested in that, thank you very much in advance! ^^
BaconPlague is offline
NoloZero01
Member
Join Date: May 2020
Location: Async Research Institute
Old 01-22-2022 , 15:22   Version 2.0!
Reply With Quote #6

After abandoning SourcePawn for quite some time, I decided to give it a shot again. Felt responsible for this plugin, as in my opinion it's code was a mess. It also had restrictions (only adding custom attributes to "starting" weapons).
Anyway, here's an update:
  • Now uses TF2Items_OnGiveNamedItem_Post. Full code overhaul and simplification.
  • Can add Custom Attributes to any weapons, not just the ones that the boss spawns with.

Please go to the first post to grab an updated version and see how it's used.
Warning: Version 2.0 is not compatible with it's original config structure. If you want to update, please make sure to update all of your boss configs as well.

----
I'm still rusty in SP, so I could have overseen some major issues, though after testing this for some time I didn't encounter anything strange. Will probably be around for a few weeks/months, so if you stumple upon any bugs, please be sure to report them here. Literally the first thing I did in SourcePawn in a long time, so please don't yell at me.

Last edited by NoloZero01; 01-22-2022 at 15:23.
NoloZero01 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 02:28.


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