- Joined
- Nov 9, 2020
- Messages
- 453
"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
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.JASS Syntax Checker 0.1.7 shows the following errors:
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.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
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.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.
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.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.
哦!你指出了我的问题。资源确实有问题。我把那个资源给了错误的玩家。非常感谢您的指导!同时感谢步兵先生16,让那些自定义的英雄死后可以立刻复活!正如 Footman16 所说,除非下一波攻击需要英雄,否则 AI 不会复活英雄。如果您希望 AI 在死后不断复活英雄,请将他们添加到 CampaignDefenders 列表中。
除此之外,我没有发现您的 AI 脚本有任何问题,也许是外部原因阻止它训练部队,例如食物或资源不足。
Can the total population of the AI attack group unit exceed the total population of the base defense group unit???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.