How to start a hero with an ability pre-learned

Holygiant

Active Member
Reaction score
1
I only need one more thing done before releasing my map. Essentially, in my map, every hero has a 'Summon Engineer' ability that lets them spawn a unit based on the Water Elemental summon spell from neutral. However, you have to put a skill point in to learn it and I want to be able to start heroes with it already learned, because otherwise heroes are too far behind.

I tried putting it as the Default Ability, which after some searching I learned just means that it starts on autocast. Is there any way to do this, preferably without triggers? Triggers would complicate this a lot because of my hero pick triggers.
 

Xialian

Member
Reaction score
8
You won't be able to do it without triggers, but I've set a simple one up for you (with the Paladin as an example)
Trigger:
  • Default Spell
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • Hero - Learn skill for (Triggering unit): Human Paladin - Holy Light

I think this is the easiest way of doing it.

Edit: If the unit is pre-placed, you can select it and set the skill level of Summon Engineer to 1, otherwise, I don't think there's a solution except for a trigger.
 

Holygiant

Active Member
Reaction score
1
You won't be able to do it without triggers, but I've set a simple one up for you (with the Paladin as an example)
Trigger:
  • Default Spell
    • Events
    • Unit - A unit Finishes training a unit
    • Conditions
    • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
    • Hero - Learn skill for (Triggering unit): Human Paladin - Holy Light

I think this is the easiest way of doing it.

Edit: If the unit is pre-placed, you can select it and set the skill level of Summon Engineer to 1, otherwise, I don't think there's a solution except for a trigger.



I tried this like this, and it didn't work:

Trigger:
  • Ramrider red
    • Events
    • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • (Clicked dialog button) Equal to DialogRamrider
    • (Triggering player) Equal to Player 1 (Red)
    • Actions
    • Unit - Create 1 Ramrider for (Triggering player) at (Center of redspawn <gen>)
    • Camera - Pan camera for (Triggering player) to (Center of redspawn <gen>) over 0.00 seconds
    • Hero - Learn skill for (Picked unit): Summon Engineer


I also tried it by setting the (Picked unit) to (Triggering unit) and neither worked.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
When a unit is trained then the triggering unit is the building that trained the unit.
For the first trigger you should use (Trained Unit) instead.
 

Solu9

You can change this now in User CP.
Reaction score
216
Do the ability need to be a hero ability?
If not, then just check it as a standard ability an add it to the heroes. Either in the object editor or via triggers.
 

Xialian

Member
Reaction score
8
Thanks for correcting me, Accname. I haven't done a trigger with training for a long time. Also, picked unit won't work in that trigger, as you will have to set it to "Last Created Unit". The Ramrider was never picked in any way for your trigger to work.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
"Last created unit" wont work either.
Read the description of "last created unit" in the editor. It only works for units created with a trigger.

What you need is "Trained Unit"
 

Xialian

Member
Reaction score
8
I was referring to his trigger that created the unit from a trigger, in which case it would work.

In the other situation, you're right, though :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top