phil25 / rtd Goto Github PK
View Code? Open in Web Editor NEWRoll The Dice SourceMod plugin for Team Fortress 2
License: GNU General Public License v3.0
Roll The Dice SourceMod plugin for Team Fortress 2
License: GNU General Public License v3.0
Good : "Bonk Bullet" = When you hit an enemy, he will be stun (old sandman bonk effect)
Bad : "Bonk!" = You are stun (old sandman bonk effect)
The plugin only uses EN-US language even if you change in-game language.
I'm writing some perks for a server and I find myself copying a bunch of functions from RTD2 in stocks.sp, and it would be nice if they were added to rtd2.inc so there isn't a bunch of duplicate code.
I could make a PR for it but I'm afraid I wouldn't do a very good job.
Current way of checking perk preconditions is by specifying which classes or weapons it's available for through the config. This greatly limits perk variety because it's impossible to determine whether a a perk is accessible in many different cases, for example:
Furthermore, editing available classes or weapons through a config can be removed. This means server operators will no longer be able to change them without updating perk's code, use case of which is minuscule, if existent at all.
Hello, some people figured out that if you have a Perk like "A Call Beyond" or "Madaras Whistle", the effect can still be used in Spectator.
I can record an example of this if it's necessary.
I can't RTD when I'm in setup even if "sm_rtd2_insetup" is set to "1"
Also when you lost a wave, the effect won't disappear until the timer end
Upon rolling this perk, a medic would automatically deploy a projectile-blocking shield that damages on contact, identical to the one you get in Mann VS Machine. Duration would be 15/20 seconds by default.
This would also be automatically disabled if the server's already got MvM running.
Console Log:
[RTD] Loaded 74 perks (37 good, 37 bad).
L 07/26/2023 - 22:46:43: [SM] Exception reported: Invalid index 66 (count: 66)
L 07/26/2023 - 22:46:43: [SM] Blaming: rtd.smx
L 07/26/2023 - 22:46:43: [SM] Call stack trace:
L 07/26/2023 - 22:46:43: [SM] [0] ArrayList.Set
L 07/26/2023 - 22:46:43: [SM] [1] Line 29, rtd/classes/rollers.sp::Rollers.Rollers
L 07/26/2023 - 22:46:43: [SM] [2] Line 328, rtd.sp::OnPluginStart
L 07/26/2023 - 22:46:43: [SM] Unable to load plugin "rtd.smx": Error detected in plugin startup (see error logs)
Sourcemod build: 7037
https://www.sourcemod.net/downloads.php?branch=dev
alliedmodders/sourcemod@d83c498
os: Debian 11
Likely something to do with new playerlimit
Currently, players can die by their own gator if they are in its radius when it jumps. A setting to disable this self-damage would be useful in cases where the radius is made to be large and the player isn't at risk of dying if they don't manage to get out in time.
I had someone request the ability to turn off taking self damage when using the A call beyond ability.
L 08/27/2019 - 20:44:28: [SM] Exception reported: Array index out-of-bounds (index -1, limit 66)
L 08/27/2019 - 20:44:28: [SM] Blaming: rtd.smx
L 08/27/2019 - 20:44:28: [SM] Call stack trace:
L 08/27/2019 - 20:44:28: [SM] [1] Line 60, rtd/cache.sp::GetFloatCache
L 08/27/2019 - 20:44:28: [SM] [2] Line 144, rtd/perks/pumpkintrail.sp::PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] [3] Line 134, rtd/perks/pumpkintrail.sp::Timer_PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] Exception reported: Array index out-of-bounds (index -1, limit 66)
L 08/27/2019 - 20:44:28: [SM] Blaming: rtd.smx
L 08/27/2019 - 20:44:28: [SM] Call stack trace:
L 08/27/2019 - 20:44:28: [SM] [1] Line 60, rtd/cache.sp::GetFloatCache
L 08/27/2019 - 20:44:28: [SM] [2] Line 144, rtd/perks/pumpkintrail.sp::PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] [3] Line 134, rtd/perks/pumpkintrail.sp::Timer_PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] Exception reported: Array index out-of-bounds (index -1, limit 66)
L 08/27/2019 - 20:44:28: [SM] Blaming: rtd.smx
L 08/27/2019 - 20:44:28: [SM] Call stack trace:
L 08/27/2019 - 20:44:28: [SM] [1] Line 60, rtd/cache.sp::GetFloatCache
L 08/27/2019 - 20:44:28: [SM] [2] Line 144, rtd/perks/pumpkintrail.sp::PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] [3] Line 134, rtd/perks/pumpkintrail.sp::Timer_PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] Exception reported: Array index out-of-bounds (index -1, limit 66)
L 08/27/2019 - 20:44:28: [SM] Blaming: rtd.smx
L 08/27/2019 - 20:44:28: [SM] Call stack trace:
L 08/27/2019 - 20:44:28: [SM] [1] Line 60, rtd/cache.sp::GetFloatCache
L 08/27/2019 - 20:44:28: [SM] [2] Line 144, rtd/perks/pumpkintrail.sp::PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] [3] Line 134, rtd/perks/pumpkintrail.sp::Timer_PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] Exception reported: Array index out-of-bounds (index -1, limit 66)
L 08/27/2019 - 20:44:28: [SM] Blaming: rtd.smx
L 08/27/2019 - 20:44:28: [SM] Call stack trace:
L 08/27/2019 - 20:44:28: [SM] [1] Line 60, rtd/cache.sp::GetFloatCache
L 08/27/2019 - 20:44:28: [SM] [2] Line 144, rtd/perks/pumpkintrail.sp::PumpkinTrail_Detonate
L 08/27/2019 - 20:44:28: [SM] [3] Line 134, rtd/perks/pumpkintrail.sp::Timer_PumpkinTrail_Detonate
Currently, sm_forcertd
is able to specify custom perk time (ex. sm_forcertd @me godmode 999
). This system could be extended to specify more specific time, for example:
sm_forcertd <target> godmode life
sm_forcertd <target> godmode forever
There could be an additional argument through which custom settings can be specified, for example:
sm_forcertd <target> fasthands "reload:1"
sm_forcertd <target> teamcriticals "range:2000; crits:0"
sm_forcertd <target> powerfulhits forever "multiplier:99"
life
, or forever
-> treat as time,Hi,
Do you have any plans to develop for CSGO?
Feature request roll. In Freak Fortress and Saxton Hale you can lose your shield if the hale hits you and it blocks some damage. A roll just for Demos that restores your shield would be cool.
Handle from TR_TraceRayFilterEx is not deleted. Dummy.
Line 289 in 12c80eb
When i try to load the pre-release version of the plugin i get this message "[SM] Plugin rtd.smx failed to load: Native "ArrayList.BlockSize.get" was not found." how can i fix it?
btw. when i downgrade to the pervious version it works just fine.
TF2_SetPlayerPowerPlay causes a issue that if certain conditions are met it causes TFCond_Taunting to not fire properly.
On my FF2 server I use the TauntCrits plugin that gives crits to a player for a time after they finish taunting. I was made aware of a issue were players reported to me after they rolled PowerPlay they could no longer get Taunt Crits unless they rejoined the server or the map changed. After much testing I was able to recreate the problem.
Doing the above 3 steps will cause seemingly any function that looks at TFCond_Taunting to not fire.
This problem only happens if TF2_SetPlayerPowerPlay is present. If I remove this line:
TF2_SetPlayerPowerPlay(client, true);
Then it works perfectly fine. Something in PowerPlay itself is causing it.
Solution:
We edited PowerPlay so when it is rolled before it gives any perks it will remove TFCond_Taunting from the player, causing them to stop taunting, then 0.1 seconds later gives the PowerPlay perks. I hope this edit might be able to be added to the official version or at least given a CVAR to toggle this on for people who are having issues like myself. Thanks.
powerplay.zip
If you roll a timed perk and during the perk the round ends the timer still counts down. This continues into the next round as well. With the timer still running you can't RTD again next round until the timer runs out.
Example:
sm_forcertd @me 4 120
I get the Fly ability for 120 seconds. I slay everyone on the other team. The round ends and I can still Fly and the timer still counts down. Next round when I spawn I can no longer Fly but the timer is still counting down and I if I type rtd I get the message "[RTD] You are already using RTD."
Please fix it so on round end or round start the timer gets reset so people can rtd again right away. Thanks.
The Fast Hands roll uses attributes 6 and 97 for increased fire rate and reload speed respectively. The issue is that they override the weapon's same attributes and then remove them completely when the roll is up (any from of loadout regeneration fixes this). While not completely game breaking it can be bad in say MvM as it would replace the fire rate and reload speed upgrades on your weapons. I know this is an issue that can't be fully fixed but may I suggest using attributes 549 and 548 instead, these attributes are only used in the vanilla game for the minify spell and are only applied to the player, not the weapons so it wouldn't interfere with weapon fire rate and reload speeds attributes in normal gameplay.
Playing a server running MvM and RTD, friend rolled smite and died, I revived them and the effect became permanent on them, causing them to repeatedly take damage/die without constant healing. This persisted through further reviving, respawning naturally, and even reconnecting or map changing. Rerolling does remove the effect.
https://github.com/Phil25/RTD/blob/master/scripting/rtd/perks/extrathrowables.sp#L41
Need to add this item ID 1190.
As discussed on Discord; you provided a great suggestion:
RTD2_AddRollerTime
Direct quote:
Not through a module or without a bit of changes to the plugin core. Internally, there are two timers run when perks are rolled, Timer_Countdown every second for updating HUD and Timer_RemovePerk with hardcoded time which removes the perk. Technically Timer_Countdown can be the only one used which will allow for dynamic time. With this it should be doable to expose sth like RTD2_AddRollerTime to modules in 2.4.1.
Hoping to see this implemented soon as I want to do some "rather advanced" RTD behaviors.
I've put sm_rtd2_disabled "noclip" and plugin said that Noclip perk is disabled but players can roll it.
Players constantly complain to me that this perk causes them to get a small lag spike if anyone uses it. Not 100% sure what causes it but probably the SFX. I've had to remove this perk from all my servers because of the complaints. If this could be resolved would be very nice.
Displaying a perk description when it gets applied to a player.
sm_rtd_showdescription?
I have my numpad keys bind to join_class
(1-9 respectively) and have hud_classautokill
set to 0
. With these two features combined, you can cancel any RTD roll that has a timer early, starting the cooldown earlier. I have abused this feature multiple times to immediately cancel the effects of a bad roll while outside of a spawn room, making (most) bad rolls completely useless. Would it be possible to, either via a convar or as a standard feature in the plugin, prevent join_class
commands from ending a roll early?
Some possible options include:
join_class
command until the roll has completed (if possible)hud_classautokill
client cvar (if possible) to control this behavior?L 01/06/2020 - 19:25:12: [SM] Exception reported: Entity 6 (6) is invalid
L 01/06/2020 - 19:25:12: [SM] Blaming: rtd.smx
L 01/06/2020 - 19:25:12: [SM] Call stack trace:
L 01/06/2020 - 19:25:12: [SM] [0] SetEntProp
L 01/06/2020 - 19:25:12: [SM] [1] Line 627, rtd/stocks.sp::TriggerSpeedRecalc_Frame
It just removes your head but you would still play normally, so gameplay-wise the only thing that would happen is that people can't headshot you for like 30 seconds
I see that this plugin uses the server language (LANG_SERVER) instead of a function like this. What the LANG_SERVER does is basically use this setting instead of using the client's language.
Can you change the plugin in a way that it shows the translated phrases based on the client's language and not on the server language? This is what most plugins do.
Thanks in advance.
You should define special MAX_PERK_NAME_LENGTH or just multiply (MAX_NAME_LENGTH * 2) for sPerkName vars so name string will fit (without truncating) all Cyrillic symbols for chat.
Also i don't have FriendlySimple include so you should replace this:
#undef REQUIRE_PLUGIN
#include <updater>
#include <friendly>
#include <friendlysimple>
to
#undef REQUIRE_PLUGIN
#tryinclude <updater>
#tryinclude <friendly>
#tryinclude <friendlysimple>
then:
bool g_bPluginUpdater = false;
bool g_bPluginFriendly = false;
bool g_bPluginFriendlySimple = false;
to
#if defined _updater_included
bool g_bPluginUpdater = false;
#endif
#if defined _friendly_included
bool g_bPluginFriendly = false;
#endif
#if defined _friendlysimple_included
bool g_bPluginFriendlySimple = false;
#endif
and at last, IsPlayerFriendly() function, from:
bool IsPlayerFriendly(int client){
if(g_bPluginFriendly)
if(TF2Friendly_IsFriendly(client))
return true;
if(g_bPluginFriendlySimple)
if(FriendlySimple_IsFriendly(client))
return true;
return false;
}
to:
bool IsPlayerFriendly(int client){
#if defined _friendly_included
if(g_bPluginFriendly)
if(TF2Friendly_IsFriendly(client))
return true;
#endif
#if defined _friendlysimple_included
if(g_bPluginFriendlySimple)
if(FriendlySimple_IsFriendly(client))
return true;
#endif
return false;
}
This can help with compiling without Updater, Friendly or FriendlySimple includes.
If you roll Incline Problem it doesn't go away after the set time. The only way to make it stop is by dying or the round ending.
Here is my config for this perk.
"55" //Makes it difficult to go up inclines
{
"name" "Incline Problem"
"good" "0"
"sound" "vo/spy_dominationheavy02.mp3"
"token" "inclineproblem"
"time" "0"
"class" "0"
"weapons" "0"
"tags" "inclineproblem, incline, slope, problem, stair, stairs, climbing, step, steps, bad"
"call" "InclineProblem_Call"
}
There are two configs considered for perk configuration: rtd2_perks.default.cfg
and rtd2_perks.custom.cfg
. Since perks cannot be configured per map (only disabled), this mechanism could be extended to allow just that.
Example:
rtd2_perks.ctf_2fort.cfg
will alter perks when 2Fort is the current map.rtd2_perks.pl_%.cfg
will alter perks for every map starting with pl_
.Order of overrides:
default
custom
I'm making a plugin that adds some additional perks. I've made sure that every perk file has ran RTD2_DisableModulePerks
, as well as in the main plugin file.
I'm unsure if this is my plugins fault, or if this is RTDs fault, but I thought I'd post here just in case.
Here's what sm_rtds
returns after running sm_rcon sm plugins reload chens-rtds
FFD700[RTD]� 78 perks found matching given criteria.
0. Godmode
2. Lucky Sandvich
1. Toxic
3. Increased Speed
4. Flying
5. Low Gravity
6. Full Übercharge
7. Invisibility
8. Infinite Cloak
9. Criticals
10. Infinite Ammo
11. Scary Bullets
12. Spawn Sentry
22. Blind
13. Homing Projectiles
23. Strip to Melee
14. Full Rifle Charge
24. Beacon
15. Explode
25. Forced Taunt
16. Snail
26. Monochromia
17. Frozen
27. Earthquake
18. Timebomb
28. Funny Feeling
19. Ignition
29. Bad Sauce
20. Low Health
30. Spawn Dispenser
21. Drugged
31. Infinite Double Jump
32. Powerful Hits
33. Big Head
34. Tiny Mann
56. Spring Shoes
35. Firework
57. Lag
36. Deadly Voice
58. Drug Bullets
37. Strong Gravity
59. Long Melee
38. Eye for an Eye
60. Hat Throw
39. Weakened
61. Madaras Whistle
40. Necro Mash
62. Sickness
41. Extra Ammo
63. Wasted Roll
42. Suffocation
64. Mercs Die Twice
43. Fast Hands
65. Drunk Walk
44. Outline
66. Hell's Reach
45. Vital
67. Cursed Projectiles
46. No Gravity
68. Vampire
47. Team Criticals
69. Bat Swarm
48. Fire Timebomb
70. Pumpkin Trail
49. Fire Breath
71. A Call Beyond
50. Strong Recoil
72. Smite
51. Cursed
73. Overheal Bonus
52. Extra Throwables
74. Reverse Eye for an Eye
53. PowerPlay
75. One Shot
54. Explosive Arrows
76. Deflector
55. Incline Problem
77. My Perk
This is the main portion of my plugin
public void OnPluginStart()
{
if (RTD2_IsRegOpen())
RegisterPerks();
}
public void OnPluginEnd()
{
RTD2_DisableModulePerks();
// ------
ReverseEyeforanEye_DMP();
Oneshot_DMP();
Deflector_DMP();
SpeedCrouch_DMP();
}
public void RTD2_OnRegOpen()
{
RegisterPerks();
}
void RegisterPerks()
{
// Leading comments are IDs
ReverseEyeforanEye_Init(); // 0
Oneshot_Init(); // 1
Deflector_Init(); //2
SpeedCrouch_Init(); //2
}
Whole new feature which allows good perks to be dropped on the ground and shared with other players.
dropitem
command (intel prioritized first).Encourage teamwork even more by giving people a chance to drop their current perk via dropitem
command (default L
).
This will be a very obscure feature by itself and people won't know about it since there really isn't a good way of informing without a message, which RTD is not going to show. I think that's fine.
This feature could be also used to steal good perks from enemies.
PowerPlay (8s)
).sm_rtd2_perk_drop_max 5
-- max perks dropped at a time (limit 5).sm_rtd2_perk_drop_death 1
-- should good perks be dropped on death.sm_rtd2_perk_drop_self 1
-- should good perks be droppable manually by player.sm_rtd2_perk_drop_time 10
-- time after which dropped perks disappear.sm_rtd2_perk_pickup_time 2.5
-- time needed to pick up a dropped perk.Since perks do have conditions on what players can use them (soon to have a dedicated method of calculating such eligibility), some perks cannot be picked up by some players. This can be indicated by a negative beep noise when they approach it plus a chat message (ex. [RTD] You are not eligible for Infinite Cloak.
). This message is on a cooldown of 3s per dropped perk, one reason is not to flood the player's chat, but also because the eligibility calculation is potentially expensive.
God mode doesn't provide complete immunity from damage in certain situations. Being Goomba Stomped or certain map damage or on Freak Fortress certain boss abilities can hit through God Mode.
A way to fix would be to add whatever protections you have on Power Play to God Mode. That mode seems to have added protections.
Perk config is very versatile, but it can be even more so.
There could be an unused-by-default call
function which is able to execture commands provided via perk's settings, for example:
"myslapperk"
{
"name" "My Slap Perk"
"good" "0"
(...)
"settings"
{
"command" "sm_slap"
"arg1" "%target%" // %target% gets replaced with user ID player who rolled the perk
"arg2" "100" // slap damage
}
"call" "CustomCommand_Call"
"init" "CustomCommand_Init"
}
The command can be provided via the command
setting and its arguments through consecutive argN
settings. The function called CustomCommand_Call
will parse and build a command that is run on the server, targeting the player who rolled this particular perk.
%target%
will be replaced with the user ID of a player by RTD, to make sure addressing is unique and not name-dependent. Furthermore, %target%
can be specified in any argument, since it's up to the command to define which argument is the target.
CustomCommand_Init
will verify whether the command is valid and is safe (see section below) to run while the config is parsed. This is helpful for debugging because you can see a message in the server logs whether you configured something incorrectly.
Running server commands in an unsolicited way is bad. CustomCommand_Call
will always check flags of the provided command. Commands will the following flags should error out without being executed:
If you roll Vital or Lucky Sandvich it gives you more health. With your extra health if you then get a head with the Eyelander demo weapon it will set your health back to normal. This issue was seen on my Saxton Hale server.
It's not gonna be supported soon and you shouldn't have done it in the first place. What were you thinking?
Due to demand, perks which were changed in the 2.4.0 should be configurable to legacy version by server operators.
legacy
-- Use pre-2.4.0 PowerPlay (default 0
)fight_back
-- Enemies can fight back (default 1
)legacy
-- Use pre-2.4.0 Bat Swarm (default 0
)annotations
-- Add annotations which follow enemies (default 1
)unblind
-- Briefly unblind on dealing damage (default 1
)-1
uses pre-2.4.0 Explodeignite
-- Ignites player (default 1
)damage
-- Deal damage to player, -1
to explode (default 0
) (#88)-1
uses pre-2.4.0 Smite-1
does not spawn cases.legacy
-- Use pre-2.4.0 Frozen (default 0
)mark_death
-- Marks for death (default 1
)Can anyone update plugin,
problems with Sourcemod - 1.11 compile
64 | Mercs Die Twice | New effect, Allows player to call MEDIC! to respawn in place if killed by an enemy. Suicides cannot be respawned from. Potential Bug: you are able to respawn in place more than one time per roll. BUG: If the rolling player decides to not respawn, and is continually killed by a dps class (You still have 1 health, but you ragdoll under this effect, allowing for more damage/kills). Rolling player will be completely invisible, weapons and all, upon calling Medic. This invisibility lasts until the roller is killed after the roll expires, and instead only the player model is still invisible, cosmetics and weapons reapear on normal respawn. This model-only invisibility persists through class change, death, team change (Including Spectator), and can only be fixed by reconnecting to the server via "retry" or manual reconnection.
I noticed that whenever I used the bumper car taunt in TF2, Forced Taunts did not work (the user can essentially skip any of the forced taunts they wish until the timer runs out.
In forcedtaunt.sp there is no check for this, and I am not fluent in any ways of making mods for any source games, neither am I fluent in C (beginner at C, only 1 month experience in low-level programming), but I can still see from variable names and others that no such check for this exists. Instead, the mod assumes that the taunt you are in was made by itself with no way to keep track of the taunts that itself created.
Since I'm not experienced in C or source mods, I can only give suggestions or pseudocode with fake variable names to get someone who does know an idea.
Feature request, something like team crits but instead of crits it heals players around you.
When Brass Beast is revved up, it applies slowdown.
If snail perk expires, all slowdown debuffs are removed INCLUDING one put by Brass Beast.
Unrevving and revving fixes this issue.
^ title
as for translation names you may add new parameter to cfg like "TranslationName" or something like that.
And if perk has missing "TranslationName" parameter it will override and use "Name"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.