HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help with custom units

02-23-2005, 12:09 AM#1
Guest
Hey all, I have completly redone the human side and tried to make AMAI work well with it. I changed StandardUnits.txt proprerly, made profilies and strategys take the changed into account and I compile without problem and Succesfully installs it on the right map, yet there is no indication that the computer uses AMAI at all!
02-23-2005, 07:40 AM#2
Strategy Master
Firstly has your custom map got a trigger to run melee ai on map initialization.

MELEE - Run melee ai

// this action will run for all computer players

If you want to run just for a specific computer player try
Ai - run melee ai script

possible default scripts
scripts/human.ai
scripts/elf.ai
scripts/undead.ai
scripts/orc.ai


Those are only the standard scripts. If your custom amai for that human race is not called human but called for example HumanCust then you would run ai for player using scripts/HumanCust.ai

If AMAI is running it should show [AMAI] *profile name* on the computer player.

If it seems that triggers are done, then its likly there is another problem which could be a bug not detected by compile.



EDIT - Remember after modifying your map and saving, you will have to install amai back onto it.
02-23-2005, 10:34 AM#3
Guest
Thank you, I had deleted the initate A.I. command from my map.
02-23-2005, 02:32 PM#4
Guest
Ok I have run into another problem, the AI build units and sush but it dosent build any heroes. I have moved all original heroes to the NEUTRAL team in StandardUnits file and added the two heroes I have made. The is told to build them but dosent build any of them :( The team has an altar but it is the same is its primary troop production structure, maybe that has something to do with it?
02-23-2005, 04:45 PM#5
Strategy Master
so u have a build order that it to build that exact hero.

Although it should work if ordered to be built directly in the strategies as long as "built in/needed 1" is set to the name of the altar that trains it. It should work fine with a primary troop production building as i have done this myself.

you should change the heroes.txt file to include your new heroes and change prority of original heroes to 0.

You can then just use the " call SetBuildUnit(1, hero_id[1], 55) " type command to for it to build its first hero and " call SetBuildUnit(1, hero_id[2], 55) " to build the second



Another problem could be due to maybe your proity for building the hero is really low.

e.g.
call SetBuildUnit(12,Footman,60)
call SetBuildUnit(1, CUSTOM_HERO, 70)

In above example the footmen will actually build a few first as it has prority 60 + (12-1) * 2


Also make sure hero build code is in all tier stages otherwise if they tier up they will never get it again.

Well they all possible issues i can think off the top of my head hope it helps.
02-24-2005, 12:41 PM#6
Guest
I am afraid I cant get it to work.

Here is the code used for the strategy (all tiers):

call SetBuildUnit(5, H_SWORDSMAN, 50)
call SetBuildUnit(5, H_ARCHER, 60)
call SetBuildUnit(5, H_PIKEMAN, 30)
call SetBuildUnit(1, hero_id[1], 80)

Here is altars and heroes entries in StandardUnits.txt (might have to copy and paste this into a text file or something):

ARMY_GENERAL H003 HUMAN hero HERO TRAINING_GROUNDS TRAINING_GROUNDS TRAINING_GROUNDS 0 0 false 0 0 0 0 0 0 0 0 4 0 0 0 0 4 0
ARMY_STANDARD_BEARER H006 HUMAN hero HERO TRAINING_GROUNDS TRAINING_GROUNDS TRAINING_GROUNDS 0 0 false 0 0 0 0 0 0 0 0 3 0 0 0 0 3 0
TRAINING_GROUNDS h004 HUMAN altar BUILDING LABORER 0 0 0 0 false 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Here is the humans Heroes.txt:

Hero base rp ally bonus random enemy bonus ELF enemy bonus HUMAN enemy bonus ORC enemy bonus UNDEAD enemy bonus ELF ally bonus HUMAN ally bonus ORC ally bonus UNDEAD ally bonus second/third hero bonus
ARMY_GENERAL 0 0 0 0 0 0 0 0 0 0 0 0
ARMY_STANDARD_BEARER 0 0 0 0 0 0 0 0 0 0 0 0
02-24-2005, 02:06 PM#7
Strategy Master
okay

ARMY_GENERAL H003 HUMAN hero HERO TRAINING_GROUNDS TRAINING_GROUNDS TRAINING_GROUNDS 0 0 false 0 0 0 0 0 0 0 0 4 0 0 0 0 4 0

You shouldn't need the those buildings in bold as it already in buildby/needed 1 column , but i wouldn't beleive that what cause a problem.

ARMY_STANDARD_BEARER H006 HUMAN hero HERO TRAINING _GROUNDS TRAINING_GROUNDS TRAINING_GROUNDS 0 0 fal se 0 0 0 0 0 0 0 0 3 0 0 0 0 3 0

I hope your false there dosn't have that space in the standard units.txt

But now onto your problem
ARMY_GENERAL 0 0 0 0 0 0 0 0 0 0 0 0
ARMY_STANDARD_BEARER 0 0 0 0 0 0 0 0 0 0 0 0

The number i highlighted bold in those need to be some numbers. So if you want army_general to train more likely first make it 20 and then bearer make it 10. Its possible heros not chosen if the base prority is 0.

IF thats not the problem i have a question. Does your laborer build the altar in the game?
02-24-2005, 02:53 PM#8
Guest
Quote:
Originally Posted by Strategy Master
okay

ARMY_GENERAL H003 HUMAN hero HERO TRAINING_GROUNDS TRAINING_GROUNDS TRAINING_GROUNDS 0 0 false 0 0 0 0 0 0 0 0 4 0 0 0 0 4 0

You shouldn't need the those buildings in bold as it already in buildby/needed 1 column , but i wouldn't beleive that what cause a problem.

ARMY_STANDARD_BEARER H006 HUMAN hero HERO TRAINING _GROUNDS TRAINING_GROUNDS TRAINING_GROUNDS 0 0 fal se 0 0 0 0 0 0 0 0 3 0 0 0 0 3 0

Did it in hope it would make it work, it did not thogh :(

Quote:
I hope your false there dosn't have that space in the standard units.txt
Seems to be an artifact of the copying.

Quote:
But now onto your problem
ARMY_GENERAL 0 0 0 0 0 0 0 0 0 0 0 0
ARMY_STANDARD_BEARER 0 0 0 0 0 0 0 0 0 0 0 0

The number i highlighted bold in those need to be some numbers. So if you want army_general to train more likely first make it 20 and then bearer make it 10. Its possible heros not chosen if the base prority is 0.

IF thats not the problem i have a question. Does your laborer build the altar in the game?

Changed the base priority and still didnt help I am afraid :( (And yes I recompilied and installed AMAI into the map again).

The Laborer builds the altar only if the AI wants to get the standard troops out of it, if I remove the part about it building non heroes it does not build the altar.
02-24-2005, 03:33 PM#9
Strategy Master
hmmmm. a mystery.

Well are those gaps between each individual bit a tab and not a space because ARMY_GENERAL 0 0 0 0 0 0 0 0 0 0 0 0 looks like you may have put spaces between everytihng instead of tab. But again it might another copying problem.

If thats not it only thing i can think of is for you to send me your ai for to have a look for problem myself.

Send to my hotmail(follow link threw my name) or upload somewhere here.... thats if you want me to look at it.
02-24-2005, 04:05 PM#10
Guest
Ok, it is indeed just another copying error. Do you want to see the map I use for testing as well (Quite big, several MB)? Also what files are the script sources saved in?

Thanks for your will to help.
02-24-2005, 04:48 PM#11
Strategy Master
No just that entire folder that contains standardunits.txt in it.

Its all i need. If can't fix it. It is a problem with your map possibly.