• 🏆 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!

Guide - Teach the AI to their skills properly

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,138
Before sharing this post i was preparing question about this system. But while creating this post, i have solved my issue by myself. And i have decided to share with you.
Now i am changing Title only and sharing this with you.


Hello everyone. I have a huge map with 72 heroes and 288 abilities. I want to make them learn skills in 2 circumstances

1-) When entered map
2-) When they leveled up

I have started with this for the testing purpose.

  • Melee Initialization
    • Events
      • Unit - A unit Gains a level
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unspent skill points of (Triggering unit)) Equal to 1
    • Actions
      • Hero - Learn skill for (Triggering unit): Volcano
      • Hero - Learn skill for (Triggering unit): Incinerate
      • Hero - Learn skill for (Triggering unit): Soul Burn
      • Hero - Learn skill for (Triggering unit): Summon Lava Spawn
      • Unit - Increase level of Volcano for (Triggering unit)
      • Unit - Increase level of Incinerate for (Triggering unit)
      • Unit - Increase level of Soul Burn for (Triggering unit)
      • Unit - Increase level of Summon Lava Spawn for (Triggering unit)
      • Hero - Modify unspent skill points of (Triggering unit): Subtract 1 points
When hero enters map, it sets incinerate directly to Level 2
And i am getting Level 3 Incinerate and Level 2 Soul Burn when my hero is Level 2

Then i have changed trigger just like this

  • Melee Initialization Copy
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unspent skill points of (Triggering unit)) Equal to 1
    • Actions
      • Hero - Learn skill for (Triggering unit): Volcano
      • Hero - Learn skill for (Triggering unit): Incinerate
      • Hero - Learn skill for (Triggering unit): Soul Burn
      • Hero - Learn skill for (Triggering unit): Summon Lava Spawn
      • Hero - Modify unspent skill points of (Triggering unit): Subtract 1 points
  • Melee Initialization Copy 2
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unspent skill points of (Triggering unit)) Equal to 1
    • Actions
      • Unit - Increase level of Volcano for (Triggering unit)
      • Unit - Increase level of Incinerate for (Triggering unit)
      • Unit - Increase level of Soul Burn for (Triggering unit)
      • Unit - Increase level of Summon Lava Spawn for (Triggering unit)
      • Hero - Modify unspent skill points of (Triggering unit): Subtract 1 points
I have selected my hero from tavern and i get Level 1 Incinerate and i spent my point. It was nice.
But after i leveled up, my incinerate becomes Level 2.
What was supposed to happen: Level 2 hero with Level 1 Incinerate and Level 1 Soul Burn
What was happened: Level 2 hero with Level 2 incinerate
But trigger is doing it's job. We cannot blame trigger.

After this problem i have updated trigger like this

  • Melee Initialization Copy 3
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Hero - Learn skill for (Triggering unit): Volcano
      • Hero - Learn skill for (Triggering unit): Incinerate
      • Hero - Learn skill for (Triggering unit): Soul Burn
      • Hero - Learn skill for (Triggering unit): Summon Lava Spawn
It was simple, better and effective. Everything worked well except one thing.
They haven't learning skills when Level 1.

And finally i did it.

  • GainLevel
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Hero - Learn skill for (Triggering unit): Volcano
      • Hero - Learn skill for (Triggering unit): Incinerate
      • Hero - Learn skill for (Triggering unit): Soul Burn
      • Hero - Learn skill for (Triggering unit): Summon Lava Spawn
      • Hero - Learn skill for (Triggering unit): Resurrection
      • Hero - Learn skill for (Triggering unit): Divine Shield
      • Hero - Learn skill for (Triggering unit): Holy Light
      • Hero - Learn skill for (Triggering unit): Devotion Aura
  • EnterMap
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unspent skill points of (Triggering unit)) Equal to 1
      • (Hero level of (Triggering unit)) Equal to 1
    • Actions
      • Trigger - Run GainLevel <gen> (ignoring conditions)
And here is the result. I wasn't knew that it will gonna work like this but it is worked. I am happy now.
When units enters map with skill points when they are level 1, i have simply running Gains Level trigger and it worked.
I wasn't knew "Learn Skill" can upgrade their abilities.
With this system you can select their starting skills and skill learn order.

I was planning to ask about, then i have solved by myself.
 
Status
Not open for further replies.
Top