Originally, this plugin was just wheel reinvention, back in the prerelease version. I found SJ/Teleport/Weighdown to be too limited in certain ways, i.e. too much controlled by the FF2 base, buggy, not being able to turn them off briefly, and often malfunctioning with rages I'd write for VSP hales and
Saxton v2. In fact that's why it's called
Dynamic Defaults...since the goal was to make these abilities mutable during a hale round, and using reflection to allow developers to mutate said abilities during a rage. Since then, this pack has become a set of abilities that not only improve upon the FF2 base, but also add new mobility options such as glide and parkour. This pack contains mobility abilities, abilities that are mainly for developers and don't truly shine without another developer's ability (i.e. dynamic_melee_management would work well with a revamped Sandmen ability) and other things that are core to a hale's configuration, such as handling environmental hazards and offering more customization of movement speed. Many other coders already tie their abilities to Dynamic Default abilities, with SHADoW NiNE TReS probably being the most prolific.
I've provided a bunch of interfaces for developers that allow enabling, disabling, and changing settings and variables (including number of uses) for Super Jump, Teleport, and Weighdown. As of
v1.0.0 you these benefits apply to Glide, and you can now offset active cooldowns on SJ/teleport. As of
v1.1.0 there is stunsg support, plus developer interfaces for adding stunsg to any rage. As of
v1.2.0 there is now support for better customizing the hale's speed over their lifetime.
v1.3.0 adds a bunch of brand new things like a Parkour mobility option, a highly customizable and low-bug point teleport, proper melee management, and environmental damage management.
One other change is I scrapped the original timer design and went on the game frame, where I'm most comfortable coding. (though also OnPlayerRunCmd and PreThink when optimal) The slot variable (arg0) is completely ignored as I frankly find this system to be a mess, but jump and teleport support RELOAD and ALT-FIRE modes.
Without further adieu, the list:
dynamic_jump
The same old jump as before, as Eggman made it though oldjump is determined via an argument instead of a cvar. This version also allows the optional multiplier to work with oldjump. I'd like to think the double super jump glitch won't happen with this version. Example usage:
dynamic_weighdown
There's very little different between this version and the traditional weighdown. I've fixed the issue where it stop-starts when the user holds crouch for a long time while looking down. I also added support for setting the gravity that the player should return to when the weighdown ends. (useful if you have rages that also set boss gravity) The main reason you'd use this is it interacts well with abilities like dynamic_jump and dynamic_parkour, as well as other subplugins that support Dynamic Defaults. Example usage:
dynamic_teleport
This one got a major overhaul. I've added optional support for out-of-body teleports, first trying to teleport on top of the hale and then to the side of the hale. If these are turned off, or a suitable location cannot be found (the code doesn't try very hard), it defaults to inside the player. It fixes numerous errors with other implementations including telegoombas, telemelee, and cooldown resetting when cancelling a charge. (it's rare, but it happens and it's the bane of teleport bosses) The particle effect no one knew existed is fixed. Finally, you can set the duration of the stun -- even make it zero if you want.
Updated in 1.0.0: Now supports teleporting to same team and teleporting others to you. (and stunning them
)
Updated in 1.1.3: You can also now change whether or not you teleport above/to the side of players via code. Makes sense since you already could swap between teleport to team and teleport to enemies. Example usage:
dynamic_glide
Oh hey, a bonus ability. I decided to stick this in here because not only was it a ridiculously easy ability to make (I spent maybe an hour or two about five months ago) I needed a hale to have this as a dynamic ability. (a boss I'm working on who starts weak and gains power steadily over the round) It's basically just like the B.A.S.E. Jumper but way more configurable. Here's an example usage:
dynamic_stunsg
The old stunsg has been replaced with a much more robust version. I've fixed bugs with the original stunsg, like in most but not all cases, the ammo loss glitch should be fixed. With this version you can optionally set arg2 as the distance/radius, if empty it will default back to ragedist. Also, ragespamming will extend the rage (not additive) instead of duplicating particles and having the rage end early. Developer interfaces allow triggering the same sentry stun from the player or any given position of the map. As of
v1.1.2 developers have interfaces to freely stun and unstun any sentry by entity index and have it interact well with other sentry stuns that use this plugin. Example:
dynamic_speed_management
Provides more flexibility for speed management than FF2's default. Instead of the typical maxspeed -> maxspeed+65ish that FF2 currently does, you can specify the starting speed and ending speed. You can make starting the same as end, or higher, or lower -- no limits there. It also supports condition handling (i.e. disciplinary action buff), and speed modification for BFB, sniper rifles, bows, and miniguns. You can also change the speed buff/nerfs for all these things. Finally, it includes disguise support and even lets you gain speed from a disguise. (i.e. disguise as a scout) Unlike the other abilities in this package, arg3 and beyond all have default parameters. Everything is on by default except for the disguise speeds. Here's an ability example:
dynamic_parkour
A new mobility option that is meant to be a super jump replacement. The default action key is RIGHT MOUSE but others like MIDDLE MOUSE and RELOAD are acceptable. Allows the user to climb walls and perform a wall jump. You hold the action key to cling to walls, move left-right or up-down (up-down requires you to look slightly in a direction first). Jump off with JUMP. Clinging to walls restores any air dashes a scout might have, if it is a scout.
NOTE: If your boss has weighdown, it must be dynamic_weighdown. Otherwise weighdowns will screw up wall climbing. Best demonstrated in
this video.
Spoiler
Code:
"abilityX"
{
// aside from promoting my own brand
// I'm using dynamic jump and weighdown on new saxton so these abilities can't be combined with others.
// it's not necessary, but it's highly recommended. also required if you want to compile the source.
"name" "dynamic_parkour"
"arg1" "0" // activation key. 0 = right mouse, 1 = RELOAD, 2 = middle mouse, 3 = use (not recommended)
"arg2" "45.0" // maximum distance from a wall to allow clinging
"arg3" "550.0" // intensity of wall jump
"arg4" "-25.0" // pitch of wall jump
"arg5" "400.0" // intensity of wall climb
"arg6" "1" // if 1, user is knockback immune during parkour (highly recommended)
"arg7" "0.5" // duration for lingering knockback immune after moving out of parkour mode
"arg8" "0" // if 1, allow skybox climbing.
// below needs some explaining
// max yaw deviation before angle is forced, set to 180.0 to never force angle, but the animation will look like garbage
// however, if it's set to 0.0, the user can't look up and down very quickly and this can't move up and down
// forcing angle is awkward as hell in terms of UI experience, but kind of a necessary evil. it's needed but should be limited.
"arg9" "45.0"
"arg10" "25.0" // pitch threshold before forward/back moves up and down walls
"arg11" "0.75" // delay before an airblasted player who was knocked off a wall can latch on again. (if they weren't on a wall, this is not applied)
"arg12" "125.0" // forward push while latched (keeps from drifting from walls but also aids climbing odd surfaces)
"arg13" "200.0" // forward push while latched but the user has BACK key pressed (surprising how high it needs to be to counter this movement)
// optional, weapon to swap to for animation
// note that weapons in the same slot are lost when starting parkour, so try to make it melee (slot 2)
// if it is melee, the weapon specified in dynamic_melee_management will be attempted to be remade
"arg21" "2" // slot, 0 = primary, 1 = secondary, 2 = melee (there are others, look them up)
"arg22" "tf_weapon_robot_arm" // weapon name
"arg23" "5" // weapon index
"arg24" "1 ; 0.0" // weapon args
// HUD messages. each replace each other, and must occupy two lines (which is why there's trailing \n's)
"arg31" "0" // 1 = disable the default HUD, useful if you plan on using your own
"arg32" "Hold RIGHT MOUSE to cling to and climb walls.\n" // message when available
"arg33" "Keep holding RIGHT MOUSE and press A or D to climb sideways.\nLook up or down and press W to go up/down. JUMP to wall jump." // while clinging onto walls
"arg34" "You need to be in midair to cling to walls.\nWhen in midair, hold RIGHT MOUSE to cling to walls." // unavailable due to lacking ground clearance
"arg35" "Parkour is unavailable, since you're in water.\n" // unavailable due to being in water
"plugin_name" "ff2_dynamic_defaults"
}
dynamic_melee_management
Useful for when melee weapons are often switched with your ability. It also has the side benefit of ensuring that your main weapon is the same on everyone's server, since this version doesn't add any stats to the weapon. (and for example, Friagram's servers and VSP don't add +200% damage, but the FF2 base does -- not a problem if your melee weapon is declared in dynamic_melee_management!) Example (Epic Scout's melee weapon which does 80-some damage):
dynamic_point_teleport
This was originally
sarysa_point_teleport in my fork of Blitzkrieg's abilities and may or may not have been moved to SHADoW's main version. Either way, I figured people would never find it there and it's useful to more than just Blitzkrieg, it's a lot more stable than the war3source/otokiru version, and a lot more configurable as well. Give it a whirl. Example:
dynamic_env_management
If you have my Teleport to Spawn plugin or another plugin that manages this problem, you won't need this. Otherwise, some hales don't handle environmental traps very well. Epic Scout is one of those hales. This ability is for them -- gives them some breathing room instead of a cheap loss of their long waited for turn as hale. Example:
dynamic_stop_taunt
Made for one reason -- rage_preventtaunt stops the hale, and sometimes this doesn't make sense. For example, Epic Scout whose abilities are activated with E but not necessarily at 100 rage. Example:
Developer Interfaces
The interfaces are found in ff2_dynamic_defaults.inc. Due to load order concerns, I had to use reflection instead of natives. A list of interfaces which should be self-explanatory (
DD = Dynamic Defaults,
DT = dynamic teleport,
DJ = Dynamic Jump,
DW = Dynamic Weighdown,
DG = Dynamic Glide,
DSSG = Dynamic Stun Sentry Gun,
DSM = Dynamic Speed Management,
DMM = Dynamic Melee Management,
DP = Dynamic Parkour):
Spoiler
Code:
// last parameter is default because it was added after the first release
stock DD_SetDisabled(clientIdx, bool:superjump, bool:teleport, bool:weighdown, bool:glide = false)
// invoking this method does not require teleport to be in your boss config
// return value tells you if teleport succeeded
stock bool:DD_PerformTeleport(clientIdx, Float:stunDuration, bool:tryAbove = false, bool:trySide = false, bool:sameTeam = false, bool:reverseTeleport = false)
// this will display the DD HUD even if FF2 HUD is disabled
stock DD_SetForceHUDEnabled(clientIdx, bool:force)
// returns -1.0 if invalid (i.e. hale has no enabled mobility options at the time, DOES NOT MEAN they won't the entire round though!)
stock Float:DD_GetMobilityCooldown(clientIdx)
// returns -1.0 if invalid (i.e. hale has no enabled mobility options at the time, DOES NOT MEAN they won't the entire round though!)
stock Float:DD_GetChargePercent(clientIdx)
stock DJ_SetUsesRemaining(clientIdx, usesRemaining)
stock DJ_CooldownUntil(clientIdx, Float:cooldownEndTime)
stock DJ_AdjustCooldownTimer(clientIdx, Float:offset)
// NOTE: Set any of the floats below to -1.0 to preserve the existing value.
stock DJ_ChangeFundamentalStats(clientIdx, Float:chargeTime, Float:cooldown, Float:multiplier)
stock DT_SetUsesRemaining(clientIdx, usesRemaining)
stock DT_CooldownUntil(clientIdx, Float:cooldownEndTime)
stock DT_AdjustCooldownTimer(clientIdx, Float:offset)
// NOTE: Set any of the floats below to -1.0 to preserve the existing value.
stock DT_ChangeFundamentalStats(clientIdx, Float:chargeTime, Float:cooldown, Float:stunDuration)
stock DT_SetTargetTeam(clientIdx, bool:sameTeam)
stock DT_SetIsReverse(clientIdx, bool:isReverse)
stock DW_SetUsesRemaining(clientIdx, usesRemaining)
stock DW_CooldownUntil(clientIdx, Float:cooldownEndTime)
// note, this is to set the player's normal gravity. weighdown gravity is always 6.0.
stock DW_SetDefaultGravity(clientIdx, Float:gravity)
// NOTE: Set any of the floats below to -1.0 to preserve the existing value.
stock DG_ChangeFundamentalStats(clientIdx, Float:startVelocity, Float:decayPerSecond, Float:cooldown, Float:maxDuration)
stock DSSG_PerformStun(clientIdx, Float:radius, Float:duration)
stock DSSG_PerformStunFromCoords(clientIdx, const Float:coords[3], Float:radius, Float:duration)
stock DSSG_StunOneSentry(sentry, Float:duration)
stock DSSG_UnstunOneSentry(sentry)
// note that all floats can be set to -1.0 to preserve the existing value
// also, slowed is deprecated. doesn't do anything.
stock DSM_SetModifiers(clientIdx, Float:bfb, Float:rlfle, Float:bow, Float:minigun, Float:slowed, Float:critcola, Float:whip, Float:dazed)
stock DSM_SetDisguiseSettings(clientIdx, bool:useDisguiseSpeed, bool:disguiseIncreasesSpeed)
stock DSM_SetOverrideSpeed(clientIdx, Float:overrideSpeed = -1.0, bool:applyModifiers = false)
stock DMM_ResetWeapon(clientIdx)
stock bool:DP_IsLatched(clientIdx)
Examples
I've included two examples. None of these are intended for the general public, they only exist for demonstration purposes.
-
neohale.cfg is just a straight example of the original stun spamming Saxton Hale with dynamic SJ/weighdown and dynamic stunsg. No changes to his mechanics are intended.
-
neohhh.cfg is not a straight example of HHH Jr., instead it showcases some of the new features like out-of-body teleport and is effectively commentary from me that a 45 second interval is too damn long when half the classes can easily get out of reach.
It also has dynamic stunsg with a radius specified in the ability itself, which overrides the one in ragedist.
As of
v1.2.0 there are four more examples specifically for speed management:
-
bfbtest.cfg - Demonstrates Baby Face's Blaster handling, as well as static speed settings
-
ninjaspy_speedmgmt.cfg - Demonstrates disguise handling, and also shows RELOAD super jumping.
-
gaben_speedmgmt.cfg - Demonstrates Minigun handling, as well as reverse speed settings
-
cbs_speedmgmt.cfg - Demonstrates Sniper Rifle and Huntsman handling, as well as "normal" speed settings. (though 200 -> 520 is not normal)
VERSION HISTORY
v0.9.0
- Pre-release with all the basics.
v1.0.0:
- Allows external plugins to execute the teleport code, without requiring the rage in their .cfg file. Should make sequence-of-events rages that include a teleport easier to make.
- Added support for the rare instance that the hale is on RED team. (i.e. shadow93's Redmond/Blutarch)
- Added support for only teleporting to people on the same team as you.
- Added support for reverse teleport (bring player to you)
- Fixed divide by zero issue with zero charge time
- Allows developers to bypass FF2FLAG_HUDDISABLED and still display the HUD for super jump/teleport, useful if a boss has an unusual type of rage or no rage whatsoever.
- Added
dynamic_glide ability, which adds support for a B.A.S.E. Jumper like parachute. (plus with all the developer interfaces, enable/disable etc)
- New interfaces which allow offsetting any existing cooldown. (FF2 defaults allow this already though it's a little awkward)
v1.1.0:
- Added
dynamic_stunsg.
v1.1.1
- Added two interfaces:
DD_GetMobilityCooldown and
DD_GetChargePercent
v1.1.2
- Added two interfaces:
DSSG_StunOneSentry and
DSSG_UnstunOneSentry
- Teleport and Super Jump now used a synchronized HUD. (yep, Chdata has officially converted me with this one)
- Fixed an obscure bug where charged Cow Mangler shot (or a generated Energy Ball projectile manually set to be charged) hitting a sentry would mess with Dynamic StunSG. (Dynamic StunSG can still cause a cow mangler stun to end early, but now the reverse can't happen -- the sentry may still briefly twitch, however)
v1.1.3
- Added one interface:
DT_SetAboveSide which allows toggling whether or not teleports can go above or to the side of the target.
- Added Chdata's IN_SCORE fix for the HUD to minimize flicker while the scoreboard is visible.
v1.2.0
- Added
dynamic_speed_management and developer interfaces for it, along with sample hales.
- Fixed a bug where RELOAD didn't work at all for SJ or Teleport.
- If a hale for whatever reason has both Super Jump and Teleport active at the same time, it'll only print the Super Jump HUD message instead of wig out. Note that there's currently no support for SJ and Teleport enabled simultaneously, even if they're set to different keys.
v1.3.0
- Added
dynamic_parkour
- Added
dynamic_melee_management
- Added
dynamic_point_teleport
- Added
dynamic_env_management
- Added
dynamic_stop_taunt
- Fixed interface
DSM_SetModifiers
- Added interface
DSM_SetOverrideSpeed
- Properly manage Teleport when the boss is a different size than a potential target.
v1.3.1
- Fixed telegoombas that usually affect falling soldiers. Goombas from the hale within 2 seconds of teleport will do zero damage. (and bounces the hale intentionally so it's unlikely they'd telegoomba after 2.1 seconds
)
v1.3.2
- Updated
dynamic_speed_management's default value for soft stun to 0.75, reflecting Valve's changes made on 2015-10-28.
Known Issues
- Mixing my super jump with the default weighdown will permit instant weighdown after super jump. Same goes for default super jump and my weighdown. If you use dynamic SJ, you should pair it with dynamic weighdown. (teleport never mattered)
- "Slowed" condition cannot be customized by dynamic_speed_management, though there's some deprecated code left in there for slowed. It seems to get applied after PreThink I guess...or maybe the client itself applies it.
- Parkour sometimes derps with thin ramps, like the ones on vsh_weaponsdepot_final
CREDITS:
- sarysa made this plugin.
- Eggman's super jump and a small amount of teleport code has been ported over to this.
- Friagram came up with a similar out-of-body teleport option over a year ago which obviously influenced mine, though I haven't seen the code for his version.
- Chdata for convincing me to switch to synchronized HUD