- Joined
- Jul 25, 2011
- Messages
- 1,061
I need to save an ability in a hash table. But world editor crashes when I try to. Any custom scripts that solves it?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Custom Script: set udg_Int = udg_abil
Custom Script: set udg_abil = udg_Int
when he said "use integers" i believe he meant store the rawcode of the spell..
call SaveInteger(HASH, ParentID, childID, abilityID)in addition, save an ability like this...
call SaveInteger(HASH, ParentID, childID, abilityID)
Yes, ability ID is a rawcode.
Custom script: call SaveInteger(udg_AbilityHash,Hamg,1,AHbz)
Custom script: call SaveIntegerBJ( 'AHbz', GetHandleIdBJ(GetUnitsOfTypeIdAll('Hamg')), 1, udg_AbilityHash )
This doesn't work. What's wrong?
Custom script: call SaveInteger(udg_AbilityHash,Hamg,1,AHbz)
Custom script: call SaveInteger(udg_AbilityHash,'Hamg',1,'AHbz')
Custom script: call SaveInteger(udg_AbilityHash,'Hamg',1,'AHbz')
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
GetUnitsOfTypeIdAll returns a group, so you will never get the right handle ID there. I think you meant to get a unit who corresponds to that type ID, right?
Custom script: set udg_TempAbility = LoadIntegerBJ(GetHandleIdBJ(GetUnitTypeId(GetTriggerUnit())),GetHeroLevel(GetTriggerUnit()), udg_AbilityHash)
You can't get the handle ID of a unit type ID because handle ID require you to pass a handle, what you passed instead is an integer rawcode.
GetHandleId(GetUnitTypeId(GetTriggerUnit())). Do you mean to store the data TO the triggering unit?You can't doGetHandleId(GetUnitTypeId(GetTriggerUnit())). Do you mean to store the data TO the triggering unit?
Then don't use GetHandleId, just use GetUnitTypeId directly.
Custom script: set udg_TempAbility = LoadInteger( GetUnitTypeId(GetTriggerUnit()), GetHeroLevel(GetTriggerUnit()), udg_AbilityHash)
the first argument must return a hashtable, not an integer...
LoadInteger(hashtable, integer, integer)
