• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Item to Spell Problem

Status
Not open for further replies.
Level 4
Joined
May 3, 2008
Messages
51
Heyho, YES I've used search function. Still can't figure out why my trigger doesn't wanna work. Here it is:

  • Events
    • Unit - A unit acquires an Item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal To Instant Death
  • Actions
    • Hero - Learn skill for (Buying unit): Instant Death
I've also tried to put "Hero manipulating item" instead of "Buying unit".
Still doesn't work.

I think it's a really simple problem, but I just didn't work with the WE for a long time ;) So please help!
 
Level 11
Joined
Jan 25, 2009
Messages
572
Solution

If the unit have the spell already in the "Learn skills" thing, then you can just use this below▼
  • Unit - Set level of Your Spell for (Triggering unit) to 1 //or higher if you want to
If you want the unit to get the ability, not have it already, you can try this below▼
  • Unit - Add 'You Spell' to (Triggering unit) //Adds the spell =)
I do really hopes that this works. Otherwise you can just contact me with a PM and then i'll do this for you =)
 
Level 11
Joined
Feb 14, 2009
Messages
884
Solution

If the unit have the spell already in the "Learn skills" thing, then you can just use this below▼
  • Unit - Set level of Your Spell for (Triggering unit) to 1 //or higher if you want to
If you want the unit to get the ability, not have it already, you can try this below▼
  • Unit - Add 'You Spell' to (Triggering unit) //Adds the spell =)
I do really hopes that this works. Otherwise you can just contact me with a PM and then i'll do this for you =)

Try adding the spell to your hero and THEN level it up.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I believe there is a trick that involves using the Engineering Upgrade that allows you to add abilities to a hero's available ability list. At the moment Wc3c.net is down, but I'll try to find you some documentation.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Okay I've uploaded a test-map that shows you how it works. When you are testing it, press escape to add the ability Blink to the Paladin's list of hero skills (all he's got is Holy Light).
 

Attachments

  • test.w3x
    16.8 KB · Views: 46
Level 18
Joined
Jan 21, 2006
Messages
2,552
You dont get me because when creating a spell

What?

i meaby add the spell slow to it and that i do throught triggers and that WORKS!

You're clearly confused. This isn't about how to add an ability to a unit. This is about how to add an ability to a Hero and have it show up in the Hero Skills menu; not just on its command card. Clearly you haven't even read the last few pages of this thread - what you're saying has not only been said before, but it also is not what the author of this thread is trying to do.
 
Level 4
Joined
May 3, 2008
Messages
51
Ok that works nice for me. So now the last thing: How does that Trigger work?
What do I have to modify to create that for other spells? Where can I modify the event?

I really have no idea of JASS. But that doesn't mean that I wouldn't get into the trigger if you'd explain to me :)
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well the trigger is really simple. Actually the function initDelayed part isn't even necessary. Basically what it does is give a disabled "placeholder" ability to the hero (this is done in the Object Editor). Then, using a disabled Engineering Upgrade ability I simply add it to the hero which causes his previously disabled placeholder ability to be replaced with Blink, in addition to showing up in the Hero Skills Menu.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well you can just make one yourself in GUI - it's not that difficult.

If you're trying to do this for multiple abilities then you'll need more Engineering Upgrade abilities and placeholder abilities.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Every thread I post in is automatically subscribed, so as long as you post back here I'll see it when I check my Control Panel.

Now, regarding the matter hand, I believe that is correct; that should be all you need. Though, Wc3c.net is back up so let me post for you exactly what the ability guide says:

WarCraft III: Ability Guide said:
ANeg (Engineering Upgrade): The engineering upgrade finally solves the problem of not levelable trigger added hero skills. It allows to add hero skills with triggers and to still have them in the levelup menu. Therefore the hero needs to have dummy hero skills that can then be replaced by the actual skills. The placeholder skills need to have the same amount of levels and level skip requirements that's why you will probably need one for ultimates and one for normal hero skills. I usually base my placeholder skills off of Arpb (Replenish) but the base skill really shouldn't matter. The placeholder with 3 levels and 2 levels skip can simply be given to the hero several times. Then the placeholder skills must be disabled for all players at map initialization, so they don't show up in the levelup menu at first. Then you will just need an adder ability based off of engineering upgrade for each skill that you might want to have on the hero. The upgrade will replace the skills in the order of their ability upgrade field when it's added, and replace them backwards when it's removed. So if you want to abuse the engineering upgrade but don't want the passive upgrade icon on the unit you can simply have an engineering upgrade with the abilities B, A in the upgrade field and then when you add and remove it on a unit that has A it will then have B. That's because adding it will do nothing as B is not there, but removing it will replace A with B. As soon as a hero ability has been added that way it will be learnable in the levelup menu. Note that replacing skills only works well for unlearned hero skills. Replacing learned skills or normal unit skills will not actually replace them, it will just update the fields like range, area of effect, duration, icon, targets allowed, and so on, but will not change the hardcoded part of the ability. For example changing an aura to the heal ability will only change the icon, tooltips, range and probably some other fields, but it will still be an aura. If the ability that is being replaced is disabled at the time the results become even weirder and you can never know what you will get. Also the engineering upgrade only works for heroes, adding it to normal units will crash the game for some reason. Another weird bug with it is, that you have to specify all four upgraded abilities, otherwise it might not work. If you only want to upgrade one ability, you can simply specify ability ids that the unit will never have for the rest. Also dynamic tooltips like <dataA5> are flawed above level 3. Also the default buff shouldn't be replaced, but it doesn't show up anyway, so that's not really an issue.
 
Level 4
Joined
May 3, 2008
Messages
51
Ok, I think I really got it!!

  • Start Trigger
  • Events
    • Map Initialization
  • Actions
    • Player - Deactivate Skill Slot (normal) for Player 1 (Red)
    • Player - Deactivate AbilBugB for Player 1 (Red)
    • Player - Deactivate AbilBugW for Player (Red)
  • Learn Trigger
  • Events
    • Player - Player 1 (Red) types a chat message containing learn as exact ...
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • 'IF'-Conditions
        • (Level of AbilBugB for Paladin 0000 <gen>) greater than 0
      • 'THEN'-Actions
        • Unit - Remove AbilBugB from Paladin 0000 <gen>
      • 'ELSE'-Actions
        • Unit - Add AbilBugB to Paladin 0000 <gen>
 
Status
Not open for further replies.
Top