Left 4 Dead 2

Left 4 Dead 2

57 ratings
Item Randomizer (Vscript)
   
Award
Favorite
Favorited
Unfavorite
Game Modes: Single Player, Co-op
Items: Other
File Size
Posted
Updated
474.942 KB
31 Mar, 2024 @ 11:53pm
7 Apr @ 10:02am
9 Change Notes ( view )

Subscribe to download
Item Randomizer (Vscript)

In 1 collection by kurochama
Useful "Side-Dish" Mods (Especially for Bots)
46 items
Description
This mod has similar functions to Item Conversion (probably it can be called as another variant).

"What makes it different from the 'Item Conversion' mod you have?"

Well, while "Item Conversion" converts items registered in the cfg files to any items you desire, "Item Randomizer" will randomize the results of the converted/ replaced items. So, you'll get random results on each chapter/ round.

On this mod, I gave freedom in adding which items you want to randomize in "item randomizer.txt" file, so you can replace any items, like, if you want more challenge, you can randomize medkits & T2 guns by registering them in the cfg file.

Here are some cfg files available on this mod:
  1. "- (important info, read first) how to register items on cfg files.txt" = Similar to "Item Conversion", this file will provide you some info & simple guides about how to register items. Remember to read this first, at least on first & 2nd points.
  2. "item randomizer.txt" = This cfg file is to register items that you want to randomize.
  3. "randomizer settings.txt" = This contains additional settings for item randomization. for now, there are only 2 features:
    1. "Item Count"= How many times the items can be picked until they disappear (Minimum value = 1. Setting to 0 is the same as 1. Max value= unlimited, but avoid setting the value too high as it might affect the number of entities spawned)
    2. "Randomizer Mode"= This feature can set the ratio of randomized items based on the value. Each value has different mode (examples: Value no. 0 & 1= Default, "Balanced Mode". 2= "Healing-Oriented Mode", more chance for healing items to spawn when randomized. 3= "Throwable-Oriented Mode", more chance for throwable to spawn, etc). Read the info in the cfg file for more details.
    3. "Randomizer Special Feature"= When enabled, survivors can use special features like a special chat command "randomize this" (randomize any object in crosshair), & a special shove "TAB + RELOAD + SHOVE" with primary/ secondary weapon that can randomize any object shoved.
    4. "Randomizer Notification"= You can turn on/ off the notification with this.

Simple mechanisms & guides about how it works:
  • In "item randomizer cfg" sub folder in "ems" folder, you'll see "item randomizer.txt" cfg file. When you click it, you'll see the default contents like this:
    pistol = 1 w_shotgun.mdl = 1 pumpshotgun_A = 1 chainsaw = 1 cone001 = 1
    The names there represent item model names that will be randomized, & the number after the equal symbol acts as activator (0= no randomization, 1= randomization enabled). If you ask about what "cone001" is doing there, it's an item model for traffic cone on map 2 of "Dead Center" campaign. & yes, you can replace any items, including junk/ useless objects on road or in a building, as long as you know the model names.

  • "Item Randomizer" will be triggered immediately in the beginning of each chapter/ round.

  • Alternative way to trigger "Item Randomizer" during play: Press "TAB + RELOAD" when reloading. The "Item Randomization" will happen in 1 second after doing that "special reload method"

  • Once the "Item Randomizer" is triggered, it will show a notification like "ITEM RANDOMIZATION is completed..." on the bottom left of the screen

Bonus Features:
  1. Chat Command to detect model name: While looking at an object, type in chat "check entity model" to check the model name of item in the crosshair.
  2. Special Shoving to detect item model name: Press "TAB + CTRL + SHOVE" & shove an object to detect model name. But it doesn't work on small items/ objects that you can walk through.

*NEW A new cfg file, "custom randomization (randomizermode 10).txt", is available. You can freely set your own randomization results here on this cfg file, when "Randomizer Mode" is set to 10
  • Examples of the list:
    item_01 = weapon_smg_spawn item_02 = weapon_smg_silenced_spawn item_03 = weapon_smg_mp5_spawn item_04 = weapon_pumpshotgun_spawn item_05 = weapon_shotgun_chrome_spawn item_06 = weapon_shotgun_spas_spawn item_07 = weapon_autoshotgun_spawn item_08 = weapon_rifle_spawn item_09 = weapon_rifle_ak47_spawn item_10 = weapon_rifle_desert_spawn

  • The format of items must be like what's on the examples above.

  • There are fixed 40 item results available to be edited freely as you like.

  • As all 40 item results are randomized fairly, each item has 2.5% chance, so, having several same items on different rows can multiply the chance (example: If there are 3 "weapon_melee_spawn" in total on the list, melee will have 7.5% chance to spawn as the randomized items).

  • Items that cannot be registered: laser upgrade, gnome, gascan, propane tank, oxygen tank, cola, & items that don't have "_spawn" classname. Registering these items on the list will cause a bug.

With this mod, you can try to challenge yourself by randomizing any items on each chapter.

Notes:
  • This can work on any campaigns, including any custom campaigns.
  • Let me know if you find any bugs, along with the settings of your cfg files of this mod so I can investigate it more accurately.
Popular Discussions View All (1)
1
7 Feb @ 10:49pm
Mode 10 not working?
I STAPLE TAPEWORMS ON MY
73 Comments
SolRascal 7 Jul @ 2:28pm 
the randomize at the start of each round can be a little inconsistent- but not an issue when im playing on Keyboard and mouse, because i can just "TAB + RELOAD" its only an issue when i use controller and the keyboard is unbinded.

