scn AwarenessTestScriptshort sDoOnceshort sIntelligenceshort sPerceptionshort sLuckshort sProximityfloat fDistancefloat fRankshort sGuessesfloat fRawRecognitionshort sRandValshort sAllowedErrorshort sProportionshort sReactionshort sGuessCountfloat fActivateRangefloat fPerceptionBonusBegin GameMode if (sDoOnce == 0) set sDoOnce to 1 set fRank to 1.0 set sIntelligence to GetActorValue Intelligence set sIntelligence to sIntelligence / 2 set sPerception to GetActorValue Perception set sPerception to sPerception / 2 set sLuck to GetActorValue Luck set sLuck to sLuck / 2 set sGuesses to ((((sIntelligence * 10) + (sPerception * 10) + (sLuck * 10)) / 3) * fRank) / 10 set sAllowedError to 10 SetAlert 0 set fActivateRange to 150.0 set fPerceptionBonus to sPerception * (100 / 2) set fActivateRange to fActivateRange + fPerceptionBonus endif set sProximity to GetInSameCell player set fDistance to GetDistance player if (sProximity == 1 && fDistance <= fActivateRange && sGuesses > 0) set fRawRecognition to ((((sIntelligence * 10) + (sPerception * 10) + (sLuck * 10)) / 3) * fRank) set sRandVal to (1 + (GetRandomPercent * fRawRecognition / 100)) set sRandVal to fRawRecognition + GetRandomPercent * (100-fRawRecognition+1) / 100 set sProportion to (100 - sRandVal) if (sProportion <= sAllowedError) SetAlert 1 SetActorAlpha 0.5 player.SetActorAlpha 0.5 set sGuesses to 0 set sReaction to GetFactionReaction AiAwareFaction PlayerFaction if (sReaction < 0) RemoveScriptPackage AddScriptPackage AiAwareAmbushPackage EvaluatePackage endif endif set sGuesses to sGuesses - 1 set sGuessCount to sGuessCount + 1 endif if (sProximity == 0 && fDistance >= fActivateRange) SetAlert 0 SetActorAlpha 1 player.SetActorAlpha 1 endif if (sProximity == 0 && sGuesses <= 0 && fDistance >= fActivateRange) set sGuesses to ((((sIntelligence * 10) + (sPerception * 10) + (sLuck * 10)) / 3) * fRank) / 10 endif if (sGuessCount >= 10) set sReaction to GetFactionReaction AiAwareFaction PlayerFaction if (sReaction < 0) RemoveScriptPackage AddScriptPackage AiAwareAmbushPackage EvaluatePackage endif set sGuessCount to 0 endifEnd
updated. going to test it again .