• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

Extending ROPawn issue

LordGleedo

FNG / Fresh Meat
Jul 18, 2010
800
74
0
Bucks, England
www.theoldgitsarmy.com
On what line does does your code start generating compiler errors?
I believe in the two examples below, that in both cases it was the "if" line, but I can double check when I get home. Interesting thing is, the compiler shows the error mentioned, but does not specify a line number like it does for all other errors that ive ever seen.

Code:
if ( FTPawnIntf(HitActor) != none)
{
     // do stuff here....
}
Code:
local FTPawnIntf myIntf;

myIntf = FTPawnIntf(HitActor);

if ( myIntf != none)
{
     // do stuff here....
}
I believe the 2nd example is definitely the correct usage (according to the tutorials ive read) and indeed it does work and "myIntf" is usable as an interface in my UDK version, so I can do myIntf.Testfunction.

I am happy to throw together a very simple project to demonstrate this and send it to you if you wish?
 
Last edited:

Ducky

Super Moderator
May 22, 2011
6,359
237
0
Netherlands
Your aproach is wrong. Try this:

Code:
var FTPawnIntf myIntf;  // To set reference to your interface
 
if (myIntf(HitActor) != none)
{
     // do stuff here....
}
I know it looks odd, but this is how it should be done with interfaces.
 

LordGleedo

FNG / Fresh Meat
Jul 18, 2010
800
74
0
Bucks, England
www.theoldgitsarmy.com
Your aproach is wrong. Try this:

Code:
var FTPawnIntf myIntf;  // To set reference to your interface
 
if (myIntf(HitActor) != none)
{
     // do stuff here....
}
I know it looks odd, but this is how it should be done with interfaces.
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.
 

LordGleedo

FNG / Fresh Meat
Jul 18, 2010
800
74
0
Bucks, England
www.theoldgitsarmy.com
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');
}
But that results in the compile error:
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);	
}
So the compile error, for some unknown reason, was caused by having a log statement inside my 'if' condition.

That would also be why it worked in the UDK version of my mod because I did not include the log line!
 
Last edited: