Left 4 Dead 2
29 оценки
Weapon Pickup Limiter (Script)
   
Награда
Добавяне към любими
В любими
Премахване от любими
Game Content: Scripts
Размер на файла
Публикуван на
2.402 KB
20 ян. в 8:08
1 бележка за промяна ( преглед )

Абониране, за да се свали
Weapon Pickup Limiter (Script)

В 1 колекция от senzawa
Sourcemod ports to VScript
2 артикула
Описание
All weapon spawns (and item spawns since Source jank but they are default 1 so who cares) limits you to 1 weapon per spawn.
This mod is made for people who want more realism or challenge: No more cloning 4 guns out of thin air/getting 4 god-tiers guns out of one spawn!

Heard someone say this was trending on Sourcemod or whatever, also it was an interesting idea so I decided to give a shot.
Whipped it up in 4 hours, most of which was spent browsing forums and wikis for obscure and arcane knowledge of spawnflags.

As usual the settings can be changed by editing the `OneGunVar` in the script:
countCap: upper limit on how many weapons/items you can pick up from a single weapon_spawn, default value is 1

------------

Note that the Weapon Unstay mod does something similar to this.
However, the two mods use different methods: Weapon Unstay kills the weapon spawn when you take a weapon, while this mod changes the entity data to allow only 1 weapon to spawn.
This leads to the following differences in their behavior:
(All "weapons" below refer to weapon AND items since the spawners of those two are grouped together)

Compatibility: (Pro)
With the kill method, it's impossible to change the number of weapons you can take since the spawn will be killed after anyone takes a weapon.
Meanwhile with the entity data method you can change weapon counts on the fly and it would work exactly as you expected (the script only fires once, upon map load)

Accordance with Vanilla: (Pro)
If you take a gun from a spawn then pick up another one near it, with the kill method, the old gun would drop to the ground.
But with the entity data method it would return to its old positions, in accordance with vanilla single-pickup spawns. Which leads into the next difference.

Reserve and Clip Ammo: (decide for yourself)
With the kill method, the old gun drops to the ground, keeping its reserve ammo count and clip ammo count in the process.
While with the entity data method it automatically refills, again, in accordance with vanilla single-pickup spawns.

Optimization: (Con but who cares)
Whe someone picks up a weapon, with the kill method, the weapon spawn is gone and frees up entity slots.
With the entity data method, the spawn is still there and takes up a entity slot. Which also leads into the next difference.

Corner Cases: (Pro)
If someone assigned a script to the spawn (say a melee that, when taken, spawns a horde), the kill method might render the script unable to execute.
While the entity data method would work fine.


-------Credits (sorted alphabetically by full URL)---------
Valve Developer Community for the awesome documentation
AlliedModders[forums.alliedmods.net] for letting me know how to edit Spawn Flags
Rayman1103 for an easy way to get all weapon spawns
devlos for a robust way of handling run-once entity manipulation
5 коментара
Murder of Crows 4 септ. в 18:11 
I've been looking for this exact mod, I finally found it and thank you for this awesome creation. I always hated the way that there's unlimited weapon in one spawn, it's very unrealistic.
时空之轨迹 24 юни в 21:53 
I don't speak English, so it's machine translation.
[Hard-Mode] Random Ammo Pile Swapper
Replace the ammo pile guns and still get 4 of them.
Kaiser Adradum 9 юни в 16:48 
i love this mod, u need to make random ammo pile for this
Ain 16 март в 8:30 
you can make limited ammo pile?
Host_Cletus™ 3 февр. в 21:37 
tbh i like this in the sense of realism