• 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/

Code Simple syntactical Q

eliskelvin

FNG / Fresh Meat
Dec 25, 2013
1
0
sorry for noob Q, I'm new to UnrealScript - Im trying to find the correct way to include a file

Ive tried `include(<filename>) But that doesnt work


Im trying to extend a class from another pkg source tree


`include(..\path\ThisOtherClass.uc)

MyClass extends ThisOtherClass


it gives me the error:

Script vs. Class name Mismatch - I know what that means and my script name is correct MyClass.uc

As if it thinks ThisOtherClass is the actual class name

is this even available in this version of UnrealScript.

Ive also tried #exec obj load file=ThisOtherClass.u

And it still doesnt see the super class

Maybe I need a search path like INCLUDE DIRECTORY in C

The docs are very vague about it. Im sure its something simple that im missing


Thx
kelv
 
The unrealscript INCLUDE is a preprocessor function that basically concats the target file into the current file. Since you were doing that at the beginning, that's why you were getting the class/file mismatch.
Do don't want to do that :p

http://udn.epicgames.com/Three/MasteringUnrealScriptPreProcessor.html#INCLUDE

similarly, (and I have less experience with this one) the Exec LOAD is primarily used to allow non-code packages to have thier presense known to your current uScript. Examples of this are usually animation packages, or texture packages.



If you just want to subclass an existing class, you don't need to INCLUDE or Exec-Load it. You should just be able to declare the extends..

Some documentation on how it works is here: http://udn.epicgames.com/Three/UnrealScriptClasses.html

If that doesn't work, I imagine your issue is more one of classpath issues.
 
Upvote 0