HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How can I get ability's order string in Jass.

08-15-2009, 12:24 PM#1
Summoner
There were functions such as "GetSpellAbilityId" in Jass. But what can I do If I want get the order string of ability being cast?
Collapse JASS:
call IssueTargetOrderBJ( GetLastCreatedUnit(), <orderstring>, GetSpellAbilityUnit() )
By the way, does "IssueTargetOrderBJ" function ignore techtree requirement? If it does not what shall I do to make it does.
08-15-2009, 12:40 PM#2
Tot
I use
Collapse JASS:
call IssueImmediateOrder(unit,AbilityId2String('rawcodeOfAbility'))
and it works
08-15-2009, 02:05 PM#3
Summoner
Well, then Is the "unit" the target of the order or the caster?
08-15-2009, 02:14 PM#4
Tot
bad example, use yours
Collapse JASS:
call IssueTargetOrderBJ( GetLastCreatedUnit(), AbilityId2String('rawcodeOfAbility'), GetSpellAbilityUnit() )
08-15-2009, 02:24 PM#5
Summoner
I understand. Thanks a lot
By the way, does "GetSpellAbilityUnit()" refer to the caster?
08-15-2009, 02:27 PM#6
Tot
I think so, cause for getting the target is GetSpellTargetUnit()
08-15-2009, 03:48 PM#7
Troll-Brain
Quote:
Originally Posted by extract of common.j
// Not currently working correctly...
constant native AbilityId takes string abilityIdString returns integer
constant native AbilityId2String takes integer abilityId returns string
So i guess it fails at least sometimes.


Would be better to use GetObjectName instead.
08-16-2009, 01:21 AM#8
thehellman
GetAbilityId2String doesn't get the raw data integer 'XXXX', it gets these sequence of numbers that looks more liekt his 801381

If you do a test, you can see how they vary.
08-16-2009, 05:35 AM#9
Summoner
I needn't get ability's raw data like "ANcl". I need to get the data that could be used in issure order.
08-16-2009, 07:20 AM#10
Pyrogasm
You can get it, but it would be incredibly hard and stupid.

You'd have to create a dummy unit, add the ability to it, and then loop through every single OrderId from 851900 to 853000 and check if the unit can be ordered to use that order with a point target, unit target, destructible target, item target, and no target. If any of those return true, then that is the spell's OrderId, and you simply return OrderId2String(<the order>).

You'd probably break the OP limit, though.

If you know the ability's hotkey, you might be able to do something with ForceUIKey, but I don't know about that.
08-16-2009, 07:57 AM#11
Troll-Brain
Or you can use an hashtable to link the ability id with their orderid or orderstring.
08-16-2009, 10:48 AM#12
Summoner
Well, well. I just want to make a "Magic Mirror" ability which bounce spells to the caster.
My idea was to create a dummy unit and add the ability of being cast by caster to the dummy unit and order the dummy unit to cast the ability at the original caster.
Is it the best way to do this? Must I use the "Issure Order"? Thanks.
08-16-2009, 10:56 AM#13
Troll-Brain
Yes you must use issue order.
If you have no idea about how to use an hashtable or jass in general i can make the code.
08-16-2009, 11:30 AM#14
Summoner
It's ture that I have no idea of hashtable and I am a greenhand of jass I can only understand jass code but know little about make the code.
I tried to make one using GUI but it was nearly impossible.
08-16-2009, 11:47 AM#15
Troll-Brain
Wait, i guess the dummy's spell must be instant (no time cast), not like the caster's one ?