• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[AI] Help: Rebuilding

Status
Not open for further replies.
Level 3
Joined
Jun 16, 2004
Messages
54
How do you make your AI replace preplaced buildings that are destroyed?

And further, if they lost an upgraded building like a fortress, how would you make the AI replace the building and upgrade it to the appropriate level?

Thanks.
 
All buildings the AI has at the beginning must be listed on build tab.

Immagine that the AI has no buildings at the beginning. But if a specific building already exists, it will be treated as already built and AI can proceed with next object. If the building is destroyed, it will look back on the list to find it and continue from there (by building it so the condition for next things will be true). Keep in mind, though, that AI will not always build the building at the same location

P.S. What map are you making. It is hard to see a map with AI these days.
 
  • Like
Reactions: Rui

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
You need to make a trigger that once the building dies, it issues some orders that are to be fufilled. Theses orders are to build the building at X/Y and then upgrade it. The first order is to rebuild the building at the dieing location. After that order is complete, it then goes on to upgrade it. Try playing around with JASS enhanced AI scripts and JASS enhanced triggers to do this effect.
 
Level 3
Joined
Jun 16, 2004
Messages
54
Thanks, that worked!

It's actually for a campaign. I've used triggers to make AI for most of the maps, but one were too complicated to do with regular triggers so I had to learn to make AI script (thank god for the tutorial forum).

Just have one other question, about "SetReplacements". Is there a way to make the AI replace lost units/buildings forever instead of a set amount?
 
Level 3
Joined
Jun 16, 2004
Messages
54
I've got a couple of more questions I need answered. Like, is there a way to turn off the AI after it's activated?

Because after you defeat the AI's base, there are some other things happening and the AI then is just in the way, moving units without permission and the like.
 
Level 3
Joined
Jun 16, 2004
Messages
54
No that doesn't work, it will just run another AI script (or in this case, it will run nothing) on top of the other script.

There is a trigger called PauseCompAI. I figured I could use that after a WaitForSignal and then just pause the AI by sending an AI command. But I can't get it to work, the AI just pauses directly instead of waiting for the command.
 
Status
Not open for further replies.
Top