• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Custom Script not working

Status
Not open for further replies.
Level 14
Joined
Jul 25, 2011
Messages
1,065
  • For each (Integer A) from 1 to 3, do (Actions)
    • Loop - Actions
      • Set AbilityInteger[1] = 1
      • Set AbilityInteger[2] = 4
      • Set AbilityInteger[3] = 8
      • Custom script: call SaveIntegerBJ( 'AHhb', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hpal')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHbz', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hamg')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHtb', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hmkg')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHfs', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hblm')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AOwk', GetHandleIdBJ(GetUnitsOfTypeIdAll('Obla')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AOcl', GetHandleIdBJ(GetUnitsOfTypeIdAll('Ofar')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AOsh', GetHandleIdBJ(GetUnitsOfTypeIdAll('Otch')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AOhw', GetHandleIdBJ(GetUnitsOfTypeIdAll('Oshd')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Set AbilityInteger[1] = 2
      • Set AbilityInteger[2] = 5
      • Set AbilityInteger[3] = 9
      • Custom script: call SaveIntegerBJ( 'AHds', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hpal')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHwe', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hamg')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHtc', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hmkg')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHbn', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hblm')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Set AbilityInteger[1] = 3
      • Set AbilityInteger[2] = 7
      • Set AbilityInteger[3] = 10
      • Custom script: call SaveIntegerBJ( 'AHad', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hpal')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHab', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hamg')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHbh', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hmkg')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHdr', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hblm')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • -------- Set Last Skills --------
      • Custom script: call SaveIntegerBJ( 'AHre', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hpal')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHmt', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hamg')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHav', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hmkg')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
      • Custom script: call SaveIntegerBJ( 'AHpx', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hblm')), udg_AbilityInteger[GetForLoopIndexA()], udg_AbilityHash )
  • AI Herp Learn Skill
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • Custom script: set udg_TempAbility = LoadIntegerBJ(GetHandleIdBJ(GetUnitsOfTypeIdAll(GetUnitTypeId(GetTriggerUnit()))), GetHeroLevel(GetTriggerUnit()), udg_AbilityHash)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Hero level of (Triggering unit)) Less than or equal to 3
              • (Hero level of (Triggering unit)) Equal to 6
        • Then - Actions
          • Unit - Add TempAbility to (Triggering unit)
        • Else - Actions
          • Unit - Set level of TempAbility for (Triggering unit) to ((Level of TempAbility for (Triggering unit)) + 1)
      • Custom script: set udg_TempAbility = 0
The trigger above won't work.... What's wrong???
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Custom script: call SaveInteger(udg_AbilityHash , 'Hpal', udg_AbilityInteger[bj_forLoopAIndex], 'AHre')
This will save AHre ability, using paladin unit type as the parent key.

Load data:
  • Custom script: set udg_Integer = LoadInteger(udg_AbilityHash , GetUnitTypeId(GetTriggerUnit()), GetHeroLevel(GetTriggerUnit()))
  • Custom script: set udg_Ability = udg_Integer
The ability id is loaded into the integer variable. The second custom script converts the id into an ability that you can use with GUI.
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
  • Custom script: call SaveInteger(udg_AbilityHash , 'Hpal', udg_AbilityInteger[bj_forLoopAIndex], 'AHre')
This will save AHre ability, using paladin unit type as the parent key.

Load data:
  • Custom script: set udg_Integer = LoadInteger(udg_AbilityHash , GetUnitTypeId(GetTriggerUnit()), GetHeroLevel(GetTriggerUnit()))
  • Custom script: set udg_Ability = udg_Integer
The ability id is loaded into the integer variable. The second custom script converts the id into an ability that you can use with GUI.

Why do you have to set
Ability = Integer
Why not just
Ability = Load ? From...
 
Status
Not open for further replies.
Top