So for a level, I have multiple green units helping in the battle, but I want them to stay within a certain zone that they won’t walk out of even when fighting enemies. (EG: Moving to defend a Throne without setting foot outside the Throne Room.) Anyone know if it’s possible and if there’s a patch I can use to get the desired effect?
I guess a better way to word what I’m trying to do is to have units move to attack an enemy who enters the Throne Room, but won’t attack anyone outside the throne room even if they’re within range.
OG Reply
An incredibly scuffed way of doing this is to designate a terrain type that you don’t plan on using (like “Bone” or some part of a ship tile if you have no boat maps) and renaming it “floor”. You’d also need to create unique classes for the green units that have their own movement type that is identical to their typical class movement type, but can’t cross over the new floor tile you just made. Then just use that new floor tile to create the outline of the throne room and the green units will stay within its limits.
Again, this is a very silly way to do this but it isn’t too resource intensive (The use of a terrain type is the only real concern, not sure if you can expand that or not in FEBuilder or whatever tool you’re using). Hopefully somebody else can provide a better solution, but if not I’ll come back in a day or so to post some pictures outlining the steps more clearly when I have access to my PC.
Edit: I’ve saved my original reply above for reference. If anybody is looking for a solution with pictures here it is. There are two main solutions with Stephano’s being shorter and less resource intensive, but my original idea has the added benefit of visibly showing the player where exactly the green units cannot cross. Use whichever works for your project. The method should work regardless of what software you use to edit your game, but this guide is made with FEBuilder users in mind.
Step 1 (Both Methods)
Open up the Map Editor and click Edit Palette for the tileset you want to use in the map. Then find whatever tiles you plan to use as barriers for your green units and copy/paste them to an unused tile in the tileset. If you’re using the short method, just change the tile type to something that no units can cross like Wall terrain and continue to Step 2. If you’re using the long method then keep reading.
Long Method Only: Instead of changing the tile type to Wall, you’ll need to use a tile that you don’t plan on using anywhere else. For example, “Glacier” is a good tile type that can slot in nicely since all classes can cross it by default. “Sky” also works as an unused tile type, just know that you’ll have to edit all existing class movement types to be able to cross that tile freely. Regardless of what tile you use, search for it by name in the text editor and change it to whatever you want it to be (The names range from 01C5 to 0204 for reference)
Step 2 (Short Method)
While in the map editor, create a new tile change that encapsulates the enter area that you want to keep your green units within. Change the perimeter to the new tile you just made to prevent them from crossing, then open up the event editor and create 2 new events. One will run from turns 1-255 on NPC Phase, the other will run on turns 2-255 on Player Phase. The former will execute the tile change you just made while the latter reverts it. And that’s it! Test your map to make sure it works before moving onto the final step.
Step 2 (Long Method)
To make the tile crossable by some units but not others you’ll need to add new classes for each type of green unit you plan to place. If you’re using the EXModular Save patch you can just expand the class list, otherwise you’ll need to overwrite one of the classes you don’t plan on using. Either way, just copy-paste the existing classes you plan on using (In this case Mercenary/Sniper) and be sure to copy-paste their moving map animations too!
Once that’s done, click on Movement Cost in the Class Editor and separate the independence of classes. After it’s separated, you can copy the actual number referencing movement cost and paste it for the new classes you made to save time.
Now just find the tile you added back in Step 1 and change the cost to 255 to make it impassable. In this case it’s the second “Stairs” tile I made that replaces the normally unused Glacier tile. Now you’re done with the hard part! Just be sure to test that units can’t cross the tile before moving on to the final step.
Step 3 (Both Methods)
Your map should be fully functional now, but it won’t look right in battles since green units may fight enemies standing on the impassable terrain. We still need to change the battle platform and background. Open up the Chapter Editor and look at what type of backgrounds you have set. Make sure it’s appropriate for your chapter, then click into Battle Backgrounds to start editing.
Here you should scroll down to find the original terrain your new terrain is based on. In my case I’m editing the “Stairs” terrain and will copy the value highlighted to the new “Stairs” terrain I created during the Long Method. If using the Short Method, just copy it over to the “Wall” terrain or whatever impassable terrain you decided to use.
Also be sure to click “jump to cartoon battle floor” to find the floor used during battles and change it in the same way. Now you should be done!
Potential Issues
Regardless of what method you use, green units could still get past the perimeter in many ways. For example, you may have enemies with the Lunge skill that swap positions with a foe. If this happens on the perimeter, the green unit will start their turn on top of the perimeter and be able to exit. More likely though is the use of the rescue command from player units or even the use of a rescue staff.
If you’re using the short method, just remember that the player won’t see any visual indicator that the green units cannot cross over the terrain you made. In the screenshot below, I used the long method on the stairs above but used the short method on the stairs below. Innes can’t cross either in this example with the way I set up events, but this is more directly conveyed by using the long method. Again, use whichever you prefer based on how many resources you’re willing to use up for a little clarity.
Unfortunately, there’s already quite a few classes in my hack. So that alone kinda kills this option for me. My current work around has the ai move back to a certain spot if they’re out of the range, but that’s as far as I’ve gotten. Hopefully someone else can suggest a better way, but in any case, post your solution anyway, just in case someone else finds it helpful.
There’s no clean way to do this for a targetting AI without writing code for a new one yourself. But there are alternatives, and the best one that I can think of is this:
Edit the tileset so it has 2 transparent tiles, one with terrain 0x0, and another with unwalkable (wall). Create a tile change that surrounds the throne room, the interior uses tile with terrain 0x0 and the border uses the unwalkable terrain. On NPC phase, activate that tile change and deactivate it on player phase (or neutral phase, if using the 4th allegiance patch).
Can you provide pictures? Just so I can double check I’m going it right?
I have a scenario like this in my hack. I found a fairly easily solution involving the aforementioned terrain types above. During NPC phase, I just do a tile swap for ones that are non traversable, and then swap them back on enemy/player phase. You will need to edit your tileset, but the result is a guarantee of what you are wanting.
Question: Will it break anything if an enemy is already standing on the terrain?
This fixed it. Thank you.







