HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Getting Intelligence from a unit

05-27-2006, 04:30 PM#1
Siphonized
I'm new to JASS and want to know how to retrieve Intelligence from a unit that is attacking another unit.

EDIT: I want to know the function name, like "GetUnitIntelligene(unit)" or whatever it is.
05-27-2006, 04:35 PM#2
Jacek
Always before asking such questions, try to make a trigger retrieving that info in GUI and then convert it to JASS and look the function name.
05-27-2006, 04:39 PM#3
Anopob
What do you mean? Like 1 unit attacking another unit, which makes the attacking unit gain 1 INT? If you're new to JASS I suggest you learn how to do that trigger in GUI 1st...

EDIT: Yeah, follow Jacek.
05-27-2006, 04:42 PM#4
Siphonized
I know how to do it in GUI just wasn't aware that you could convert to JASS in the GUI :p
05-27-2006, 04:46 PM#5
Jacek
So make some shit trigger in gui that uses inteligence of hero, convert trigger to jass (Edit -> Convert to Custom Text) and just look for the function.
05-27-2006, 05:00 PM#6
Rising_Dusk
Collapse JASS:
native GetHeroInt takes unit whichHero, boolean includeBonuses returns integer

So...

Collapse JASS:
call GetHeroInt(hero, true)
If you want the + stats bonus or such, otherwise make that boolean false.

GUI => JASS gives a BJ.
Don't use the BJ, use what I told you (The native).
The BJ looks retarded, lots of shiza you just don't need to deal with.
05-27-2006, 05:02 PM#7
Thunder_Eye
...
you mean
Collapse JASS:
local integer i = GetHeroInt(hero, true)
05-27-2006, 05:02 PM#8
Jacek
probably :) I am on my brother's comp he doesn't have WE so I weren't able to post exact func
05-27-2006, 05:06 PM#9
Rising_Dusk
I was just putting the function.
I had to assume he had some knowledge of what 'returns int' means. :P
05-27-2006, 05:07 PM#10
Thunder_Eye
ok;P
call GetHeroInt wouldn't work anyway
05-27-2006, 05:11 PM#11
The)TideHunter(
Collapse JASS:
call GetHeroInt(someunit, someboolean)

Would work, it just wouldent do anything
05-27-2006, 05:15 PM#12
Jacek
yup but if it were returning location or group then it would leak... btw I think it is end of the topic.
05-27-2006, 05:16 PM#13
Rising_Dusk
I use it primarily in conditionals.

Collapse JASS:
if GetHeroInt(hero, true) > 2 then
    call SetUnitExploded(SomeUnit, true)
endif

So I really don't even think of it in terms of setting locals.
Sorry for the mixup. >_<
05-27-2006, 05:28 PM#14
Siphonized
Ok what about this.. I got a custom spell called

A011:Andb or something

Do I use A011 or the full name to call it?
05-27-2006, 05:29 PM#15
Thunder_Eye
just A011