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

Making AI use Skill points

Status
Not open for further replies.
Level 9
Joined
Apr 22, 2020
Messages
430
Helloo i have made a custom hero with custom abilities but when the ai hero Levels up i noticed that the ai hero won't spend the skill points thus he cannot use other abilities how do i fix this?
 
Level 23
Joined
Jul 26, 2008
Messages
1,317
Can you post screenshots of all 5 tabs on your AI editor so I can see what you are doing? This is related to your previous question.

As for this question, if you are doing a campaign, there is 0 need to let AI heroes level up. Just trigger it by having event- initialisation and then action- learn XX spell for hero. If you want to learn level 2 of a spell, then you must do X2 of the learn spell trigger. Same for if you want to learn lvl 3 of a spell, just have 3 lines of the same action--- learn spell XX for hero.

If this is a non-campaignAI (you are making a melee map or something), you should can just have each event be the hero reaching a level, and then learning whatever spell you want. The AI editor spell section should normally not be used if you are doing custom race stuff.
 
Level 9
Joined
Apr 22, 2020
Messages
430
Can you post screenshots of all 5 tabs on your AI editor so I can see what you are doing? This is related to your previous question.

As for this question, if you are doing a campaign, there is 0 need to let AI heroes level up. Just trigger it by having event- initialisation and then action- learn XX spell for hero. If you want to learn level 2 of a spell, then you must do X2 of the learn spell trigger. Same for if you want to learn lvl 3 of a spell, just have 3 lines of the same action--- learn spell XX for hero.

If this is a non-campaignAI (you are making a melee map or something), you should can just have each event be the hero reaching a level, and then learning whatever spell you want. The AI editor spell section should normally not be used if you are doing custom race stuff.
Ha-ha hello we meet again and yea this is related to the previous thread and i think this map of mine is not a melee since this map is part of a campaign so i think this a campaign map? I'm just trying to optimize a part - Campaign map and for my question how exactly do i trigger it? Is it done inside the AI editor or in the Trigger Editor?
 
Level 23
Joined
Jul 26, 2008
Messages
1,317
Can you post screenshots of all 5 tabs of your AI editor?

For the spells, you do it in the trigger editor, it is not related to AI. Just make a trigger with event-initilization, then learn the spells by trigger, in the hero section of the trigger editor.
 
Level 23
Joined
Jul 26, 2008
Messages
1,317
hey, I'm not arguing, just want to understand - why? Isn't that what those functions in the AI editor are made for?
Because that section of the AI editor is geared towards AI being made for the standard 4 races, if I am not mistaken. Also, the guy is trying to do a campaign AI, which means normally AI heroes should not level. The AI section hero tab is suited if the AI hero is supposed to level up.
 
Level 9
Joined
Apr 22, 2020
Messages
430
qjKJcty.jpg


7ikaWJJ.jpg


n5MF3gT.jpg


USDuRs7.jpg


CDm0PHB.jpg


By the way those are the draenei ones i haven't made the worgens yet since this is the first one i started with.
 
Level 23
Joined
Jul 26, 2008
Messages
1,317
Ok, from the first picture, remove "set player name" (this should be triggered, or else you ned to reimport the AI anytime you want to change the name), remove "melee" (this should not be used for campaign AI in my opinion, it causes issues and adds an element of randomness), remove "buy items", remove "ignore injured" (you dont want the AI to ignore its own injured units when attacking), remove "remove injuries" (you need the entire attack wave to die when attacking).

For the second picture, remove all that data from it. You do not want anything in the hero tab, set it to none. The AI will still rebuild the hero and use it even if the hero tab is empty. So remove everything so there is only "none".

For picture 3, remove 2,3 and 4 from the workers list. I mean, on the right side of the picture you have 4 lines of workers to harvest gold /lumber. First, since this is an campaign AI, never have anything on "expo". Second, based on the number of "gemcrafters" you have on the build order, you only have a total of 5 workers. So remove the 2 line (lumber 5), 3 line (gold 5) and 4 line (lumber 4). The only remaining one should be line 1(gold 5). You can re-add lumber workers later if you add more gemcrafters. But the total number on the right side must equal the total number of builders you have on the build order. So right now, you have 5 gemcrafters on the build order, so you can only have a total of 5 on the right side. Just add a trigger to add 5000 lumber to your AI for testing purposes right now to see if it is functioning correctly.

