• 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.

[JASS] Cannot convert real to integer

Status
Not open for further replies.
Level 6
Joined
Aug 4, 2012
Messages
193
JASS:
(((GetUnitAbilityLevel(GetTriggerUnit(),GetSpellAbilityId()))*0.03)+0.1)*(R2I(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)-(R2I(GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA))))))

how to fix this?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
JASS:
(((I2R(GetUnitAbilityLevel(GetTriggerUnit(),GetSpellAbilityId())))*0.03)+0.1)*(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)))
 
Level 6
Joined
Aug 4, 2012
Messages
193
same, still cannot convert real to integer

i knew what is the problem, when i use getunitabilitylevel(gettriggerunit(),getspellabilityid())*0.5[REAL] then this error occur, so how can i change the integer to real?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
same, still cannot convert real to integer

JASS:
    local real r =(((I2R(GetUnitAbilityLevel(GetTriggerUnit(),GetSpellAbilityId())))*0.03)+0.1)*(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)))

same exact line that i posted and it works fine for me, i edited it once or twice so re-copy and paste and try again. if it doesnt work, are you sure you have the most recent jasshelper + are referring to the correct line?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
R2I((((I2R(GetUnitAbilityLevel(GetTriggerUnit(),GetSpellAbilityId())))*0.03)+0.1)*(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)-(GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA))))

-_-
 
Status
Not open for further replies.
Top