- Joined
- May 27, 2023
- Messages
- 10
Hello! I am a new to world edit and I am currently creating a campaign map in World Editor and I've come to a problem with finding a particular unit. The map is your typical wave survival map, but I've added complexity to it by making the enemy waves also attack small isolated allied villages on the map. If the player chooses not to protect these villages, an enemy building will be built which will create more enemy waves.
The problem now lies in how do I reference this particular building once its built. I don't have a fixed trigger made yet but the general idea is like this...
Trigger 1 "Village 1 fallen"
--Event--
Unit - Town Hall Dies
--Action--
Unit - Move "Peon" to "Village 1 Area"
Unit - Order "Peon" to build Stronghold at (Center of "Village 1 Area)
Triggers 2 "Establish Base"
--Event--
Unit - A unit finishes construction
--Condition--
Owner & Unit-type = Player 11 & Stronghold
--Action--
Set "Triggering Unit" AS "Village 1 reference")
Trigger - Turn On ("Attack Waves")
Trigger 3 "Retake Village"
--Event--
Unit - "Village 1 reference" Dies
--Action--
Trigger - Turn off ("Attack Waves")
I'm confused as to how I can reference this particular building once its built. The issue arises when there will be multiple of these same strongholds built at different times, so how can I differentiate village 1 stronghold with village 2 stronghold when the player comes to destroy and recapture it? I know the solution would be to use variables, but when I try setting it, and referencing it in the event or conditions, I can't find my unit variable. Can anyone point me in the right direction?
Thank you!
The problem now lies in how do I reference this particular building once its built. I don't have a fixed trigger made yet but the general idea is like this...
Trigger 1 "Village 1 fallen"
--Event--
Unit - Town Hall Dies
--Action--
Unit - Move "Peon" to "Village 1 Area"
Unit - Order "Peon" to build Stronghold at (Center of "Village 1 Area)
Triggers 2 "Establish Base"
--Event--
Unit - A unit finishes construction
--Condition--
Owner & Unit-type = Player 11 & Stronghold
--Action--
Set "Triggering Unit" AS "Village 1 reference")
Trigger - Turn On ("Attack Waves")
Trigger 3 "Retake Village"
--Event--
Unit - "Village 1 reference" Dies
--Action--
Trigger - Turn off ("Attack Waves")
I'm confused as to how I can reference this particular building once its built. The issue arises when there will be multiple of these same strongholds built at different times, so how can I differentiate village 1 stronghold with village 2 stronghold when the player comes to destroy and recapture it? I know the solution would be to use variables, but when I try setting it, and referencing it in the event or conditions, I can't find my unit variable. Can anyone point me in the right direction?
Thank you!