War for the Overworld

War for the Overworld

Discover and conquer new realms!
Looking for new realms to subjugate? Peruse the cavernous depths of the Workshop to find the next map upon which to sate your bloodlust or create your own and share via the in-game editor!
Learn More
krupek 3 29 Jun, 2018 @ 3:55am
script problem
hi i have question how to script an unit to go to me trough portal when i claim on build some room ( mean diffrent unit than normal) ill need it for my mod
< >
Showing 1-1 of 1 comments
By portal, do you mean moongate? If so, create a nonlooping patrol that has 1 point on the entrance moongate, 1 point on the exit moongate.

Create a script with the trigger = "Faction Change". Entities = select a single tile in the room (don't select all the tiles in the room or the script will trigger multiple times when the room is claimed). Set the faction to the player faction (ie. underlord1).

Create an action that "assigns patrol" to the units you want to use the moongate. You can also spawn units at the entrance moongate and tell them to use the patrol (rather than having idle units on the map that's only purpose is to use the moongate).

Another option is to not have a patrol and have a moongate/other asset that you spawn units on (to make it look like they used the moongate) or you can also use "teleport entity" to move a unit to the exit moongate. However you cannot teleport a unit to the entrance moongate since they won't use it.

I have a similar map that spawns units when the player enters a keep. I use the "forcefield door" (only lets friend units through) as a "portal art" and spawn units directly onto the tile to simulate them "coming through the portal door".
Last edited by ♥♥♥♥ Goblin; 10 Jul, 2018 @ 11:46am
< >
Showing 1-1 of 1 comments
Per page: 1530 50