This is [TF2] Randomizer (http://forums.alliedmods.net/showthread.php?t=98127) remade using asherkin's TF2Items extension.
When enabled, players are set as a random class with random weapons, which re-roll upon being killed.
This randomizer, however, is able to give all the weapons, not just the few ones that have unique weapon classnames.
CVARS - default values in parentheses
Spoiler
tf2items_rnd_version(1.591 ): Of course, version number. Do not place in server.cfg.
tf2items_rnd_announce(1): If set to 1, announces Randomizer by FlaminSarge, info about what Randomizer is, and about the /myweps command (when a player first spawns in or when the mod is enabled).
tf2items_rnd_enabled(0): Enabled if 1, disabled if 0. This also disables the pyro fix and spy fix if 0, but not the other fixes.
tf2items_rnd_normals(0): If >0, increases the rate at which each slot rolls normal. If -1, disables rolling normal (rolling normal means Randomizer will use the client's normal loadout for that slot).
tf2items_rnd_destroy_buildings(1): Destroys a Engineer's buildings when he respawns as a different class.
tf2items_rnd_fix_spy(1): Undisguises Spies when attacking. Set to 1 to undisguise on all attacks (not including sapper, disguise, drinks, and food!). 0 to not use this fix.
tf2items_rnd_fix_uber(3): Emulates Medigun for non-Medic classes (heal beams and uber/kritz). Set to 1 for just healbeams, 2 for just ubers, and 3 for both (0 for none).
tf2items_rnd_godweapons(1): Allows players to roll the golden wrench and Headtaker (if 0, replaced with normal wrench and eyelander).
tf2items_rnd_fix_food(1): Emulates Bonk! Atomic Punch and Crit-a-Cola effects for non-scouts. Will eventually do the same for Sandvich and Dalokohs.
tf2items_rnd_fix_reload(1): No longer does anything right now.Used to fix unlockable revolver and syringe reload rapidfires (note: to the player, they still rapidfire, but it shows as not shooting to others, and does no damage, if they hold down Reload and Attack. Also, 1 second delay after pressing reload to attack for those weapons).
tf2items_rnd_betaweapons(1): Changes Ludmila into Natascha if 0.
tf2items_rnd_customweapons (1): Changes Texan Love into Frontier Justice if 0.
tf2items_rnd_gamedesc(1): Optional, if you have SteamTools, and this is 1, it'll set the gamemode to [TF2Items]Randomizer vVERSION.
tf2items_rnd_cloaks(1): If enabled, spy cloaks are randomized. You roll between default, Invis Watch, Dead Ringer, and Cloak and Dagger. If you roll InvisWatch, you have a 50% chance for it to be an Enthusiast's Timepiece.
tf2items_rnd_debug(0): If enabled, logs debugging lines to console. Not advised.
COMMANDS (Admin only)
Spoiler
tf2items_rnd_enable (default "convar" flag) - Changes enabled cvar to 1
tf2items_rnd_disable (default "convar" flag) - Changes enabled cvar to 0
tf2items_rnd_reroll <target> (default "cheats" flag) - rerolls and respawns a specific person. No target specified = reroll self.
sm_reroll <target> - same as tf2items_rnd_reroll
tf2items_rnd_set (default "cheats" flag) - Set a client's loadout: tf2items_rnd_set <target> <class> <weapon 1 index> <weapon 2 index> <weapon 3 index> <cloak index>. Any indices not found will be ignored. The last parameters are optional (so you can do "tf2items_rnd_set target class wep1" to just set class and wep1), and to set "no change", use "_", an underscore, for the parameter.
rnd_set - same as tf2items_rnd_set
COMMANDS (For everyone, not just admins)
tf2items_rnd_loadout - Displays your current items again, prints them to chat, and opens a menu showing the stats of any custom weapons you have.
sm_myloadout - same as tf2items_rnd_loadout
sm_myweps - same as tf2items_rnd_loadout, so tell your users to use /myweps or !myweps in chat.
Installation (SM1.5+)
1) Install TF2Items and TF2Attributes (links are elsewhere in this post, it might do some good to take the time to find them).
1b) Optionally install SteamTools (search for it!) to automatically change the game description (in the server browser) when Randomizer is enabled (as per the cvar).
2) Place tf2items_randomizer.smx in tf/addons/sourcemod/plugins/
3) Place tf2items.randomizer.txt from here in tf/addons/sourcemod/gamedata/
4) Restart the server if you want to be absolutely sure things load properly.
Download the .smx file rather than clicking 'Get Plugin'.
Compile requirements: tf2items.inc file from TF2Items' download package, as well as tf2attributes.inc from TF2Attributes. If you want the SteamTools Game Description feature, compile with steamtools.inc too.
Voting:
If you have the "Custom Votes" plugin installed on your server, you can use the tf2randomizer.vote.cfg with it (put in addons/sourcemod/configs/customvotes folder) to add a vote for it (chat trigger is /voterandomizer).
Just like the old Randomizer, [TF2Items] Randomizer uses OnGameFrame for the uber fix and Baby-Face fix, so disable those two (with the cvars) if you get laggy (but then mediguns won't have heal beams and can't uber, and the Baby-Face won't add speed).
By preference I had the plugin-enable cvar at 0 by default. All players respawn when this cvar is changed.
The Randomizer displays team-colored HUD text on locker touch/spawn, listing what weapons you have.
The Wrangler's an unlucky roll for most classes.
*The custom weapons currently in Randomizer are: The Texas Ten-Shot, the Army of One, Fighter's Falcata, Khopesh Climber, Rebel's Curse, Jar of Ants. *The beta weapon in Randomizer is Ludmila.
Changelog
Spoiler
Code:
08/11/2013(v1.591)
*Fixed an issue with empty attribute strings (fixes stock weapons not being given)
*Added Large Explosion smoke to the Army of One
*Spies now receive build boxes at the same time everyone else would (when they have a wrench/Gunslinger)
08/06/2013(v1.59)
*Fixed error in SickleClimbWalls for Quick-Fix jumping.
*Fixed BabyFace effect never getting removed after respawning.
*Tried using the suggested method for attaching the Medibeam particles to the Medigun. Let me know if it looks weird or looks worse than the previous Medibeam particles.
*Fixed model crash - you need the VPK linked in the plugin's instructions. If you can't find it, you're not looking quite hard enough.
07/20/2013(v1.58)
*TF2Attributes is a dependency now which makes some effects a lot cleaner (the BabyFace fix, for instance, no longer momentarily stops you when you switch weapons). Only a few things use it right now, but more will soon.
*sm_cantsee will make a client's active weapon transparent, you can tell them to use !cantsee or /cantsee in chat.
*Buildings are no longer weird and won't crash. You can have a Sapper and a Wrench at the same time and you'll build with the build box and sap with the Sapper, never vice-versa.
*Charge (shield) indicator now works properly.
*Fixed Megaheal causing issues with eating/Phlog/Eureka
*Heavy mediguns now hang out around his waist instead of at map origin
*Charge bash resets properly after charging (on non-Demo, it used to only ever bash once til you went to resupply)
*Fixed rnd_set command behavior
*Khopesh Climber will cause Quick Fix medics to jump as well, if healing the jumper.
*More accurate Eureka teleporter particles
*Dalokohs/Fishcake buff applies directly to weapon instead of granting a new weapon.
*Spy undisguises on Mangler Alt-fire shot properly
*Fixed percentage sign on Vaccinator charge
*Added Ap-Sap, Ham Shank, updated attributes on weapons
*tf2items_rnd_normals now accepts "-1" as a value, which disables rolling "Normal" completely.
*I probably missed a few things in this list, but oh well.
12/22/2012(v1.57)
*Fixed handle leak with metal fixer
*Added new weapons (let me know if I missed any)
*Amputator taunt works on all classes
*Merasmus kills reroll players
*Bots won't get build tools with stuff (hopefully prevents a Sapper crash)
*Fixed an issue where max metal became 400
*Added Crits counter for Diamondback, Frontier Justice
*Detonation timer for Loose Cannon
*Charge meter for Huntsman
*Changed Chargin' Targe/Splendid Screen to only activate if reload is held down while pressing altfire
-Charge instructions for Chargin' Targe/Splendid Screen ("Charge: Reload+AltFire") display in HUD
*(Hopefully) fixed BabyFace/Charging conflict
*Remember to update GiveWeapon as well if you've got it running, since a lot of Randomizer stuff shuts itself off when GiveWeapon's on (so both plugins don't provide item effects)
10/22/2012(v1.56)
*Fixed an issue in the tf2items_rnd_set command
10/21/2012(v1.55)
*Added Sappers
*Added Sleeping Dogs weapons
*Updated Pomson/other weapon attributes
*Fixed reloading exploits/bugs
*Fixed Ludmila not behaving properly
*Altered Ludmila's viewmodel appearance
*Fixed Market Gardener not working on all classes
*Build as any class if given a wrench/unlock/Gunslinger
*Fixed max metal to be 200 for all classes
*Fixed Engineer's buildings being destroyed when touching a weapons locker (having an Engineer melee will still cause it to occur, but having a non-Engineer melee will not)
*Fixed Bison/Mangler/Pomson charge display
*Reduced Rocket/Sticky Jumper health buff
*Added support for upcoming custom viewmodels
*Added tf2items_rnd_set/rnd_set command to set next roll
*Fixed Baby-Face's Blaster speeds on all classes
*Fixed ammo pickups
*Experimental Southern Hospitality viewmodel animation fix
*Army of One rocket size (appearance) increased
*Fixed crits/minicrits while using Chargin' Targe/Splendid Screen
06/30/2012(v1.54)
*Pyromania weapons
*Other weapon updates (Equalizer, Enforcer, Jumpers, etc)
*No longer shuts out TF2 Beta (though I can't guarantee it'll work)
*Removed GetMaxHealth SDKCall
*tf2items_rnd_fix_uber changed, see "CVARS" section for new behavior
*tf2items_rnd_debug cvar added
*Eyelander heads for all classes (beta)
*Your Eternal Reward disguising for all classes (beta)
*Fixed a possible entity leak
*Dispensers built by non-Engineers should destroy properly now using the Destroy Tool.
*Various other things I can't list right now
05/01/2012(v1.53)
*tf2items_rnd_announce cvar, see "CVARS" section
*tf2items_rnd_loadout commands for re-displaying weapons, explaining custom weapons. See "COMMANDS (For everyone, not just admins)" section
*HUD text for meters that were missing (for all except Charging)
*Ubersaw now gives uber to non-Medics if they have a medigun.
*Tweaked for better compatibility with GhostMode
*Phlogistinator now activates on all classes
*Soda Popper now builds Hype on all classes
*EXPERIMENTAL: Gives build tools to build a Dispenser if you have a wrench as a non-Engineer (except Spies)
*Huntsman arrows ignite on the torches in Medieval Mode
*Cozy Camper now sorta-works on all classes
*Eureka Effect now works on all classes.
*Fixed Bonk + Intel exploit
*Tweaked ubers to work a bit better
*Updated Cozy Camper attributes
*Renamed Jar of Ants to "Ant'eh'gen". Custom model by Reag will be available soon.
*More screen-blocking fixes for the Quick-Fix/Kritzkrieg. Will be making them for a few other items soon.
03/18/2012(v1.52)
*SteamTools for Game Description "[TF2Items]Randomizer v1.52" (optional)
*Cozy Camper and Black Rose
*Phlogistinator adjustments (as per Valve)
*Charging (Targe/Screen) on any class*Banner weapons now work on any class
*Started implementing Head collection (for Eyelander, Nine-Iron, Headtaker)
*Now properly detects Medieval mode for any map
*Fixed Engineer Hauling with Half-Zatoichi/Steak
*Cleaned up Heal Beam code, added Kritz/QF heal beams
*Fixed up Uber code
*Text that shows you your weapons is now team-colored
*Some fixes to the ball regeneration code
*Demoman can now taunt with the Pan
*Bots no longer have their ammo changed (so they stop camping supply lockers)
*Bots no longer receive lunchbox weapons (so they stop eating/drinking profusely)
*Changed up the way Randomizer changes classes: Now, gives other plugins preference over what class to set the client as (NOW WORKS WITH ZombieFortress!)
01/15/2012(v1.51)
*Winter 2011 items
*Fixed ubers
*Fixed a bug with Medics turning into other classes with Randomizer disabled.
*Fixed ammo bugs (except for getting ammo from dispensers).
11/28/2011(v1.50)
*Apoco-fists, Sharp Dresser
*Wanga Prick fixes
*No longer crashes when using with other mods that force player class (Sudden death melee only, Zombie Fortress, etc). As a side effect, this plugin will override whatever class those plugins set the player to.
*Being killed by Monoculus will reroll you.
*Heavies with the HHH Headtaker will see it as partially invisible, as it blocks player view.
11/10/2011(Gamedata update)
*Redownload tf2items.randomizer.txt
10/27/2011(v1.49)
*Halloween 2011 weapons (Wanga Prick, Unarmed Combat)
*Changed RemoveEdict to a Kill input
10/15/2011(v1.48)
*Manniversary weapons (Scottish Handshake, Bootlegger, Conscientious Objector)
*Atomizer changes! You can now double jump if you're a non-scout with the Atomizer.
--I coded it to behave as nearly like the normal double jump as possible.
*Manniversary attribute updates (e.g. Widowmaker changes)
09/25/2011(v1.47)
*Changes to weapon attributes that Valve did (e.g. Sticky Jumper)
09/07/2011(v1.46)
*Added Deus Ex weapons
*Removed pyrofix cvar (tfcond_slowed now properly slows pyros)
*Fixed spy watches randomizing when the normals cvar was set
*Tried fixing a rare client crash on scoping and touching a locker
*Fixed Persian Persuader adding ammo to players
*Fixed the application of the reload fix to default revolvers/syringe guns (which don't need it)
*Heavy, Pyro, and Soldier can now taunt with the Family Business and Reserve Shooter.
08/10/2011(v1.45)
*Fixed an "array index" error related to the Original
*Moved the text telling you your weapons on spawn/locker touch from hint text to hud text, up nearer the top of the screen.
08/03/2011(v1.44)
*Steak for all classes
*Any updates to uber weapons
*Postal Pummeler and Nessie's Nine-Iron
*Cow Mangler and Righteous Bison
*The Original
06/25/2011(v1.43)
*Uber update weapons
*Any fixes associated with uber update weapons.
06/15/2011(v1.42)
*Added Maul and Saxxy
*That's it.
5/29/2011(v1.41)
* Fishcake and Three Rune Blade
* Fixed the OnGameFrame error for healbeams
5/3/2011(v1.4)
*Visweps now optional when compiling
*Shogun weapons finally in
*Detonator, Quick-Fix, and Beta Syringe Gun added
*Gamedata changed
*All timers use userids now
*String check changes (strcmp)
*Fixed issues with round end weapon assignments
*Can only use food items while standing on the ground
*Hatless Update attribute changes
*Attempts at changing the Targe's merge
*Transparent Sniper FaN viewmodel
*Attempted to fix the Steak Heavy using Minigun fix
2/24/2011(v1.3)
*Wearable weapons now in the rotation
*Added Jar of Ants
*Fists viewmodel is back to the old v_model
*Rebel's Curse now uses Lightning effect, hopefully
*Reload slowed down for the FaN and Shortstop on non-scouts
*Added correct ammo regen for picking up fallen weapons
*Fixed that pesky Timer error
*Ubers are still weird and buggy.
*Rift weps
*Khopesh Climber is now level 11
*If a player tries to use a primary weapon with the steak, it forces him to switch back to melee (since the melee-only-while-steaked seems to only apply if it's a heavy melee).
1/9/2011(v1.2)
*Added tf2items_rnd_cloaks cvar to control whether cloaks get randomized.
*If on Degroot Keep, medieval rules apply now.
*Made it so weapons that normally block the screen (or at least the crosshair, such as kritzkrieg on sniper) are partially invisible, so you can see you have it out, but see through it too, whenever it's given now.
*If Mecha the Slag joins your server and gets a Khopesh Climber, he gets a self-made one. Makes sense, no? I haven't done this for the weapons I made.
*If using with VisibleWeapons, all weapons should now have models. Ludmila uses Sasha with the Natascha band. The Khopesh Climber uses a custom model (download link will be in the aforementioned box below). The Rebel's Curse does too. Other ones use their base item models for now, e.g. Army of One uses Black Box.
*Some fixes to weapon attributes
*new, Rebel's Curse= Purple glowing, pulsing wrench. Right now, for viewmodel, its partially invisible and a bit darker than a golden wrench. I am going to try to get it to fade in and out later. It has attributes. Might need some balancing.
*Improved compatibility with TF2 Equipment Manager and other attachables faking as wearables.
*Tweaked Rebel's Curse/Khopesh Climber effect activators slightly to improve compatibility w/ Give Weapon.
*Pyro fix now works right, even if randomizer is off and they have a minigun. They can't move during preround freeze.
*Banners and the new Steak don't have effects yet. Neither does the Wrangler. Sorry.
*Biggest change: All classes can get all weapons in the Randomizer now! And that frontierjustice-like shotgun is now a normal shotgun.12/18/2010 (v1.11)
*Allowed Demomen and Soldiers to roll the Shovel-based weapons (Pain train, equalizer, shovel, bottle, pan, etc)
*Allowed scouts and engineers to roll the Lugermorph
*Fix for autoreload exploit
*Fixed dalokohs (may just end up stripping the slot on some servers. it's a server bug, idk how to debug it, but now, if it does work, itll add health right)
*New gamedata required to fix the dalokohs and other health bugs
*Fixed health bugs! no more immortal people
*Normals cvar
*Australian Christmas weapons
*Invisible'd the Kritzkrieg on medic and engineer, and the degreaser on medic. It'll be shadowy so you can see that you have it out but you can also see through it (won't block screen)
*Added compatibility with visible weapons (check the installation section!)
*Added Khopesh Climber
11/14/2010 (v0.991)
*Added Jarate, Milk, and Sandman ball regen
*Fixed spies being able to attack without undisguise with KGB GRU and fists
*Added Headtaker, Fighter's Falcata, the Army of One
*Dalokohs adds max health when eaten, but does not heal you up to that max health for some reason :/
*Autodisable on ZF maps.
*Ubercharges finally charge the healer, but only occasionally :C
*Custom weapons now show "Customized" next to them: Ludmila, Texas Ten-shot (also has a domination symbol on it :P), Army of One, Fighter's Falcata.
*Fixed some bug where the cvar would stay 1 on mapchange but randomizer would be off.
*If you roll both the Jumpers, you get the sticky jumper and the normal rocket launcher. You also get a bonus of 300 overheal on locker touch (sets to 300, not +300), to offset the jumper's nerfitude.
10/31/2010 (still v0.95)
*Added a tf2items_randomizergamedesc helper plugin that should automatically change the Game description to [TF2Items] Randomizer v(version). Adapted from psychonic's Game Description Override plugin.
Please let me know if it works.
*Be patient, Halloween update is coming soon. Still trying to fixed bugged dalokohs, unless it doesn't matter to you?...
10/07/2010 (v0.95)
*Added Bonk/Critacola effects for non-scouts
*Fixed "no ammo" for some secondary weapons
*More cvars
*Removed Texan Love
*Fixed reload exploit
*Fixed ubers, hopefully
*Added back buff banner and the other banner since Valve seems to have fixed the sandman bug with those
*I forget what else. Lots of stuff for just +0.05 of a version :3
*oh, sm_reroll does the same as tf2items_rnd_reroll
*durr, added polycount weapons >.<
9/27/2010 (v0.9)
*Added tf2items_rnd_enable and _disable commands for default Convar flag admins that changes the enabled cvar
*Added tf2items_rnd_reroll for default same admin flag, rerolls the target specified
*Fixed ubercharge and kritzcharge effects
*Spy fix 2 now does not undisguise on sapper, food, drink, disguise kit
*Removed Engy Shotgun and Bottle (NULL Bug)
09/25/2010 (v0.8 )
* First public release.
Known Bugs
*Ammo is set correctly when the weapon is given, but when players pick up ammo boxes, the ammo sets to what the class normally would get from the pack. Sorta-fixed, actually, for the most part, though you might see some strangeness occasionally.
*Not really a bug, but I left in a lot of the old randomizer code including the ammo fixes (they're commented out).
*Blutsauger health loss is not a glitch, it is it's normal nerf. It needs the -2 hp per second for balance. Get moving!
*Be wary of using plugins that force player class, such as Zombie Fortress. While this plugin defers class changes to other plugins, and should not crash, please let me know if it does.
Credits
Spoiler
General-Q, California Bear, Rowedahelicon, jameless- testing this on various servers
asherkin, _1Swatty- tips and scripts
Theme97, Darkimmortal- original versions of Randomizer
DarthNinja, naris- SetSpeshulAmmo and other ammo stocks
captainAngry and the calculatedChaos group- hosting this forever
Where can I try this out before I install it? These servers are running with this mode enabled, though some may be modified versions.
...
This was my first public plugin. Things are bound to be turrible.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.
All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions. Steam is for playing games.
You will be fed to javalia otherwise. Psyduck likes replays.
Awesome. Also, feel free to request custom items to add, as I can code those in. If anybody can help, I can convert the hardcoded arrays of weapons into a keyvalues file that lets users include their own weapons and choose which they want.
Only thing I can POSSIBLY ask of you is to add this to the admin menu (to call a vote for randomizer or not) because often I run a server without it on and if I can set a flag for my admins / donators to call a randomizer vote I will probably kiss the ground you walk upon.
But yeah bud, you did damn good.
EDIT: Sir, I don't think I can stress the importance to me if you could get that vote thing done built into the admin menu...
It'd be preferred if you could work it into the admin menu but a chat trigger would suffice too.
Once again, you did amazing with this mod, but if it is possible I BEG you to do this for me.
I'm not sure how to add vote options into the plugin itself (looking at Melee Only plugin to figure out) but you can use this: http://forums.alliedmods.net/showthread.php?p=633808
to set up a custom vote for Randomizer on or off. Here's what I came up with to put in the "configs/customvotes/tf2itemsrandomizer.vote.cfg" for that plugin (automatically goes into the voting commands section of admin menu):
I highly suggest you read the instructions for the plugin, as I came up with the above config in about two minutes and it might not be right.
EDIT: Also in 0.9 (still testing!) I improved some stuff, added a /tf2items_rnd_enable command to set the tf2items_rnd_enabled cvar to 1 (as well as ..._disable for 0).
If the tf2items_rnd_fix_spy cvar is at 2, you won't undisguise if you attack with sapper or the Disguise kit or Bonk! or Crit a cola or Sandvich or Dalokohs. Please remind me of anything else that doesn't attack to add to this "safe list".
I also tried fixing ubers, but I have not tested that yet, so that's why 0.9 is still in testing