![]() |
![]() |
|
|
|||
|
|||
|
Quote:
|
|
#22
|
||||
|
||||
|
Quote:
Code:
if ( FTPawnIntf(HitActor) != none)
{
// do stuff here....
}
Code:
local FTPawnIntf myIntf;
myIntf = FTPawnIntf(HitActor);
if ( myIntf != none)
{
// do stuff here....
}
I am happy to throw together a very simple project to demonstrate this and send it to you if you wish? Last edited by LordGleedo; 05-11-2012 at 03:55 AM. |
|
#23
|
||||
|
||||
|
Your aproach is wrong. Try this:
Code:
var FTPawnIntf myIntf; // To set reference to your interface
if (myIntf(HitActor) != none)
{
// do stuff here....
}
__________________
|
|
#24
|
||||
|
||||
|
The above code is the correct usage (as you say), it is what I am using, and it does not compile. It works fine in the UDK.
|
|
#25
|
||||
|
||||
|
OK, it was not a problem with the interface.
I basically had this code which should compile: Code:
local FTPawnIntf myPawnIntf;
myPawnIntf = FTPawnIntf(HitActor);
// test if this actor implements our custom pawn interface...
if (myPawnIntf != none)
{
`Log(">>> DEBUG : Actor has interface", , 'FTPlayerController');
}
Code:
Error, Missing opening '(' in Implements list
However, If I remove the log line (that I use everywhere!), and replace it with something else like below, it compiles and works. Code:
local FTPawnIntf myPawnIntf;
myPawnIntf = FTPawnIntf(HitActor);
// test if this actor implements our custom pawn interface...
if (myPawnIntf != none)
{
// we have a valid target to thaw!
ClientMessage("Hit: Frozen Team Mate Detected");
ClientMessage("Hit: "$HitActor$" class: "$HitActor.class.outer.name$"."$HitActor.class);
return ROPawn(HitActor);
}
That would also be why it worked in the UDK version of my mod because I did not include the log line! Last edited by LordGleedo; 05-11-2012 at 02:41 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|