PDA

View Full Version : MapPrefix stopped working [SOLVED]



Bankler
08-09-2011, 09:13 AM
In my DefaultGame.ini I have:


+DefaultMapPrefixes=(Prefix="WPDM",bUsesCommonPackage=FALSE,GameType="Woodpecker.WPDeathmatch")
+DefaultMapPrefixes=(Prefix="WPBU",bUsesCommonPackage=FALSE,GameType="Woodpecker.WPGameBurglary")

When my gameclass (WPGame.uc, from which WPDeathmatch and WPGameBurglary.uc) derived from UTGame.uc, everything worked fine. But when I changed things so that WPGame.uc derives from UDKGame.uc instead, it stopped working. Strange enough, it always seems to use the WPDeathmatch gamemode now.

It loads the right map (with WPBU-prefix) but with the wrong game mode.

Any ideas?

Bankler
08-09-2011, 10:03 AM
Update:

If I start the map by multiplayer/host, from the UT-menu (you know the standard red UT one), it works. But not if I run the WPBU-Whiteroom.udk map directly from VS/nFringe. It's almost like the DefaultGame.ini is only read if my own GameMode derives from UTGame (which I'd like to avoid).

Update2:

If I delete the file WPDeathmatch.uc everything works. (!) If I put it back and recompile, things are back again and this is the only one that gets loaded.

DarkCarnivour
08-09-2011, 10:20 AM
What's your "DefaultGame" set to in DefaultGame.ini?
The SetGameType() function in the defaultgame class decides what game to use. Depending on which implementation of SetGameType() is being used, it may or may not be checking the prefix list.

Also you can start maps in the console: "open WTVR-MyMap?game=MyPackage.MyGame"
You can also put "WTVR-MyMap?game=MyPackage.MyGame" on command line or anywhere the game takes URLs.

Bankler
08-09-2011, 11:07 AM
DarkCarnivour, thank you ever so much! You nailed it.

The problem was that I had no implementation of the event in my WPGame.uc. Before I changed the derive stuff, it used the implementation in UTGame.uc (which I no longer derive from). I copied the event (only doing some minor tweaks) to WPGame.uc and added the MapPrefixes array as a class member. Then everything worked as intended.

I have been working with this problem for almost two days. Thanks again!! <3

DarkCarnivour
08-09-2011, 05:48 PM
No problem, glad it helped.