I've been breaking my noggin over this. How can the engine be told that there are no enemies left in an area? Let's assume enemies are EVILCUTOFF, not those who are blue and then go hostile after an introduction. Exists() and InMyArea() don't work with a type, and InActiveArea() breaks the game.
Edit: oooops, my bad. Should have read the whole trigger list first. AreaCheckAllegiance(I:Allegience*EA). Except it doesn't take 200 for EVILCUTOFF, you've got to give it 255 for ENEMY.
But though I found the code, I'm missing the rest of the pieces for my idea. The idea is to implement surprise attacks by monsters in areas that have been cleared and players don't expect any surprises. Sure, in places monsters still spring up even later, but spawn points often deactivate after one use, and many monsters on a map weren't spawned in the first place but put there by hand. Once those are dead, an area pretty much goes quiet. The characters relax in their pants and let their gut hang out. Whether it's a level of a dungeon to cross on the way back to the exit or a stretch of the forest, that's just safe, boring legwork for the party. And in part that's fine, even satisfying, but something should happen every so often.
So what I want to do, if I can't get spawn points to work with actions (what I wrote about in the neighbor thread), is to mark the fact that the area has been cleared - for each area. I can take stock of there not being any enemies in a place with !AreaCheckAllegiance(255). If this is true, then every red is dead like in the 50s and I can set a global. And afterwards, when the party is returning through this depopulated place, if some of the spawn points have activated or monsters have appeared otherwise, and the global is set (so it's a reemergence), I can use ApplySpellRES(...) with Target "Everyone" and another filter to focus on ENEMY. The effect of the spell would be Teleport Field, so all of the foes in the area would get thrown at the party. Like after this unfortunate event.
That's what happens when a town crier jokes about running water for everyone. But with enemies it's purty much the same thing, they come from every quarter.
There are two places where I could use your advice:
1) What/how to put the global on for each area. Maybe on the first clearing I could spawn an invisible with script name "area-clear" and later check for Exists("area-clear"), as a sort of living marker? I'm open to suggestions if there are easier ways.
2) How to bring more monsters into play? If spawn points won't respond, well... I could just write up random ogres popping up - ogres are generic enough, I've tested on them so much, my soup tastes of ogres. Or assassins. Plenty of those everywhere anyhow. But that's too generic. It would look wrong half the time... ogres in an outer plane fortress?
Edited by temnix, 23 August 2017 - 11:21 AM.