I have a small question, how can I destroy the DispersionPistol on startup?
I already made a new gameinfo for my map and removed the default weapon in it, that works great while starting the map over the editor or with the open command ingame.
But if I start the map over the botmatch menu with gamemode singleplayer or other gamemodes the game gives me every time a new DispersionPistol.
Not sure what you actually need - prevent adding DispersionPistol to the player's inventory list or prevent existence of DispersionPistol in the player's inventory list when the player enters the level.
Usually game types use Level.Game.DefaultWeapon to determine which default weapon (if any) to add. So, for example, if an actor of a class type with the following definition
Code: Select all
class NoDefaultWeapon expands Info;
event BeginPlay()
{
Level.Game.DefaultWeapon = none;
}
is added to a map, then no default weapon will be added to the player's inventory list. The player may still bring DispersionPistol from previous levels and may get additional inventory (e.g. Translator) determined by a particular game type or mod.
Destroying inventory is a different story. In case of a game type that supports 227 GameRules, the inventory can be destroyed by an actor of a custom subclass of GameRules with overridden ModifyPlayer and enabled bNotifySpawnPoint:
Code: Select all
class RemovePlayerInventory expands GameRules;
event BeginPlay()
{
if (Level.Game.GameRules == none)
Level.Game.GameRules = self;
else
Level.Game.GameRules.AddRules(self);
}
function ModifyPlayer(Pawn P)
{
local Inventory Inv;
for (Inv = P.Inventory; Inv != none; Inv = Inv.Inventory)
Inv.Destroy();
}
defaultproperties
{
bNotifySpawnPoint=True
}
This still doesn't guarantee that, f.e., another GameRules actor won't add something after such a destruction.