hope you could add a "BACK + B_BUTTON" as an alternative in your mod. or make it to where we ourselves can map those keys. P.S making a randomizer that upon picking up the item it shuffles your inventory:steamthumbsup::LeonRE4:
soge 7 Apr @ 4:27pm 
It worked, sorry for taking up so much of your time, thank you very much
kurochama  [author] 7 Apr @ 3:02pm 
@soge , I never wrote the cfg file in chinese characters, as I'm not good at Chinese language. I usually wrote in English. Probably you can try to open the cfg file with other notepad application, like for example, "Notepad++". I ever heard this kind of problem about chinese characters showing up on cfg files on other mods & the solution was using other notepad application.
soge 7 Apr @ 2:42pm 
I copied your randomizer items list and it still doesn't work even with TAB + RELOAD. I will list some facts that I noticed with some tests:
the file "item randomizer.txt" inside before I add the randomizer list it says "楰瑳汯㴠ㄠ਍彷桳瑯畧⹮摭‽റ瀊浵獰潨杴湵䅟㴠ㄠ਍档楡獮睡㴠ㄠ਍潣敮〰‱‽റഊ", if I leave only this text in the campaign "shopping da morte (ruas)" only the pistol and the shotgun are changed (the pistol becomes a random weapon and the shotgun becomes an incendiary ammunition), if I remove this text from the file and add the list (I added the one you sent me last) the weapons are not randomized and the TAB + RELOAD doesn't work in any of the modes and methods I tested. I also tested adding one weapon at a time to the list and it didn't change anything either :(

(I've even uninstalled the game and downloaded it to another SSD)
kurochama  [author] 7 Apr @ 10:09am 
@soge , I just updated the mod with slight changes on the randomization scripts. You can try it. Let me know if you still experience the problem. On last test before uploading, I listed 17 items like this (not all of them are weapons/ usable items though):
w_shotgun.mdl = 1
chainsaw = 1
pistol = 1
grenade_launc = 1
adrenalin = 1
cone00 = 1
chair = 1
mopbucke = 1
traffic_barr = 1
uzi = 1
smg_a = 1
shotgun = 1
spas = 1
ak47 = 1
m16 = 1
m4supe = 1
metalbucke = 1
& the randomization process was successful.
kurochama  [author] 7 Apr @ 8:56am 
@soge , what error on console was written when it didn't work? Could you check it again? & you can try to simplify the list by writing short names that can includes several weapons at once. For example:
- desert_eagle + desert_rifle >> desert_
- w_shotgun.mdl + pumpshotgun_A >> shotgun
- sniper_scout + sniper_military >> sniper
You can also try to decrease the randomized items & test with TAB + RELOAD, until it starts to work.
soge 7 Apr @ 7:05am 
I decreased the randomized items to 19 items and it still doesn't seem to work, and after TAB + Reload the notification appears that the items have been randomized but the weapons remain the same. I will write here the list of randomized items and below the randomizer settings:
pistol = 1
desert_eagle = 1
uzi = 1
mp5 = 1
smg_a = 1
w_shotgun.mdl = 1
pumpshotgun_A = 1
spas = 1
m4super = 1
m16a2 = 1
ak47 = 1
desert_rifle = 1
m60 = 1
sg552 = 1
mini14 = 1
awp = 1
sniper_military = 1
sniper_scout = 1
grenade_launcher = 1

randomizer settings:
ItemCount = 1
RandomizerMode = 1
RandomizerSpecialFeatures = 0
RandomizerNotification = 1
kurochama  [author] 6 Apr @ 5:50pm 
@soge , have you tried to reduce the list of randomized items? Last time I tried 20 items on the list & it still worked, but I haven't tried more than 20. Sometimes if there are too many items on the list, not all items will be randomized. You can also try to press TAB + RELOAD if the item randomization doesn't happen in the beginnng of chapter.
soge 6 Apr @ 4:16pm 
If it's not too much trouble, could you help me in a case where the mod is not working, I have already put the list of weapons in the item randomizer.txt file, everything as the guide says, but the weapons are the same as in the original campaign, there are no changes (ex: in the first shopping mall mission they are always the standard pistol, axe, crowbar and medkit). I'll send you the list I put in the randomizer.txt item, except for this file I didn't change anything else:
pistol = 1
w_shotgun.mdl = 1
pumpshotgun_A = 1
chainsaw = 1
desert_eagle = 1
uzi = 1
mp5 = 1
smg_a = 1
spas = 1
m4super = 1
m16a2 = 1
ak47 = 1
desert_rifle = 1
m60 = 1
sg552 = 1
mini14 = 1
sniper_military = 1
awp = 1
sniper_scout = 1
grenade_launcher = 1
pipebomb = 1
molotov = 1
bile_flask = 1
medkit = 1
defibrillator = 1
painpills = 1
adrenaline = 1
incendiary_ammopack = 0
explosive_ammopack = 0
w_laser_sights.mdl = 0
ammo_stack.mdl = 0
coffeeammo.mdl = 0
gascan001a.mdl = 0
kurochama  [author] 7 Feb @ 10:47pm 
@Wenda , probably it's possible, though it needs more tests as there's more than one method to use.