For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Destroyig Dispersionpistol on map startup?

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Destroyig Dispersionpistol on map startup?

Post by Krull0r »

Hey there :)

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.


Greetings Krull0r ;)
Image
User avatar
makemeunreal
OldUnreal Member
Posts: 569
Joined: Sat Mar 23, 2013 7:51 pm

Re: Destroyig Dispersionpistol on map startup?

Post by makemeunreal »

Well, I'm not that much into codin' stuff.
But I may know the answer. You should launch the game with the gamemode you've made and not in SinglePlayer etc...
The problem is that your custom GameInfo won't appear in the botmatch menu.
You will have to add it to the Unreal.ini to appear so.
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: Destroyig Dispersionpistol on map startup?

Post by Masterkent »

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.
Last edited by Masterkent on Sat Feb 25, 2017 6:15 pm, edited 1 time in total.
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: Destroyig Dispersionpistol on map startup?

Post by Krull0r »

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
}

Thanks Masterkent this works exactly as I wanted :)
Image

Return to “UScript Board”