UDK “Error, Accessing a member of _'s within class through a context expression requires explicit 'Outer'”

百般思念 提交于 2019-12-11 07:07:55

问题


I get the following error in the UDK Frontend when I try to make my project:

C:\UDK\UDK-2010-03\Development\Src\FixIt\Classes\ZInteraction.uc(58) : Error, Accessing a member of GameUISceneClient's within class through a context expression requires explicit 'Outer'

The class ZInteraction extends Interaction.

Line 58 is: GetSceneClient().ConsoleCommand("KEYNAME"@Key);

What is the problem here? I am still investigating and I will update as I find out more.

edit: Tried fixing the line up as class'UIRoot'.static.GetSceneClient().ConsoleCommand("KEYNAME"@Key); - no change.


回答1:


Found it!

From a forum post, Scripting Changes from UT3:

When accessing a member of a within class' container class, you now have to use the special Outer member variable. This presumably helps deal with name clashes.

I had to change the code to the following:

GetSceneClient().Outer.Outer.ConsoleCommand("KEYNAME"@Key);

Depending on what function is giving you this error, you will need one or more sets of Outer.. You can research to find out how many layers deep you are, or you can just add one at a time until the code compiles. I chose the latter, because it's hard enough already to navigate this UnrealScript. :)



来源:https://stackoverflow.com/questions/2450915/udk-error-accessing-a-member-of-s-within-class-through-a-context-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!