And, if i want to have a GENERIC parameter to a function / field of this class, how is that done? I have done generics extensively in a dozen or so languages, but don't see how to do that in UnrealScript.
Though the relevant wiki page suggests potential alternative formats. One issue I rubbed up against in choosing to inherit from Object rather than, say, Actor, is that you won't have access to other useful objects like Level - though you can pass these in as parameters to functions.
By any matter if Wiki goes down-hill (as it often does) you might look at TestInfo class from Engine - probably there are conclusive samples about some of their testing goals.
Though the relevant wiki page suggests potential alternative formats. One issue I rubbed up against in choosing to inherit from Object rather than, say, Actor, is that you won't have access to other useful objects like Level - though you can pass these in as parameters to functions.
Doh!
I'm so used to other languages that class references like this trip me up.
Makes perfect sense.
How do I specify a constructor? Our do I basically don't and just populate after?
Also, I see no mention of generics in the Wiki, so I'm assuming I'll have to do the naive approach and make basic wrappers for primitive types.
sektor2111 wrote: ↑Tue Nov 03, 2020 4:39 pm
By any matter if Wiki goes down-hill (as it often does) you might look at TestInfo class from Engine - probably there are conclusive samples about some of their testing goals.
I'll give that class a look. I didn't see that when I was grepping the source code and uc classes.
No, it doesn't.
UnrealScript is very old and quite primitive in many ways, even in relation to the existing languages at the time.
While it improved over time with each engine generation (up until UE3, since it was dropped completely starting with UE4), and while it's meant to be an OOP language, the UE1 version lacks many fundamental features such as protected properties (it has private though, albeit rarely used in practice), protected and private methods, interfaces, constructors and destructors (as you've seen), and so on.
Even something like dynamic arrays are broken in v436 at least, and only fixed-length arrays work properly.
Furthermore you have to be careful when handling objects, since the GC of this version of the engine is not that great.
It was severely improved in the latest patches (v469+), but you still have to be careful, especially if you have references between normal objects and Actor objects, otherwise you may end up getting GC crashes (mostly on map change, when GC runs).
That is to say that, if you use v469, then you're somewhat safe, but there are still some considerations to have, although in this part is best to ask the patch developers themselves, they know a lot better what situations you still have to be careful about.