Left 4 Dead 2

Left 4 Dead 2

Item Randomizer (Vscript)
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.
I STAPLE TAPEWORMS ON MY 7 Feb @ 10:37pm 
can you add a feature for it to do nothing on some maps with a file the user can add map names into
kurochama  [author] 20 Jan @ 11:13am 
@Kuura-Meow ♥ , yes 40 is the maximum. If you add more, those slots won't be read by the scripts. & those 40 slots are applied to any items listed on "item randomizer.txt", so all you need to do is to add items to the list, & all of them will be randomized based on the results on those 40 slots. Actually at some points, this saves more time than letting players write themselves on each item like that on your example. But your example has more benefit in giving more freedom to make various different sets of randomization results on each item.
kurochama  [author] 20 Jan @ 8:59am 
@Kuura-Meow ♥ , if you want to set your own preferred list of randomized results, you can try to set "Randomizer Mode" to 10, & then go to "custom randomization (randomizermode 10).txt" file. You'll find list of weapon spawns there. There are 40 slots that you can freely edit. In fact, your suggestion should also be possible to make, but probably it would take some time to apply it as a new feature.
Unsants 8 Jan @ 12:57pm 
OK
kurochama  [author] 8 Jan @ 12:30pm 
@Gumbs , I think I haven't added a feature to turn off notification on "Item Conversion" yet. So, only this one has the feature to turn off notification.
Unsants 8 Jan @ 8:24am 
And for item conversion?
Unsants 8 Jan @ 8:20am 
Understood
kurochama  [author] 8 Jan @ 12:06am 
@Gumbs, there's "Randomizer Notification" to turn off notifications. But if you turn off the notifications, you won't know when the randomization happens.
Unsants 7 Jan @ 5:50pm 
Excuse me, how do I make sure that the text does not appear, and that the mod is active, or that only I can see the text?
kurochama  [author] 29 Dec, 2024 @ 9:36am 
Did you also remove the upgrade packs on "custom randomization (randomizermode 10).txt"? If you use "RandomizerMode 10", you also need to change upgrade packs listed there to other items (example: change to "weapon_smg_spawn" instead). & on "item randomizer.txt", set "incendiary_ammopack" to 1 if you want to remove it, & remove any items you don't want to randomize from the list (example: remove that "gascan001a" from the list if you don't want to randomize it. & it's also not recommended to randomize gascan, it might cause a bug in maps that have scavenge events)
something something house 29 Dec, 2024 @ 8:29am 
ok so heres my item randomizer txt

pistol = 1
w_shotgun.mdl = 1
pumpshotgun_A = 1
chainsaw = 0
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

