UE2 - UT2kX spawning object in subclass of GUIController

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

LTC3869

New Member
Jan 23, 2008
10
0
0
Is it possible to spawn an object from a subclass of GUIController? I need to be able to access methods from that object from anywhere in the GUI and GUIController seems the easiest place.
I know its an interaction and I've tried to spawn the object using:
Code:
spawn(class'MyLink');
and
PlayerOwner().spawn(class'MyLink');

but it won't accept it.
Thanks for any help
 

eblade

New Member
Jan 29, 2006
113
0
0
uh.. that dosen't make sense. PlayerOwner() should return a Player or a PlayerController or None.. not a Bad or missing expression. Bad or missing expression generally means you misspelled something, or in whatever object you are in there is no PlayerOwner() function.

Ah, a quick search tells me that this is because there is no function in GUIController caled PlayerOwner(). You should probably look at the code for GUIController..
 

LTC3869

New Member
Jan 23, 2008
10
0
0
accessing gui controller from diff package

Thanks ViewportOwner.actor. worked.
I've got another problem now though to do with accessing my gui controller from a different folder.
If my gui controller class is in the same folder as the class I am calling it from then the following line compiles/works.
Code:
MyGuiController(Controller).testMethod("hello");

but I don't know how to call my gui controller when I call it from a class which is located in a different folder.
 

eblade

New Member
Jan 29, 2006
113
0
0
If it works same was as UE2 did, then you need to have the package that contains the custom GUI controller listed in the ModPackages ABOVE the other packages that you want to access it from.

..oops, it's UE2 not UE3 :D

Need to have it listed in EditPackages first.
 

LTC3869

New Member
Jan 23, 2008
10
0
0
Thanks. Appears to be working so far. I had to move the GUIController to a package of its own and compile that first.
 
Last edited: