HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ai question

11-10-2002, 08:08 PM#1
Guest
How do you make ai buy and use custom units , for example if i enabled marine for hunmans to buy how do i make ai use it?
11-10-2002, 09:21 PM#2
Guest
Well, you'd first need to find out the 4-letter code for the custom unit (such as 'Oc01'). You could do this by creating a trigger to create one of the custom units, and then converting it to custom text.

Once you have that code, you just use that code in the build orders of the AI script... for example:

SetBuildUnit(2,'Oc01')

It's as simple as that, as long as you set up the proper buildings to produce the unit, it should build it.

The key is getting the unit code. Once you have that you can pretty much use it anywhere you would use a normal unit code in your AI script.
11-11-2002, 05:16 AM#3
Guest
sorry for asking maybe a dumb question but where do i write that command??????
11-13-2002, 06:42 PM#4
AIAndy
It cannot be done in WE. You have to modify the AI Scripts. You can find the blizzard scripts in war3.mpq (*.ai). They are text files, so they can be edited in any text editor. There you can add that command, e.g. to modify the melee human ai take human.ai and add the line as stated by JonahDean. Then add the modified script to your map and it should use it (The AI has to be started by trigger). For further information on AI editing read JonahDean's AI reference, posted in this forum.
11-13-2002, 07:48 PM#5
Guest
thx alot , i might ask more questions further on , all i needed is the name of .ai file. :)
11-13-2002, 08:09 PM#6
DKSlayer
Check out the FAQ it says the main files for the AI. Although you wil be wanting to edit, either the human, elf, orc, or undead.ai File.
11-23-2002, 02:17 PM#7
Guest
Slayer i made pretty nice script for ia in my new map , but i got ew questions , how do i make a second builder, for example beside peasant i want there to be another builder taht will build different buildings , how do i do taht , i tried just creating it , it creates the unit but unit aint building nothing
11-23-2002, 04:47 PM#8
Guest
Hmmm.. I've never experimented with using custom builders with AI scripts... One question... did you give your custom builder the 'worker' classification? If so, and it still doesn't work, then it's possible that the AI just isn't equipped to deal with custom units as builders. I'm sure there's some way around that though.
11-23-2002, 11:47 PM#9
Guest
yes my custom unit is exact copy of peasant exept the model and icons and some other stuff taht don't matter to AI
i gues ur right about ai being unable to use custom builders :( thats pretty sad, but u think if i edit peop that he will be buildable by humans will ai build with peon as the other worker or will it still use only peasant ????