- Joined
- Jun 23, 2007
- Messages
- 4,066
JASS:
call BJDebugMsg("Base Defense = " + I2S(GetObjectFieldInteger('Hpal', "def")))
call BJDebugMsg("Heal Value = " + R2S(GetObjectFieldReal('Ahea', "Rng1")))
Doesn't work for all objects/fields. Many abilities fields work, some upgrades, and some units.
JASS:
function DebugIdInteger2IdString takes integer value returns string // taken from Cheats.j
local string charMap = ".................................!.#$%&'()*+,-./0123456789:;<=>.@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~................................................................................................................................."
local string result = ""
local integer remainingValue = value
local integer charValue
local integer byteno
set byteno = 0
loop
set charValue = ModuloInteger(remainingValue, 256)
set remainingValue = remainingValue / 256
set result = SubString(charMap, charValue, charValue + 1) + result
set byteno = byteno + 1
exitwhen byteno == 4
endloop
return result
endfunction
function GetObjectFieldString takes integer abilCode, string field returns string
local string original = BlzGetAbilityExtendedTooltip('Amls', 1)
local string output
call BlzSetAbilityExtendedTooltip('Amls', "<" + DebugIdInteger2IdString(abilCode) + "," + field + ">", 1)
set output = BlzGetAbilityExtendedTooltip('Amls', 1)
call BlzSetAbilityExtendedTooltip('Amls', original, 1)
return output
endfunction
function GetObjectFieldInteger takes integer abilCode, string field returns integer
return S2I(GetObjectFieldString(abilCode, field))
endfunction
function GetObjectFieldReal takes integer abilCode, string field returns real
return S2R(GetObjectFieldString(abilCode, field))
endfunction
Attachments
Last edited: