Aller au contenu

Photo

Attribute Check Question


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
ehoddes

ehoddes
  • Members
  • 10 messages
So the degree to which I understand the toolset really doesn't extend to the function scripting, and I was hoping someone with more knowledge might be able to help me out. It says in a bunch of places that UT_AttributeCheck function is scaled to level, and I've seen people say that a cunning of "around 30" passes the "high" check, but no one has explained the exact formula, there are three levels, High, Medium and Low, and if I understand the code in utility_h right than Low is just the default for anything below medium, here's the function script. I'd just like, in English, what this means, like "If you're level x, you need attribute y to hit the high level." Here's (I think) all the relevant code. Hope someone can help.

int UT_AttributeCheck(int nAttribute, int nLevel, object oPlayer = OBJECT_SELF)
{
    // TBD
    // GZ: Remember to cast into to float on the attributes
    // to get an attribute value, use
    // GetCreatureProperty(oPlayer,nAttribute,PROPERTY_VALUE_TOTAL);
    float fTargetLevel = 10.0f;
    float fPlayerLevel = GetCreatureProperty(oPlayer, PROPERTY_SIMPLE_LEVEL);
    float fValue = GetCreatureProperty(oPlayer,nAttribute,PROPERTY_VALUE_TOTAL);
    int nResult = FALSE;
    switch (nLevel)
    {
        case UT_ATTR_HIGH:
            nResult = (fValue >= 30.0);
            break;
        case UT_ATTR_MED:
            nResult = (fValue >= 15.0);
            break;
        case UT_ATTR_LOW:
            nResult = TRUE;
            break;
        default:
            // georg: dev warning if called with invalid parameters
            Warning("[UT_AttributeCheck] Attribute check against unknown nLevel. Please notify yaron. Details: " + GetCurrentScriptName());
    }

#2
CID-78

CID-78
  • Members
  • 1 124 messages
you actually need to look at a bigger picture then this single function. so you know what the parametrs comes from.

#3
Sunjammer

Sunjammer
  • Members
  • 926 messages
This function is only called by the gen00pt_attributes script. Stripping away the redundant code makes it easier to see that there is no scaling. To pass the HIGH test the player simply need to have an attribute level of 30 or above. To pass the MED test the player simply needs to have more an attribute level of more than 15 or above. The player always passes the LOW test making them redundant.