the upgrade packs still shows up despite being set to 0, same with the chainsaw
im a bit stuck here
kurochama  [author] 18 Dec, 2024 @ 11:53pm 
@something something house , you need to set it to 1 to replace it a random item. The default settings of the "item randomizer.txt" has already listed chainsaw in it, so you can add or remove items other than chainsaw there, as the chainsaw doesn't need to be changed at all if you decide to replace it with a random item.
something something house 18 Dec, 2024 @ 11:12pm 
Weird because I set chainsaw = 0 and it still showing up
kurochama  [author] 16 Dec, 2024 @ 2:34am 
@something something house , unfortunately the number 1 there works as "true" (0 is "false"), not as percentage. So, items listed on "item randomizer.txt" will have 100% chance to be replaced with randpmized results. But actually that randomization chance is also a good idea, though I'm not sure whether to implement it or not, as it might change the main randomization mechanisms, more or less.
something something house 16 Dec, 2024 @ 1:00am 
Thanjs, and can i make an item spawn less frequent by turning the 1 and 0 into a percentage chance? Like 0.5 to halve the spawn chance or 0.1 or 0.2 to make a randomise chance even rarer?
kurochama  [author] 15 Dec, 2024 @ 11:22pm 
@something something house , for example, on "item randomizer.txt", add chainsaw on the list like this:
chainsaw = 1
crowbar = 1
This will remove chainsaw & crowbar by replacing them with random items. You can add or remove any items on the list of "item randomizer.txt".
something something house 15 Dec, 2024 @ 9:30pm 
its more like i was wonder if i could completely remove a weapon from the spawn pool like the chainsaw
do i place weapon_melee_spawn in weapon_chainsaw_spawn's place?
kurochama  [author] 12 Dec, 2024 @ 11:03pm 
@something something house , wait, which one do you want to do?
1. Randomize melee to other items.
2. Putting random melee as the randomized result.
If it's no. 2, then you can use the "custom randomization" cfg file & change any of results from "item_01" to "item_40", like:
item_01 = weapon_melee_spawn
item_21 = weapon_melee_spawn
etc
The more "weapon_melee_spawn" you put there, the more chance for melee to become the randomization results.
something something house 12 Dec, 2024 @ 8:32pm 
no i mean like is there a simplified line of text for the melee spawn that i can put into the item randomizer instead of having to put all the melee model .mdl in for it to randomize the melee
kurochama  [author] 12 Dec, 2024 @ 8:30pm 
@something something house , do you want to replace all melee? If you want to do that, you'll need to write each melee (it can be in short name or full path of the model name). Example:
katana.mdl = weapon_smg_spawn
fireaxe.mdl = weapon_rifle_spawn
etc.
something something house 12 Dec, 2024 @ 8:03pm 
do i have to get all the melee weapon in the item randomizer txt or is it just a melee spawn that i can put in the txt file?
kurochama  [author] 1 Nov, 2024 @ 10:15pm 
@SteveCroser , on "item randomizer.txt", only write items that you want to randomize. If you don't want to randomize pumpshotgun etc, it's safer to remove them from the list instead of writing "pumpshotgun_A = 0". Try to remove smg, mp5, shotgun chrome & pumpshotgun from that list then.
CODENAMEDEFCON 1 Nov, 2024 @ 3:20pm 
item_21 = weapon_adrenaline_spawn
item_22 = weapon_pain_pills_spawn
item_23 = weapon_first_aid_kit_spawn
item_24 = weapon_defibrillator_spawn
item_25 = weapon_weapon_pumpshotgun_spawn
item_26 = weapon_shotgun_chrome_spawn
item_27 = weapon_melee_spawn
item_28 = weapon_pipe_bomb_spawn
item_29 = weapon_molotov_spawn
item_30 = weapon_vomitjar_spawn
item_31 = weapon_melee_spawn
item_32 = weapon_smg_spawn
item_33 = weapon_smg_mp5_spawn
item_33 = weapon_smg_silenced_spawn
item_34 = weapon_pumpshotgun_spawn
item_35 = weapon_shotgun_chrome_spawn
item_36 = weapon_pistol_spawn
item_37 = weapon_melee_spawn
item_38 = weapon_adrenaline_spawn
item_39 = weapon_upgradepack_explosive_spawn
item_40 = weapon_upgradepack_incendiary_spawn
CODENAMEDEFCON 1 Nov, 2024 @ 3:20pm 
And I got these on the Randomizer 10 txt

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
item_11 = weapon_rifle_m60_spawn
item_12 = weapon_rifle_sg552_spawn
item_13 = weapon_hunting_rifle_spawn
item_14 = weapon_sniper_awp_spawn
item_15 = weapon_sniper_military_spawn
item_16 = weapon_sniper_scout_spawn
item_17 = weapon_grenade_launcher_spawn
item_18 = weapon_chainsaw_spawn
item_19 = weapon_smg_silenced_spawn
item_20 = weapon_shotgun_chrome_spawn
CODENAMEDEFCON 1 Nov, 2024 @ 3:19pm 
chainsaw = 1
desert_eagle = 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
pipebomb = 1
molotov = 1
bile_flask = 1
defibrillator = 1
painpills = 1
adrenaline = 1
mp5 = 0
smg_a = 0
w_shotgun.mdl = 0
pumpshotgun_A = 0

