Hey there,
So over the past couple of months, I've stumbled across a couple of bugs that have become quite annoying.
1. First one deals with an inheritance issue and use of the "out" specifier in an AIController class:
First one is like so:
Shouldn't SomeFunction accept a direct reference to a variable that already inherits the base class? UnrealScript seems to take too narrow and literal a focus when it comes the 'out' specifier and child classes.Code:var BaseClass A; var SubClassOfA B; auto state Example { SomeFunction(B); } function SomeFunction(out BaseClass A) { SubClassOfA(A) = Spawn(class'A',,,Location,Rotation,,); }
The reason this is such a big deal is because the spawned object gets destroyed after the function ends, and I need the spawn to last beyond the function. SomeFunction gets used multiple times in my code for different subclassed objects of the same baseclass, and I'd rather just condense the repetitive set of instructions to a single function for later reuse.
I tried SomeFunction(A(B)) to make things kosher for the function parameter issue, but then unrealscript throws an error saying that typecasting to "A" is unnecessary (presumably because it already inherits from "A").
I also tried using the 'coerce' specifier to no avail.
So I think this is a feature bug. Any child of 'A' should be able to withstand being passed into a baseclass "out" parameter instead of having a local copy of it made for typecasting (which would end up destroying the spawned object once the function ends anyways).
2. This deals with how comments are evaluated in UnrealScript. Now I seem to have had some trouble replicating this again, but I'll throw it out there anyways, and see if anyone else can replicate this. (I'm using the March 2012 build)
So if you have a multi-line comment like so:
The compiler throws an error saying "Unexpected 'defaultproperties'" or something similar in playercontroller. I found a similar issue on a wiki site of known legacy UScript bugs: http://wiki.beyondunreal.com/Legacy:Compiler_Errors (there was another website that explained it visually more in detail, but can't seem to find it now.)Code:/* Comment * * Comment */ // And a one-line comment like this
Usually comments can get pretty tricky for me like that when I'm trying out multiple functions and trying to explain what I've commented out at the same time.
But anyways, yeah... just thought I'd pass this along to the devs.



.
Reply With Quote

Bookmarks