Ok, now your defensive AI should be working fine. Just add a trigger to give it 100000 gold and 100000 lumber at the start, then try attacking it. It should rebuild all the units that you kill if you attack the AI base.
 
Level 9
Joined
Apr 22, 2020
Messages
430
Okay okay number 1 is this the right thing?
Bb2vCiW.jpg

And 2: As i have already said that the AI ALWAYS STARTS WITH A TOWN HALL AND PEASANTS instead of the ones i have created
And 3:it seems that the AI seem doesn't work i have imported The ai in my map and use the trigger AI - Start Campaign ai script but when i tested it the player name is still player 2 and the starting units are as what i have said the Human Town hall And Peasants and they build human buildings just like a melee ai.
(I'm really horrible in making AI)
 
Last edited:
Level 23
Joined
Jul 26, 2008
Messages
1,317
Remove "Take items" from the first tab. I forgot to mention it.

How are you "starting" the AI? Are you using the last tab to make the AI? That is only for normal melee non-custom, it cannot be used for custom race testing.

Can you make a video of this?

For testing the AI, you cannot use the last tab for testing. And how are the starting units town hall and peasants? You need to replace your custom starting building on the map. Are you saying it deletes the custom building to replace with human?
 
Level 9
Joined
Apr 22, 2020
Messages
430
gbJZN13.jpg


WLSloFB.jpg


6tTPXAh.jpg


RZbO7ZQ.jpg


As you can see in the first picture the WE needs the start location of players but why do it starts with human race instead of mine? As you can see it there it is a human townhall
For the second picture is it the right trigger?
For third picture you can see the human townhall and the peasants starts building its buildings and also the "Gemcrafters" are also mining and lumbering but never builds anything.
For the fourth picture the player name is still player 3 instead of "The Aldors"
 
Level 23
Joined
Jul 26, 2008
Messages
1,317
It is good you posted that picture. The whole issue is caused by those "melee" triggers. Delete all 8 of them (the ones above "start campaign AI). Then it will work.

For the name of the team, go to the tab I posted with the picture here: Controlling my AI. Then go to the tab of the far left "players" and set the name of the team according to the colour there.

Make sure to add a trigger to give the AI 10000 lumber + gold at the start, so you can see immediately if the AI is working.
 
Level 9
Joined
Apr 22, 2020
Messages
430
It is good you posted that picture. The whole issue is caused by those "melee" triggers. Delete all 8 of them (the ones above "start campaign AI). Then it will work.

For the name of the team, go to the tab I posted with the picture here: Controlling my AI. Then go to the tab of the far left "players" and set the name of the team according to the colour there.

Make sure to add a trigger to give the AI 10000 lumber + gold at the start, so you can see immediately if the AI is working.
Okay it works now! MY GOODDDDD it was just the melee trigger that caused all of this!!!!! And by the way a few problems though no.1 why all of a sudden my Gemcrafter builds a Light base just right next to my Halls of Light Tier 3 (Town hall) the tier 1 no.2 how do i make some of my workers harvest lumber again? no.3 as you can see in my screenshots that i have preplaced some buildings and units so how do i rebuild them if gets destroyed or killed? No.4 how do i make some of my AI units defend there AI Ally like i don't want all of them to go and help the AI ally but only some of thier existing units like for example (I have trained 6 grunts and 4 raiders and i only want the 3 grunts and 2 raiders to go and help thier ally and the rest just stay in thier base)Im sorry if i have already asked these questions.
 
Level 23
Joined
Jul 26, 2008
Messages
1,317
If the main building you placed on the map is tier 3 main building, then in your build order the you must add tier 1 and tier 2 main building before the tier 3 building.

For lumber, add 5 more gemcrafters to the build order, then add 5 builders and set them to "lumber" on the right side of that same tab.

Preplaced units and buildings are automatically rebuilt by AI, as long as you include them in the build order.

If you want that, maybe just make that AI an attack AI, and have its base behind the AI base you want it to defend, so its attacks will automatically go and attack any incoming attack waves. That would be simpler.
 
Level 9
Joined
Apr 22, 2020
Messages
430
If the main building you placed on the map is tier 3 main building, then in your build order the you must add tier 1 and tier 2 main building before the tier 3 building.

For lumber, add 5 more gemcrafters to the build order, then add 5 builders and set them to "lumber" on the right side of that same tab.

Preplaced units and buildings are automatically rebuilt by AI, as long as you include them in the build order.

If you want that, maybe just make that AI an attack AI, and have its base behind the AI base you want it to defend, so its attacks will automatically go and attack any incoming attack waves. That would be simpler.
Okay thanks but the builders still builds the freaking light base - townhall i did what you just said to elaborate what i'm saying i have set the first build priority to:
Light Base - tier 1 (Town Hall)
Light Keep - tier 2
Halls of Light - tier 3
And when i tested it you already know i have preplaced my tier 3 hall but my builder builds a Light base (tier 1 hall) just next to my tier 3 hall and then thr light base that was build upgrades to a light kepp (tier 2 hall) and then my builder builds another light base AGAIN so overall in my AI there is a Light base,Light Keep and Halls of Light.
CHDEwl4.jpg

The left building that is under constuction as you can see there is the tier 1 the middle is the tier 2 and the right is the tier 3 that is preplaced
 
Level 23
Joined
Jul 26, 2008
Messages
1,317
I cannot really help without being able to interact myself with the AI, especially since I think the problem is related to object data. I strongly suggest you look at the AI i linked you (Shadows of Hatred campaign). In the 2nd last mission, (final RTS mission), that AI there for the draenei is a good model to base your AI on.

You can use "conditions" in the AI tab to stop the AI from building 1 of those extra main bases, but the other one created is another issue, which I cannot really help with since I cannot see the map myself. Maybe just focus on other aspects of the campaign for now?

My guess for the 1st extra light base is, your T3 halls of light has a requirement for it that you have not met (like in normal Wc3, T3 main building always requires an altar to be built already). So if your T3 building requires an altar, but the altar is not preplaced already, then this could be causing problems.


When I talk about "conditions", this is to fix a problem where, if your T3 is destroyed, then your builders make multiple main buildings, but this is not your problem, since your main building has not been attacked or destroyed. I guess the issue is related to object data, and personally think it is because your T3 needs an altar, and even though the T3 is preplaceed, there is no altar preplaced.
 
Level 9
Joined
Apr 22, 2020
Messages
430
I cannot really help without being able to interact myself with the AI, especially since I think the problem is related to object data. I strongly suggest you look at the AI i linked you (Shadows of Hatred campaign). In the 2nd last mission, (final RTS mission), that AI there for the draenei is a good model to base your AI on.

You can use "conditions" in the AI tab to stop the AI from building 1 of those extra main bases, but the other one created is another issue, which I cannot really help with since I cannot see the map myself. Maybe just focus on other aspects of the campaign for now?

My guess for the 1st extra light base is, your T3 halls of light has a requirement for it that you have not met (like in normal Wc3, T3 main building always requires an altar to be built already). So if your T3 building requires an altar, but the altar is not preplaced already, then this could be causing problems.


When I talk about "conditions", this is to fix a problem where, if your T3 is destroyed, then your builders make multiple main buildings, but this is not your problem, since your main building has not been attacked or destroyed. I guess the issue is related to object data, and personally think it is because your T3 needs an altar, and even though the T3 is preplaceed, there is no altar preplaced.
Well i have already put an altar but still building the tier 1 hall my guess is this is related to the start location as you can see in my previous screenshots i have put the start location just right next to my tier 3 hall that must be why the workers build the tier 1 hall just right next to my tier 3 hall but i think i should just solve this by myself so thank you so much for your help you really helped me alot to my AI and by the way i did try opening that campaign but i cannot open it since my warcraft 3 version is old i tried updating it but my wifi broke unexpectedly so it is unknown when i will have a chance to update my WC3.
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
Add this condition to the town hall in your AI.

((Total number of Custom_Hall units) Equal to 0 and (((Total number of Custom_Keep units) Equal to (Total number of Custom_Hall units)) and ((Total number of Custom_Castle units) Equal to (Total number of Custom_Keep units)))

With this condition the AI will no longer build an extra hall when upgrading.
 
Level 9
Joined
Apr 22, 2020
Messages
430
By the way is this right?
1dlBny3.jpg


jCfVJna.jpg

Because if it is they are still building the extra hall i just want my units to REBUILD the tier 3 hall that i have preplaced if it gets destroyed well not as in rebuild the instant tier 3 hall of course they must build the tier 1 where it automatically upgrades to tier 2 and then tier 3.
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
You only need to add the condition in the "Build Priorities" tab like this :
1-png.357069


By the way, if you want to take screenshots, just press "PrtScn" then open Paint, hit "Ctrl+V" then save the image to desktop.
 

Attachments

  • 1.png
    1.png
    64.1 KB · Views: 156
Level 9
Joined
Apr 22, 2020
Messages
430
You only need to add the condition in the "Build Priorities" tab like this :
1-png.357069


By the way, if you want to take screenshots, just press "PrtScn" then open Paint, hit "Ctrl+V" then save the image to desktop.
Thank you so much Warseeker! And can you also give me one last favor? Can you make the condition on building a scout tower and instanly upgrades to a Guard tower,Arcane tower and canon tower? Of your choice.
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
Thank you so much Warseeker! And can you also give me one last favor? Can you make the condition on building a scout tower and instanly upgrades to a Guard tower,Arcane tower and canon tower? Of your choice.
It's basically the same thing, you just have to replace the units :

((Total number of SCOUT_TOWER units) Equal to 0 and (((Total number of GUARD_TOWER units) Equal to (Total number of SCOUT_TOWER units)) and ((Total number of CANON_TOWER units) Equal to (Total number of SCOUT_TOWER units))) and ((Total number of ARCANE_TOWER units) Equal to (Total number of SCOUT_TOWER units)))
 
Last edited:
Level 9
Joined
Apr 22, 2020
Messages
430
It's basically the same thing, you just have to replace the units :

((Total number of SCOUT_TOWER units) Equal to 0 and (((Total number of GUARD_TOWER units) Equal to (Total number of SCOUT_TOWER units)) and ((Total number of CANON_TOWER units) Equal to (Total number of SCOUT_TOWER units))) and ((Total number of ARCANE_TOWER units) Equal to (Total number of SCOUT_TOWER units)))
So do i have to apply this condition on every tower i build in my building tab? Or just apply it to one tower meaning just the scout tower.
 
Level 9
Joined
Apr 22, 2020
Messages
430
Hello again Warseeker if you can still read this message i have a very small problem as you can see i have did the condition that you have told me which is: Scout tower equal to 0 and guard tower equal to scout tower and canon tower equal to scout tower and arcane tower equal to scout tower and i have applied this condition to the scout towers only but they won't rebuild the scout towers if they are destroyed as you can see in my screenshot here:
EEd7M11.png

They are completely organized inside the building tab but unexpectedly they won't rebuild the towers that were destroyed well not as in not building any scout towers when i destroy all of my 5 towers the worker rebuilds one scout tower and upgrades it to a Guard tower so this build is exactly the same in my building tab as you see there that first is the scout tower and then guard tower in my screenshot but they won't rebuild the rest of the towers just one tower which is just the guard tower
Note: I have preplaced 2 guard towers 2 arcane towers and 1 canon tower
Which is why i have set 2Gtower 2Atower and 1Ctower in my building tab i just want them to rebuild it if destroyed but they only rebuild one tower which is just the guard tower but not the rest of them how do i fix this?
 
Status
Not open for further replies.
Top