• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

An ability based on an Item Ability

Status
Not open for further replies.
Level 4
Joined
Nov 24, 2007
Messages
55
I'm trying to use the "Wand Of Illusion" ability as a "Dummy ability" in a trigger, so that I could create a Dummy, give it this ability, set it to an appropriate level based on the level of an ability the caster has, and then order the dummy to "Wand of Illusion" a unit (be it the caster or target depending on some other stuff).

However, as I was duplicating the Wand of Illusion ability, and editing it for my purposes and giving it the 3 levels and whatnot, I noticed that it does not have a "Text - orderstring" which made me realize I would not later be able to call "IssueTargetOrder" in JASS. I checked the GUI and it seemed the only way to really do this would be to make 3 items (one for each level) and give it to the dummy (give the dummy an inventory ability), and order the dummy to use item in slot 0 or whatever.

Does anyone know of a way to make it into a unit ability (just so I don't have to go through the hassle of making items) and order the unit to use it?
 
Level 9
Joined
May 30, 2008
Messages
430
Try this :ugly:
 

Attachments

  • hot hot ahaha.JPG
    hot hot ahaha.JPG
    139.4 KB · Views: 106
Level 4
Joined
Nov 24, 2007
Messages
55
Oh yes, I did that. Of course. However, that still doesn't suddenly change the spell from not being based on an Item Move, and it does not have an order string, so i can't seem to find any way to trigger it other than giving it as an item to a dummy and having it use that item (which I would 'like' to avoid)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Lol.
It has a Text - Order String - Activate... it is just set to None.
Just set it to anything else ...
 
Level 9
Joined
May 30, 2008
Messages
430
Do i need to give you screen on what you must do or what can't you search it for your self. (If i was admin i will make some restrictions for players that don't read the spell destruction or tutorials but any way i am NOT) So here is your order just write whatever you wonna (and are you 8-10 years old?)
 

Attachments

  • Order.JPG
    Order.JPG
    142.4 KB · Views: 89
Level 4
Joined
Nov 24, 2007
Messages
55
I read your responses and was a little shocked, as I had always been under the impression that changing the "Text - Order String" does absolutely nothing. After all, all the tutorials had always taught me that you cannot have two moves based on the same base spell. I.e., you can't have a hero have two moves based on Holy Light, (orderstring 'holybolt'), and that simply changing the Text-Order String field would do nothign (I had tried that and indeed it did do nothing.)

So I went ahead and changed the order string as per your instructions. I then changed my code, so that the dummy would now just learn the ability (rather than get an item which had that ability) and called "Issue Target Order" with the order string. It did not work, so I tried the "Activate" field also. That too did not work.

<Edit: I could not for the life of me figure out how to attach an image as a thumbnail, so I pulled it down. All it showed was that I changed the Order String - Activate to "magicundefend" and the Order String - Use to "mirrorimage"

Does anyone else have any ideas (besides just relying on it being an item ability and adding the item to the dummy.) Here is my sample code of me trying this out (all the commented out lines are from using it as an Item).

JASS:
function Trig_XD_Aug_Zeal takes unit u, unit t returns nothing
    local unit dummy = CreateUnit( GetOwningPlayer(u), 'h003', GetUnitX(t), GetUnitY(t), 0.0)
    local integer lvl = GetUnitAbilityLevel( u, 'A062' )
    local item it
    local integer itId
    call UnitApplyTimedLife( dummy, 'BTLF', 2.0 )
    if( lvl > 0 ) then // probably very unneccessary, but, meh.
 
       // old way, based on items
       // set itId = Trig_XD_Aug_GetZItem(lvl)
       // set it = CreateItem( itId, 0, 0 )
       // call UnitAddItem( dummy, it )
       // call UnitUseItemTarget( dummy, it, t )
       // call UnitUseItemTarget( dummy, it, t )
       // if( lvl == 3 ) then
       // call UnitUseItemTarget( dummy, it, t )
       // endif
 
 
       call BJDebugMsg( "Adding Ability!" )
       call UnitAddAbility( u, 'A06M' ) // Testing if my unit gets the ability. He does, and the ability works via clicking.
                            // however, what the orderstring /Really/ is...who knows
       call UnitAddAbility( dummy, 'A06M' )
       call IssueTargetOrder( dummy, "mirrorimage", t ) // fails
       // call IssueTargetOrder( dummy, "magicundefend", t ) // also failed
    endif
    set it = null
    set dummy = null
    set u = null
    set t = null
endfunction

attachment.php
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
Indeed, having 2 spells(or more) with the same order string is not recommended(actually I never did that :D ). But there are about 100 different order strings... so a unit can have about 100 different abilities. And a lot more without one(i.e. Passives).
Whether the ability is based on an item ability or not does not matter.
There are two reasons I can think of:
You have screwed up the ability's targets(but you say it is working).
the other is more of a suggestion: find a order string of an ability that uses a target(i.e. "charm","slow","chainlightning" and etc).
If that does not work, you have screwed something in the object editor.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
No, you are not :p
As I knew, order string is just a way to recognize the order, so my previous suggestion was rubbish.
Anyway here is how to order this and a bonus, from which you can learn something ;)
P.s. Some abilities do not have order strings, although OE suggests they do :p
But if you do not want to bother downloading the map:
call IssueTargetOrderById(a,852274,b)

But you should check this in the map, cause I might have got the number wrong.
 

Attachments

  • illusion.w3x
    13.1 KB · Views: 34
Status
Not open for further replies.
Top