PDA

View Full Version : GameInfo help.



rickr
12-23-2007, 09:34 PM
I have a couple issues I need some help with, any help would be appreciated.

A. How do you specify what GameInfo class to create at startup? I sort of hacked this by creating a placeable actor that sets WorldInfo.Game to my GameInfo derived class but this is unlikely the correct route. In fact I'm sure there is something wrong because if I do a 'obj list class=GameInfo' I get 2 listings one for my class and another for 'DemoGame' which means something still is holding a reference to the old one.

B. This question is really a compiler error that is not making much sense to me. I have a class that derives from GamePlayerController and in the default properties I have this code:

Begin Object Class=CylinderComponent Name=CollisionCylinder < ... snip >

The compiler complains that there already is a component named CollisionCylinder, which is true, there is in fact another component in a base class named the same what I don't understand is why this works for DemoGame? I just copied/pasted the code from there ...

Thank you.

schenksmill
12-23-2007, 09:38 PM
For the second question, I generally override things by just doing something like:

Begin Object Name=CollisionCylinder
...stuff...
End Object
placing the things I want to change in the stuff section. Everything else in the base class' object of that name will stay the same.

rickr
12-23-2007, 10:06 PM
Yeah, the compiler gives a similar suggestion, I was just confused why copied/pasted code was giving error ... I think I figured it out tho, I suspected this to be an artifact of the export process and sure enough I exported my .u file and the resulting .uc file can't be compiled.

I still need some help with A tho.

Wormbo
12-24-2007, 04:55 AM
The mapper can only suggest a gametype by specifying it in the level properties. The final decision is made by the player or server admin through a menu selection or the ?game=... URL parameter. You specificly must not set the WorldInfo.Game property directly!

Solid Snake
12-24-2007, 08:07 AM
When you export scripts via UnrealEd, sometimes it does not export out default properties correctly.