Replace Map pickups.

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

slavek

Grizzled Veteran
May 4, 2006
3,074
943
113
UnrealEd: Viewport #1
I was wondering how I could go about replacing map weapons and ammo(I'm not an experienced coder, I can not write from scratch efficiently).

I have been using a modified version of Marco's doom weapon mutator for testing purposes but I would like something more flexible for a release. Instead of removing all weapon pickups(Leaving only ammo cans), I would rather replace existing map pickups with a random chance of being a custom weapon or ammo pickup(Not ammo can). Would I have to kill the existing weapon spawns and replace them or modify them. And if so, how would I do that.

Thanks

=213=Slavek
 
Last edited:

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,459
2,502
0
Canada
You can just go into a map and find a KFRandomItemSpawn and change the weapons. The KFAmmoPickup boxes used to be the same except with ammo and their mesh was based off the weapon they went to, but that was in the kfmod. If you want to write a mutator, just use one that replaces all kfrandomitemspawns with the modded ones. Take a look at the doom 2 weapon replacer mod for help.
 
Last edited:

BEEEEEES

FNG / Fresh Meat
Aug 29, 2009
476
42
0
Look at KFMod.KFRandomItemSpawn: this is the object that makes spawns the random items within maps. You can extend this class with your custom class, then change the list of available items in your custom class. After that, replace the KFRandomItemSpawn objects with your custom ones inside your mutator's CheckReplacement function.

However, one of the problems with the bare-bones approach is that the fellas at TWI declared the list that holds the spawnable items as a static array, which means we can't resize it if we want to have, say, 20 possible items that may spawn.

I got around that in my WTFMut by overriding the relevant inherited functions, then revamping their functionality to use my own arrays.