Gaming Zone > Unreal Tournament 2004

OK - unrealscript error I don't understand:

(1/2) > >>

Piglet:
error:


--- Code: ---OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
OLCTFSquadAI VCTF4-Interstellar_Oasis.OLCTFSquadAI (Function OLTeamGames.OLCTFSquadAI.CheckVehicle:0066) Accessed None 'Holder'
--- End code ---

Code - one mention of "Holder" - and that is to check whether it's None or not!:


--- Code: ---function bool CheckVehicle(Bot B)
{
    local int i;

    for(i=0;i<EnemyFlags.Length;i++)
    {
        if ( (EnemyFlags[i].Holder == None) && (VSize(B.Pawn.Location - EnemyFlags[i].Position().Location) < 1600) && CanCaptureFlag(B, EnemyFlags[i]) )
            return false;
    }

    if ( (B.PlayerReplicationInfo.HasFlag != None) && (VSize(B.Pawn.Location - FriendlyFlag.HomeBase.Location) < 1600) )
        return false;

    return Super.CheckVehicle(B);
}

--- End code ---

zeus:
PEOPLE AT THE MOUNTAIN BELIEVE THIS PART TO BE FAULTY IN THE FOR LOOP

--- Quote ---EnemyFlags ( i ) .Holder
--- End quote ---

IT SEEMS TO ASSUME THAT EnemyFlags ( i ) IS NOT NONE EVENTUALLY ARRIVING TO None.Holder

Piglet:
You're allowed to check if Holder is 'none'...but you can't use it in any other way if it is.

This error should not be possible from the code in the function....

zeus:
NONO, THE IF IS INCOMPLETE - IT ASSUMES THAT EnemyFlags IS ALWAYS SOME LEGIT OBJECT
(EnemyFlags ( i )  != None) &&

( PROBABLY THE IF BLOCK BELOW IS SOMEWHAT FAULTY, BUT TO GET THE IDEA )


--- Code: ---function bool CheckVehicle(Bot B)
{
    local int i;

    for(i=0;i<EnemyFlags.Length;i++)
    {
        if ( (EnemyFlags[i] != None) && (EnemyFlags[i].Holder == None) && (VSize(B.Pawn.Location - EnemyFlags[i].Position().Location) < 1600) && CanCaptureFlag(B, EnemyFlags[i]) )
            return false;
    }

    if ( (B.PlayerReplicationInfo.HasFlag != None) && (VSize(B.Pawn.Location - FriendlyFlag.HomeBase.Location) < 1600) )
        return false;

    return Super.CheckVehicle(B);
}

--- End code ---

Piglet:
The if block is complete. Enemyflags is always legit, otherwise the error would be "Accessed None 'EnemyFlags'"

Navigation

[0] Message Index

[#] Next page

Go to full version