Miasma Community

Gaming Zone => Unreal Tournament 2004 => Topic started by: Piglet on April 10, 2020, 21:57

Title: OK - unrealscript error I don't understand:
Post by: Piglet on April 10, 2020, 21:57
error:

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'


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


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);
}
Title: Re: OK - unrealscript error I don't understand:
Post by: zeus on April 10, 2020, 22:24
PEOPLE AT THE MOUNTAIN BELIEVE THIS PART TO BE FAULTY IN THE FOR LOOP
QuoteEnemyFlags ( i ) .Holder

IT SEEMS TO ASSUME THAT EnemyFlags ( i ) IS NOT NONE EVENTUALLY ARRIVING TO None.Holder
Title: Re: OK - unrealscript error I don't understand:
Post by: Piglet on April 10, 2020, 22:29
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....
Title: Re: OK - unrealscript error I don't understand:
Post by: zeus on April 10, 2020, 22:32
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 )


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);
}
Title: Re: OK - unrealscript error I don't understand:
Post by: Piglet on April 10, 2020, 22:59
The if block is complete. Enemyflags is always legit, otherwise the error would be "Accessed None 'EnemyFlags'"

Title: Re: OK - unrealscript error I don't understand:
Post by: Absolute_Madness on April 12, 2020, 10:30
does this happens when there are no bots in game?
Title: Re: OK - unrealscript error I don't understand:
Post by: Piglet on April 12, 2020, 11:34
I don't know. I very much doubt it