1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

List of non-working object data constants

Discussion in 'The Lab' started by MyPad, Aug 6, 2019.

  1. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,320
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    The thread specifically addresses which object data related constants do not get modified {work} (or are problematic in certain ranges) in the most recent patch (Not including the World Editor). This is a list in progress, so it may not yet include all the dysfunctional constants.

    Legend:

    elements in nonFunctional table -> Do not work, but do not crash the game.
    elements in problematic table -> Do work, but will crash at certain values.

    Code (Lua):

    nonFunctional = {
        ABILITY_SF_NAME
    }
     

    Code (Lua):

    problematic = {
        UNIT_IF_DEFENSE_TYPE,  -- Suspected that values exceeding 7 will not behave as intended
                                  -- Values 8 - 15 are just translated up by 8 (hides the armor icon)
                                  -- Values 16 - 23 hide information (translated up)
                                  -- Values 24, 26 display attribute icons (don't know why that happens).
                                  -- Values including 25 and exceeding 26 will crash the game (most likely).
        UNIT_IF_INTELLIGENCE_PERMANENT,
        UNIT_IF_AGILITY_PERMANENT,
        UNIT_IF_STRENGTH_PERMANENT
                                  -- They do not return the updated values when set via
                                  -- BlzSetUnitIntegerField. (Only returns 1).
    }
    nonfunctional = {
        UNIT_IF_INTELLIGENCE_WITH_BONUS,
        UNIT_IF_AGILITY_WITH_BONUS,
        UNIT_IF_STRENGTH_WITH_BONUS,
        UNIT_IF_PRIMARY_ATTRIBUTE,
        UNIT_IF_HIT_POINTS_REGENERATION_TYPE
                                  -- Even if the result is successful, this does not actually change
                                  -- the regeneration type.
    }
     

    Code (Lua):

    nonFunctional = {
        UNIT_RF_TURN_RATE,
        UNIT_RF_MANA,
        UNIT_RF_MAXIMUM_PITCH_ANGLE_DEGREES,
        UNIT_RF_MAXIMUM_ROLL_ANGLE_DEGREES,
        UNIT_RF_SHADOW_IMAGE_WIDTH
        UNIT_RF_FLY_HEIGHT
        UNIT_RF_SHADOW_IMAGE_HEIGHT
        UNIT_RF_SPEED
                                 -- Some of these may update in game time (They do not immediately
                                     return the assigned value from the setter, though this is mostly speculation).
    }
     

    Code (Lua):

    problematic = {
        UNIT_SF_NAME   -- Do not pass "" as a parameter (crashes the game)
                                  -- Appears to modify proper name as well.
    }
     

    Code (Lua):

    nonFunctional = {
     
        UNIT_WEAPON_IF_ATTACK_DAMAGE_NUMBER_OF_DICE
        UNIT_WEAPON_IF_ATTACK_MAXIMUM_NUMBER_OF_TARGETS
        UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE
        UNIT_WEAPON_IF_ATTACK_AREA_OF_EFFECT_TARGETS[/FONT]
     
        UNIT_WEAPON_IF_ATTACK_DAMAGE_BASE
        UNIT_WEAPON_IF_ATTACK_DAMAGE_SIDES_PER_DIE
        UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED
        UNIT_WEAPON_IF_ATTACK_WEAPON_SOUND
            -- Virtually all fields do not work
    }
     

    Code (Lua):

    nonfunctional = {
        -- Virtually all fields do not work.
    }
     

    Code (Lua):

    nonfunctional = {
        -- Virtually all fields do not work.
    }
     

    Code (Lua):

    nonfunctional = {
        UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART
                                               -- Cannot be modified for melee units.
                                               -- Does not appear to change the model even when
                                               -- applied.
    }
     


    If you want to test things out, you can use the following script (scripting language must be in Lua):
    Code (Lua):

    ObjectEditorTypes = {
        --  Ability-related fields.
        IF = {exclude=true},
        RF = {exclude=true},
        SF = {exclude=true},
        BF = {exclude=true},
        ILF = {exclude=true},
        RLF = {exclude=true},
        SLF = {exclude=true},
        BLF = {exclude=true},

        --  Unit-related fields.
        UIF = {exclude=false},
        URF = {exclude=true},
        USF = {exclude=true},
        UBF = {exclude=true},
        UWIF = {exclude=true},
        UWRF = {exclude=true},
        UWSF = {exclude=true},
        UWBF = {exclude=true},
    }
    ObjectEditorTypes.initialized   = false
    ObjectEditorTypes.doManipulate  = true
    ObjectEditorTypes.breakpoint    = nil
    ObjectEditorTypes.abilityIndex  = 3

    function OnSelect(u)
        if not ObjectEditorTypes.initialized then
            for k, v in pairs(_G) do
                if k:sub(1, 7) == 'ABILITY' then
                    local j = 9
                    local i = j
                    while true do
                        if k:sub(j, j) == '_' then break end
                        j = j + 1
                    end
                    local str = k:sub(i, j-1)
                    if not ObjectEditorTypes[str].exclude then ObjectEditorTypes[str][k] = v end
                elseif k:sub(1, 4) == 'UNIT' then
                    local usub = k:sub(6, 7)
                    if usub == 'IF' or usub == 'RF' or usub == 'BF' or usub == 'SF' then
                        usub = 'U' .. usub
                        if not ObjectEditorTypes[usub].exclude then ObjectEditorTypes[usub][k] = v end
                    else
                        usub = k:sub(6, 11)
                        if usub == 'WEAPON' then
    usub = k:sub(13, 14)
                            if usub == 'IF' or usub == 'RF' or usub == 'BF' or usub == 'SF' then
                                usub = 'UW' .. usub
                                if not ObjectEditorTypes[usub].exclude then ObjectEditorTypes[usub][k] = v end
                            end
                        end
                    end
                end
            end
            ObjectEditorTypes.initialized = true
        end
        local abil   = BlzGetUnitAbilityByIndex(u, ObjectEditorTypes.abilityIndex)
        if abil == nil then
            print('|cffffcc00Error:|r Ability index is nil.')
            return
        end
        local metaFactory = function(param)
            local f = function(str, strname, setter, getter, ...)
                if ObjectEditorTypes[str].exclude then return end
                local i             = 1
                local params        = table.pack(...)
                local paramcount    = #params
                local lastparam     = params[paramcount]
                local strs          = ""

                table.remove(params, n)

                for k1, v1 in pairs(ObjectEditorTypes[str]) do
                    if ObjectEditorTypes.breakpoint ~= nil and i > ObjectEditorTypes.breakpoint then break end
                    if k1 ~= 'exclude' then
                        if not ObjectEditorTypes.doManipulate then
                            print(strname .. ': Parameter [' .. tostring(i) .. '] ' .. tostring(k1) .. ' being read.')
                        else
                            local result = pcall(setter, param, v1, ...)
                            table.remove(params, paramcount)

                            local success, presult = pcall(getter, param, v1, table.unpack(params))
                            result = result and (presult == lastparam)
                            if not result then
                                print('|cffff2020' .. strname .. ':|r Parameter [' .. tostring(i) .. '] ' .. tostring(k1) .. ' cannot be modified.')
                                print('Expected: ' .. tostring(lastparam) .. '; Observed: ' .. tostring(presult))
                            else
                                print(strname .. ': Parameter [' .. tostring(i) .. '] ' .. tostring(k1) .. ' was successfully modified.')
                            end
                        end
                    else
                        i = i - 1
                    end
                    i = i + 1
                end
            end
            return f
        end
        local abilFactory = metaFactory(abil)
        local unitFactory = metaFactory(u)

        abilFactory('IF', 'AbilityIntegerField', BlzSetAbilityIntegerField, BlzGetAbilityIntegerField, 0)
        abilFactory('RF', 'AbilityRealField', BlzSetAbilityRealField, BlzGetAbilityRealField, 0.)
        abilFactory('SF', 'AbilityStringField', BlzSetAbilityStringField, BlzGetAbilityStringField, "")
        abilFactory('BF', 'AbilityBooleanField', BlzSetAbilityBooleanField, BlzGetAbilityBooleanField, false)

        abilFactory('ILF', 'AbilityIntegerLevelField', BlzSetAbilityIntegerLevelField, BlzGetAbilityIntegerLevelField, 0, 0)
        abilFactory('RLF', 'AbilityRealLevelField', BlzSetAbilityRealLevelField, BlzGetAbilityRealLevelField, 0, 0.)
        abilFactory('SLF', 'AbilityStringLevelField', BlzSetAbilityStringLevelField, BlzGetAbilityStringLevelField, 0, "")
        abilFactory('BLF', 'AbilityBooleanLevelField', BlzSetAbilityBooleanLevelField, BlzGetAbilityBooleanLevelField, 0, false)

        unitFactory('UIF', 'UnitIntegerField', BlzSetUnitIntegerField, BlzGetUnitIntegerField, 6)
        unitFactory('URF', 'UnitRealField', BlzSetUnitRealField, BlzGetUnitRealField, 750.)
        unitFactory('USF', 'UnitStringField', BlzSetUnitStringField, BlzGetUnitStringField, "Horse")
        unitFactory('UBF', 'UnitBooleanField', BlzSetUnitBooleanField, BlzGetUnitBooleanField, true)

        unitFactory('UWIF', 'UnitWeaponIntegerField', BlzSetUnitWeaponIntegerField, BlzGetUnitWeaponIntegerField, 0, 500)
        unitFactory('UWRF', 'UnitWeaponRealField', BlzSetUnitWeaponRealField, BlzGetUnitWeaponRealField, 0, 750.)
        unitFactory('UWSF', 'UnitWeaponStringField', BlzSetUnitWeaponStringField, BlzGetUnitWeaponStringField, 0, "")
        unitFactory('UWBF', 'UnitWeaponBooleanField', BlzSetUnitWeaponBooleanField, BlzGetUnitWeaponBooleanField, 0, true)
    end
     
    State: WIP
    [/color]
     

    Attached Files:

    Last edited: Aug 17, 2019
  2. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,320
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    Added
    UNIT_IF_HIT_POINTS_REGENERATION_TYPE
    to nonfunctional table in UnitIntegerField spoiler.
     
  3. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,320
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    Not too sure with ABILITY_RLF_DURATION_HERO and ABILITY_RLF_DURATION_NORMAL, but when tested with an ability based on Acid Bomb, modification of property didn't work. (Will test out other abilities in the future)
     
  4. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,336
    Resources:
    17
    Tools:
    2
    Maps:
    2
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    17
    ABILITY_RLF_DURATION_HERO and ABILITY_RLF_DURATION_NORMAL worked for me, I changed the Duration of a thunderbolt based on the distance between caster and target. Although in a disable System test, changing the fields for an ability with 0s base Duration did not enable the buff blinking: which Shows the buff would turn off soon.

    ABILITY_RLF_CHANCE_TO_MISS_CRS does nehter work for reading nor writing. (Curse)
    ABILITY_IF_LEVEL_SKIP_REQUIREMENT returns 0, didn't test writing.
     
  5. Clanzion

    Clanzion

    Joined:
    Jul 4, 2016
    Messages:
    398
    Resources:
    0
    Resources:
    0
    Does UNIT_IF_ARMOR_TYPE work?
     
  6. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,320
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    Dunno, but I think it will. Might test later
     
  7. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,336
    Resources:
    17
    Tools:
    2
    Maps:
    2
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    17