I got these params on Item Randomizer.txt and for some reason, they still wont spawn
CODENAMEDEFCON 1 Nov, 2024 @ 3:09pm 
Im using randomizer 10 mode
kurochama  [author] 1 Nov, 2024 @ 1:53pm 
@SteveCroser , which "Randomizer Mode" did you use? I think I put all T1 weapons in the randomization results. Or if you want to set your own randomization results, try to set "Randomizer Mode" to 10, & use "custom randomization (randomizermode 10).txt" to change the randomization results as you like.
CODENAMEDEFCON 1 Nov, 2024 @ 1:22pm 
So apparently, It wont give you any Pump SHotguns or Chrome Shotguns, SMGs or Silenced SMGs, but other than that, works fine
Kayle Tid 20 Oct, 2024 @ 6:48am 
Alright, I'll test it out and will let you know later if there's a problem. As for mods, I definitely don't use related mods like I said before. Thank you:luv:
kurochama  [author] 19 Oct, 2024 @ 5:57pm 
@Kayle Tid , did the problem no longer appear when that "Legacy Weapon" is disabled? Have you checked what's inside "item randomizer.txt" to see if there's pistol or other secondary weapons listed there. You can try to check with this method. Try to remove all secondary weapons from that list & see if the problem still happens or not. If it still happens even if the list no longer has secondary weapons in it, then it must be caused by other mods.
Kayle Tid 19 Oct, 2024 @ 10:55am 
One more thing, if you want to ask me which server I use this mod on. Then I would say dedicated server, this mod of yours is compatible with dedicated server, and it didn't have any problem when I used it for the first time. So I guess it doesn't matter, I'm just telling you so you can know if you need to.
Kayle Tid 19 Oct, 2024 @ 10:52am 
Mods that can lose items and I think it has a very small percentage if it has anything to do with this is Manacat's "Legacy Weapon Manager" mod. But I think it's not very relevant, so maybe I'll exclude it, and I'll post the mod link below for you if you need to see it.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2608563050&searchtext=
Kayle Tid 19 Oct, 2024 @ 10:50am 
I think it's just losing dual pistols, or maybe losing all second weapons, but mostly losing pistols multiple times as far as I've noticed. About the mods are concerned, I don't mod other things that conflict with your mod, and I honestly don't know for sure. But I think only your mod has that ability. , it helps me a lot in custom maps with few supplies. But the funny thing here is, items spawn and the second weapon is lost at the same time, especially it doesn't spawn in front, or bushes, or places where spawning is allowed. And it spawns right under the character's feet, which I didn't even know about a few days ago xD.
So that's what I know, and am trying to express in my poor english. So I hope you understand what I'm explaining.
kurochama  [author] 19 Oct, 2024 @ 10:03am 
@Kayle Tid , that's the first time I heard about it. I never met that problem when using this mod regularly, as I usually wanted to randomize some useless objects like chairs etc for fun. Probably other mods could cause it. The scripts on "Item Randomizer" should exclude player's owned items from randomization, so normally player's items won't disappear. Btw what secondary weapon was lost? Pistol, magnum, melee, or chainsaw? Was the missing secondary weapon on the list of randomized items on "item_randomizer.txt"?
Kayle Tid 19 Oct, 2024 @ 9:52am 
Hello again, I encounter the item spawn field right at the character's feet and sometimes the second weapon can be lost. I'm not sure if that's the case, but I've noticed that sometimes it happens like that, but not a lot. I think it might be random, so this time I'll trouble you to check again to see if it's like that, thank you.
Kayle Tid 5 Oct, 2024 @ 8:34am 
Thats cool, okay thank you I will try it and let you know if I encounter any errors/bug :luv: @kurochama
kurochama  [author] 4 Oct, 2024 @ 3:48pm 
@Kayle Tid , you're lucky, as the final mode on "Randomizer Mode", the 10th "Custom Mode" went smoothly so it finished faster than I thought. Now you can try it. A new cfg file, " custom randomization (randomizermode 10).txt ", is available, & all items listed in this cfg file will become the randomization results when "Randomizer Mode" is set to 10.
Kayle Tid 3 Oct, 2024 @ 5:14pm 
Yes, that's what I want. You were right and understood what I said, thank you again. As for freely of editing, I hope you will update it soon in the future, so everyone and I won't have to bother you
and I support that :)
kurochama  [author] 3 Oct, 2024 @ 4:35pm 
@Kayle Tid , I updated this mod with 9th mode, "No Throwable Mode". Now you can set the value to 9 if you want to exclude throwables (pipe bomb, molotov & bile bomb) from randomization results.
kurochama  [author] 3 Oct, 2024 @ 3:21pm 
@Kayle Tid , so, to put it simply, all you need is a mode where throwables are removed from randomization results, right? Actually I'm planning to make a new mode that can freely edit the randomization results via cfg file, but as this one might take some time, I think I'll add a new mode without throwables first.