• 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] Eternal Waves

Status
Not open for further replies.

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Hi.
I'm creating an AI file and I extracted an AI file from the campaign, but it didn't want to open.
Anyway, I'm posting in order to ask how to make a wave repeat indefinitely.
Your help is appreciated, I promise I'll award some reputation to whoever succeeds in helping me.

Thanks for your time!
 
Level 5
Joined
Oct 27, 2007
Messages
158
What do you mean by it didn't want to open? Campaign AI files are .ai files and can be opened by any text editor like notepad etc. I would advice using JassCraft since it allows for syntax checking and easier coding.


To make an attack repeat forever until the AI can't build anymore (when it loses buildings, workers) you can do something like this.
The following example will make the AI repeately attack Player 2 blue with Grunts and Berserkers.

Once you understand the basics you can create more advanced loops, like loops that can be interrupted by sending AI commands using triggers.

JASS:
globals
    player target = Player(1)
endglobals

loop
     call InitAssaultGroup()
     call CampaignAttackerEx(2, 4, 6, GRUNT)
     call CampaignAttackerEx(1, 2, 3, BERSERKER)
     call SuicideOnPlayerEx(4, 3, 2, target)
endloop
 
Status
Not open for further replies.
Top