Hello, I'm seeking help with improving my JASS AI, specifically in relation to rebuilding the town hall/commander center (castle). I've been facing an issue where the AI doesn't rebuild their main building when it's destroyed. I attempted several fixes, but noticed that the AI will only rebuild the castle if a town hall is already present in the JASS code.
Initially, I tried using the unit code for the town hall, and the AI immediately started building that custom town hall, even though their main castle was still active. However, when I removed this town hall code, the AI wouldn't build a new one after the castle was destroyed.
What I need is a JASS code that checks if a specific custom building (the castle) is either equal to 0 or less than 1, and if so, orders a custom worker unit to immediately build the custom town hall.
Can anyone help with a conditional structure in JASS to check for this and trigger the rebuilding process?
Initially, I tried using the unit code for the town hall, and the AI immediately started building that custom town hall, even though their main castle was still active. However, when I removed this town hall code, the AI wouldn't build a new one after the castle was destroyed.
What I need is a JASS code that checks if a specific custom building (the castle) is either equal to 0 or less than 1, and if so, orders a custom worker unit to immediately build the custom town hall.
Can anyone help with a conditional structure in JASS to check for this and trigger the rebuilding process?