AI for Hero Arena

Steel_Cold

New Member
I have been working on a Hero Arena lately and had the idea of putting AI in the map for single player, but a problem came around when i needed the AI to learn their abilities. I need a way to make the computer's heroes to learn their abilities when they level up without making it a long sting of If Conditions, Then Action.
 
Werbung:

Xeridanus

New Member
um, well the event would be a hero gains a level up.

This is the random way.
<div class='triggertop'>TRIGGER</div><div class='triggermain'> Hero AI
Events
Unit - A unit Gains a level
Conditions
if.gif
(Unit-type of (Leveling Hero)) Equal to <YOUR HERO HERE>
tree_spacer.gif
action.gif
Actions
tree_spacer.gif
tree_spacer.gif
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
condition.gif
If - Conditions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
if.gif
(Level of (Leveling Hero)) Equal to 6
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
action.gif
Then - Actions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
hero.gif
Hero - Learn skill for (Leveling Hero): Your Ult Skill
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
action.gif
Else - Actions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
set.gif
Set randInt = (Random integer number between 1 and 3)
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
condition.gif
If - Conditions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
if.gif
randInt Equal to 1
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
action.gif
Then - Actions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
hero.gif
Hero - Learn skill for (Leveling Hero): Your 1st skill
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
action.gif
Else - Actions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
condition.gif
If - Conditions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
if.gif
randInt Equal to 2
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
action.gif
Then - Actions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
hero.gif
Hero - Learn skill for (Leveling Hero): Your 2nd skill
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
action.gif
Else - Actions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
condition.gif
If - Conditions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
if.gif
randInt Equal to 3
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
action.gif
Then - Actions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
hero.gif
Hero - Learn skill for (Leveling Hero): Your 3rd skill
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
action.gif
Else - Actions
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
tree_spacer.gif
general.gif
Do nothing
</div>

if you have more then one hero (i think you do), you will have to sort them out first, either set up an if statement before everything or put it in the conditions and make multiple triggers.

~Xeridanus

PS: im doing this from uni so i don't have WE here, so i can't get the correct functions names. i'll fix it up when i get home.

PPS: I have fixed it up. all you have to do to make it non-random is fill in the other levels using the same thing i did for the ult. and of course put it in the right order. or you could make an array of skills with the skills in the right order (you will have to double up in the array). then just use the level of the hero as the array index. call your leveling trigger at map initialisation. otherwise he'll have one skill point left over all the time.
 

Steel_Cold

New Member
It all works great except for one problem. What if the AI hero has maxed out that ability? Then the hero just doesnt learn an ability :/
 

Undead_Lives

New Member
Oh, and you should also add in another condition that says the hero's level is NOT equal to the level(s) where you can get an ultimate. Then create another trigger for those levels.
 

Xeridanus

New Member
no, that has already been incorporated into my trigger. he'll only have to add in more of the first If-Then statements.
 
Werbung:
Top