开发者

UDK "Error, Unrecognized member 'FocalPoint' in class ..."

开发者 https://www.devze.com 2022-12-25 12:31 出处:网络
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\\Class开发者_开发技巧es\\ZController_FireWeapon.uc(1

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\Class开发者_开发技巧es\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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消