HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What's wrong with this line?

09-30-2008, 07:31 PM#1
DarkTichondrius
JASSHelper returns errors for this line of JASS. While I admit it is not the prettiest thing in the world, I cannot see what is actually wrong with it. Can anyone see it?

Collapse JASS:
call SetUnitState( udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer()) + 1], UNIT_STATE_MANA, ( GetUnitState( udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer())], UNIT_STATE_MANA ) + ( 2 * ( 0.001 + (SquareRoot(GetHeroInt(udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer()) + 1], true)) * GetHeroInt(udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer()) + 1] * 0.035 ) ) ) + R2I(udg_MP2[GetPlayerId(GetEnumPlayer()) + 1]) ) ) )
~Tiranasta~
09-30-2008, 07:47 PM#2
TotallyAwesome
What error is it giving you? Besides, we don't know anything about variables.
09-30-2008, 07:49 PM#3
Alexander244
That's what you get for trying to use GUI's obfuscated code.
Collapse JASS:
native GetHeroInt takes unit whichHero, boolean includeBonuses returns integer
... GetHeroInt(udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer()) + 1] * 0.035    ) ...
09-30-2008, 07:51 PM#4
DarkTichondrius
So I can't use 0.035?

EDIT: The errors are:

Bad types for binary operator
Cannot convert real to unit
Not enough arguments passed to function

EDIT2: Oh wait, I see what you're saying Alexander, I'll change that and then see if it fixes anything.

EDIT3: Ok, changed to:

Collapse JASS:
call SetUnitState( udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer()) + 1], UNIT_STATE_MANA, ( GetUnitState( udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer()) + 1], UNIT_STATE_MANA ) + ( 2 * ( 0.001 + (SquareRoot(GetHeroInt(udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer()) + 1], true)) * GetHeroInt(udg_plr_CHARACTER[GetPlayerId(GetEnumPlayer()) + 1] ) * 0.035 ) ) + R2I(udg_MP2[GetPlayerId(GetEnumPlayer()) + 1]) ) ) )

That fixed the first two errors, but I still get 'Not enough arguments passed to function'.

EDIT4: Never mind, that one's obvious, it's the same GetHeroInt call as was the problem before.

Thanks!