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

Creating an Ai for a Custom race

Status
Not open for further replies.
Level 9
Joined
Jun 10, 2013
Messages
473
Hey all >:D As the title suggest I would like to know how to create a fully working custom ai for my Nerubian race (I know this endeavor would be done over night), However I have absolutely no idea on where to start I've checked out the Ai editor but my race's training system is unique so i'm not sure the ai editor could do it ( you must build a Hatchery - use the Lay eggs ability - individually upgrade each egg to the desired unit type [like upgrading towers] - also the unit types have certain prerequisites such as certain buildings, tiers and etc) Thus I don't even know where to begin and so any help or articles would be very much appreciated.


P.S if you'd need a sample of my map to test out the working of the race, i'll pm one to you.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
I think the ai editor cannot use abilities on its own, but if you would combine ai editor to build buildings and triggers to use the lay eggs ability it might work. I would like to have the test map. Then I can tell you if I can help.
 
Level 12
Joined
Jun 15, 2016
Messages
472
I don't think the first part will be that hard. Just specify in the ai editor the amount "eggs" you want to have in your base at all times and the ai will build up to that quantity. For example, if you order the ai to build 5 wisps, then one builds an ancient of lore (and is destroyed in the process) another wisp will be built to complete the number to 5. That is, assuming that the hatchery's lay eggs ability is like "train wisp".

The other part is a bit trickier. If the egg is like a Zerg larva, and you use a conversion ability like destroyer form, the ai should be able to use it even if it is inside a spellbook. There is a native function called ConvertUnits which is a part of the basic build unit function the ai uses, and it works with obsidian statues => destroyers, so it should work with your units.

In other words, just check it. I don't think it'll be a problem.
 
Level 9
Joined
Jun 10, 2013
Messages
473
Well the system actually works as such;

worker builds hatchery

hatchery use lay eggs spell which costs mana and places a set amout of eggs

eggs have an array of possible units they can upgrade to provided they have the required resources and prerequisites needed ( works like upgrading a scout tower to a guard tower)
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
So far I got the ai to harvest lumber, build buildings, train workers, but for some reason the workers don't want to harvest gold :(.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
I made a new map with 3 custom units a necropolis, a acolyte and a goldmine. I did not get the workers to mine gold, they can't even build a custom goldmine. So I am not sure if it's possible to make custom races with the undead goldmine.
 
Level 9
Joined
Jun 10, 2013
Messages
473
I made a new map with 3 custom units a necropolis, a acolyte and a goldmine. I did not get the workers to mine gold, they can't even build a custom goldmine. So I am not sure if it's possible to make custom races with the undead goldmine.
Well it is possible to make a custom race with the undead gold collection system....I did....However maybe it's not possible to trigger the ai to mine?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
I managed to solve the problem with the haunted gold mine. The haunted gold mine is hardcoded and built differently than normal buildings. I made a trigger to fix this.

The problem with the workers not mining persists. It seems, that it is not possible to have a worker for gold and lumber, when using the undead gold mine system. If I remove the lumber harvest ability of the workers they mine gold.
My idea is to make 3 unit types of nerubian workers. The normal ones for human players and one gold worker + one lumber worker for computer controlled players. I will try to make triggers, so the computer replaces gold workers with lumber workers and vice versa, if he needs more of one type at the moment.

I know that this solution is not perfect, but it's the only possibility to use the undead gold system.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
It seems, that it is not possible to have a worker for gold and lumber, when using the undead gold mine system. If I remove the lumber harvest ability of the workers they mine gold.
Because Melee Undead actually have separate units for this (duh). Did you try basing it off of an Entangled Gold Mine to see if you could get that to work? Seems like basically the same functionality except wisps can naturally harvest lumber so you're good there.
 
Status
Not open for further replies.
Top