UDK“错误,无法识别的成员“FocalPoint”在课堂上……”

发布于 2024-08-27 17:16:28 字数 477 浏览 5 评论 0原文

我正在将 UT3 游戏移植到 UDK

它使用大型代码库,我收到此编译器错误:

C:\UDK\UDK-2010-03\Development\Src\FixIt\Classes\ZController_FireWeapon.uc(129):错误,“ZController”类中无法识别成员“FocalPoint”

ZController 扩展 UTBot 中无法识别的成员“FocalPoint”。这是引用的行:

Agent.FocalPoint = ObjectOfAttention.Location;

(Agent 的类型为 ZController)

FocalPoint 发生了什么?

I'm porting a UT3 game to UDK.

It uses a large code library and I'm getting this compiler error:

C:\UDK\UDK-2010-03\Development\Src\FixIt\Classes\ZController_FireWeapon.uc(129) : Error, Unrecognized member 'FocalPoint' in class 'ZController'

ZController extends UTBot. This is the referenced line:

Agent.FocalPoint = ObjectOfAttention.Location;

(Agent is of type ZController)

What happened to FocalPoint?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

℡寂寞咖啡 2024-09-03 17:16:28

我找到了!我的 FocalPoint 行上方的行涉及设置 Agent.Focus;所以我追踪了 UTBot -> 的行UDKBot-> AI控制器-> Controller,最后,Controller 类有一个 Focus 成员:

var BasedPosition FocalPosition; // position controlled pawn is looking at
var Actor         Focus;         // actor being looked at

因此,FocalPoint 被重命名为 FocalPosition

事情还没有结束!显然 FocalPoint 曾经是一个向量,现在 FocalPosition 是一个 BasedPosition。所以我的代码仍然不起作用,因为它试图将向量分配给 BasedPosition;编译器抱怨错误,'='中的类型不匹配。 BasedPosition 是 Actor 中的一个结构体,并且有一个向量成员 Position,因此我假设这是要分配给的正确变量。

我将代码行从 更改

Agent.FocalPoint = ObjectOfAttention.Location;

Agent.FocalPosition.Position = ObjectOfAttention.Location;

我尚未测试它(仍在处理其他编译器错误),但现在可以正常编译。希望这是正确的解决方案。

I found it! The line above my FocalPoint line involved setting Agent.Focus; so I traced the line of UTBot -> UDKBot -> AIController -> Controller and finally the Controller class has a Focus member:

var BasedPosition FocalPosition; // position controlled pawn is looking at
var Actor         Focus;         // actor being looked at

So, FocalPoint was renamed to FocalPosition.

It's not over yet! Apparently FocalPoint used to be a vector and now FocalPosition is a BasedPosition. So my code still didn't work because it was trying to assign a vector to a BasedPosition; the compiler complained with Error, Type mismatch in '='. BasedPosition is a struct in Actor and has a vector member Position, so I will assume that's the correct variable to assign to.

I changed my line of code from

Agent.FocalPoint = ObjectOfAttention.Location;

to

Agent.FocalPosition.Position = ObjectOfAttention.Location;

I haven't tested it (still working on other compiler errors) but it compiles fine now. Hopefully this is the correct solution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文