• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

AI text

Status
Not open for further replies.
Level 30
Joined
Feb 18, 2014
Messages
3,623
JASS Syntax Checker 0.1.7 shows the following errors:
Code:
"elf61333.ai", line 4: Identifier 'DEMON_HUNTER' was already declared in the current scope
"elf61333.ai", line 5: Identifier 'MOON_CHICK' was already declared in the current scope
"elf61333.ai", line 6: Identifier 'KEEPER' was already declared in the current scope
"elf61333.ai", line 7: Identifier 'WARDEN' was already declared in the current scope
The names of your variables already exists in the game's common.ai file so you must rename them like DEMON_HUNTER_2 or something.
 
JASS Syntax Checker 0.1.7 shows the following errors:
Code:
"elf61333.ai", line 4: Identifier 'DEMON_HUNTER' was already declared in the current scope
"elf61333.ai", line 5: Identifier 'MOON_CHICK' was already declared in the current scope
"elf61333.ai", line 6: Identifier 'KEEPER' was already declared in the current scope
"elf61333.ai", line 7: Identifier 'WARDEN' was already declared in the current scope
The names of your variables already exists in the game's common.ai file so you must rename them like DEMON_HUNTER_2 or something.
With your suggestion, I change to this, but still some problems. The AI matches the first wave of attack, some of the latter troops will not train again, and the hero will not be revived after his death.
 

Attachments

  • elf6133W3.ai
    4.4 KB · Views: 4
You'll need to trigger it if you want them to revive the Hero, if you want it to replace pre-placed units use the line

call SetBuildUnitEx(i,j,k, UnitID)

It won't build past the number if there are already pre-placed units but will replace them if they're killed.

Alternatively you can use the

call CampaignDefendersEx(i,j,k, UnitID)

command.
 
You'll need to trigger it if you want them to revive the Hero, if you want it to replace pre-placed units use the line

call SetBuildUnitEx(i,j,k, UnitID)

It won't build past the number if there are already pre-placed units but will replace them if they're killed.

Alternatively you can use the

call CampaignDefendersEx(i,j,k, UnitID)

command.
I just want to know what is wrong with this AI text, and it can be corrected.
 
You'll need to trigger it if you want them to revive the Hero, if you want it to replace pre-placed units use the line

call SetBuildUnitEx(i,j,k, UnitID)

It won't build past the number if there are already pre-placed units but will replace them if they're killed.

Alternatively you can use the

call CampaignDefendersEx(i,j,k, UnitID)

command.
I also wrote in the AI text in the format you said. AI only operates on the units and heroes I put on the map, and those units that are not placed on the map are not created.
 

Attachments

  • 655.png
    655.png
    51.5 KB · Views: 5
  • 656.png
    656.png
    73.8 KB · Views: 4
  • 657.png
    657.png
    71.7 KB · Views: 4
  • 658.png
    658.png
    79.3 KB · Views: 5
  • 659.png
    659.png
    77.2 KB · Views: 5
Level 30
Joined
Feb 18, 2014
Messages
3,623
With your suggestion, I change to this, but still some problems. The AI matches the first wave of attack, some of the latter troops will not train again, and the hero will not be revived after his death.
Like Footman16 said, the AI does not revive heroes unless they are needed for the next attack wave. If you want the AI to constantly revive heroes after death, add them to the CampaignDefenders list.
Other than that, I don't see anything wrong with your AI script maybe something from the outside is preventing it from training troops like not enough food or resources.
 
正如 Footman16 所说,除非下一波攻击需要英雄,否则 AI 不会复活英雄。如果您希望 AI 在死后不断复活英雄,请将他们添加到 CampaignDefenders 列表中。
除此之外,我没有发现您的 AI 脚本有任何问题,也许是外部原因阻止它训练部队,例如食物或资源不足。
哦!你指出了我的问题。资源确实有问题。我把那个资源给了错误的玩家。非常感谢您的指导!同时感谢步兵先生16,让那些自定义的英雄死后可以立刻复活!
 
Last edited:
Like Footman16 said, the AI does not revive heroes unless they are needed for the next attack wave. If you want the AI to constantly revive heroes after death, add them to the CampaignDefenders list.
Other than that, I don't see anything wrong with your AI script maybe something from the outside is preventing it from training troops like not enough food or resources.
Can the total population of the AI attack group unit exceed the total population of the base defense group unit???
 
Status
Not open for further replies.
Top