Accessed Nones - Techniques to Fix?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Eyegore

=================
Sep 4, 2001
293
0
0
53
Hanover
Hi all,

I have been experimenting with Unreal script now for about a month, and with decent result, but I was wondering what techniques you all use to track and fix accessed nones?

For example, I have made a sniperrifle whose fire class is a modified version of the lightninggun fire, to make it more like a regular sniperrifle.

It works fine, but I am getting sporadic accessed nones in the DoTrace function and I am haveing trouble tracking them down.

I'm not asking for the answer, I'd like to figure it out myself, but I was hoping that maybe someone could point me in the right direction to take a look at this. As the code is mostly lightninggun code, I haven't really made drastic changes, which is why it seems so strange.

Thanks for any advice you may have.
 

Kangus

Zombie on your pwn!
Jan 29, 2001
978
0
16
Illinois, USA
www.planetunreal.com
Acessed Nones are generally caused by casting classes as things they are not and trying to access variables in them, or from trying to access a variable in sopmething that did not spawn properly. The best way to track them down is to make sure there aren't still references to the SniperRifle class (the lightning gun), or the SniperFire class.

To track down the approximate locations of specific ones, look at the error line in the log where you found it.For example:
Code:
Warning: MyGun CTF-Face.MyGun (Function MyPackage.MyGun.CreateSuperFX:0042) Accessed None
This accessed none is being caused by something somewhere in the CreateSuperFX function in the MyGun class.

Hope this helps.
 

Eyegore

=================
Sep 4, 2001
293
0
0
53
Hanover
OK! I'll check that out - Thanks

I do get Accessed Nones not terribly often, but I want to get rid of all of them.

Now, one more question having to do with accessed nones, though it's not really a 'how to fix' but rather just asking to see if this happens to ayone else:

When I use the Traslocator camera I get this:

Code:
Warning: TransLauncher DM-Inferno.TransLauncher (Function XWeapons.TransLauncher.ViewPlayer:0097) Accessed None

This occurs in every map, and it is obviously in the ViewPlayer function of the TransLauncher, but I'm wondering - Is this something I can fix? Obviously, I don't mean to rewrite the code, but is this a bug in the game code itself that someone else has experienced?

I tried to reinstall the game - to no avail. My friends don't seem to get this error on their machines. I'm wondering if a configuration on my PC could be causing this?

I'll let you know how it goes with my Sniper Rifle - Thanks again for the advice!!
 

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
41
Inside the machine
Visit site
One method i use to track down AN's is to put a log every other line, like so
Code:
function bool ReturnFalseOrTrue(int Integer, float Float, string Cornwallace)
{
    log("1");
    Integer+=int(Float/36);
    log("2");
    Integer*=pawn(Owner).Health;
    log("3");
    if(Integer<6)
    {
        Log("Integer:"@Integer@"is less than 6");
        return False;
    }
    else
    {
        Log("Integer:"@Integer@"is more than 6");
        return True;
    }
}
as you can see, it helps to identify any problem area by sticking all of the accessed none's and warnings between your own scriptlogs. Granted, itll run a bit slower... but in the case of bughunting speed doesnt really matter so much ;)
 

Eyegore

=================
Sep 4, 2001
293
0
0
53
Hanover
Thanks EvilDrWong - that's what I did and I found the problem - the TraceRange setting was too short, so if you missed and your aim was set really far away like the sky or those spires in CTF-Magma, 'Other' was set to None. All that was needed was to extend the range of the trace. I don't know if this is a 'proper' fix... I suppose in the case of the lightninggun there is a contigency in place to set a max trace range at 17000.000000 and place an actor there so it won't return a None, however, I don't understand how as the line that sets 'Other'

Code:
Other = Trace(HitLocation, HitNormal, End, Start, true);

which occurs in the same place as in the 'my' code (my code actually being their code, without all the reflection stuff), yet their's doesn't return none if you hit empty space.

Since I am new to Unreal script, this lack of understanding does not come as a surprise. I plan on making a class that uses their sniper fire code peppered with log entries to trace the flow of it all - then I'll be able to figure out how they can hit nothing and not return a none, or if they do return none, how to keep it from erroring out.

Thanks for your advice - I'm really quite happy with what I have learned so far - now all I have to do is figure out how to achive my own unique weapons and fire styles.
 

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
41
Inside the machine
Visit site
IIRC traces will return none if they hit world geometry, such as a static mesh or a bit of BSP. Instead of trying to rely on Other being something, check right after the trace to see if you actually hit something
Code:
if(Other!=None)
Then anything you try and do to 'Other' should go across smoothly and not pump out errors like nobody's business.
 

Eyegore

=================
Sep 4, 2001
293
0
0
53
Hanover
You know, I tried that and I still got the error - but, I deleted this line

Code:
Log("OtherName: " $Other.GetHumanReadableName());

from when I was trying to track the AN down... And all is well!!

It took me a 0.5 hours to figure to figure that one out:rolleyes: Duh...

Thanks for the tips! I really appreciate it!