forums | blogs | polls | tutorials | downloads | rules | help

Triggers in overlapping regions

I'm playing around with funky geometry where I have 2 regions that are overlapping each other. Basically two plains joined by a magic tunnel. Of course one of the plain regions always has to be faded out, else the player would see the overlapping nodes of both regions and that looks funny but isn't playable. So I set up triggers to handle the fading, using e.g. party_member_within_bounding_box.

However, there is a problem: When the player is in region A and walks through one of the triggers in region B, it gets activated & executed and region B is now displayed as well. This is because region B is faded but the overlapping nodes still exist somewhere in the game engine, and therefore also that trigger of region B, and its bounding box is triggered.

I tried using party_member_within_node as well, hoping it would only trigger when the player is *actually* standing on a node of region B, not just on a node of region A that overlaps with a node in region B. But instead of simply checking which node the character is attached to, it figures out the "within node" condition by the character's spatial position. Of course, for sensible people building sensible maps, this doesn't make a difference.

A half-assed solution might be to introduce a small stair in the tunnel such that the nodes of the two regions are on different heights. But the regions aren't completely planar and so that would not make the problem go away properly.

Is there a way to fade out / de-activate a region completely so its triggers aren't floating around invisibly?

Or do you have any other ideas to fix this issue?

Thank you so much in advance! Smile

That's really messed up. Locations in-game are supposed to be 4-dimensional coordinates, where the 0th / 4th dimension is the node id. I can see intuitively that bounding box triggers overlap into all coincidental nodes, but if two nodes on top of each other have no "doorway" to each other, the locations SHOULD remain displaced by that extra dimension and nothing should go wrong with party_member_within_node.

The only idea I can come up with is to extend the magic corridor's length to something over 128m. That will eject region B's content from memory on the approach to A.

Another idea I had was to activate & deactivate the triggers. But oh it's gonna be such a headache, because I want to do sth more complex, and basically I'd need the triggers to activate & deactivate each other in chains. And always worry about the frustum being large enough so triggers on the other end of the region aren't missed... No fun to program it and basically untestable.

That sounds pretty simple though. Add an action to each of the 2 triggers that deactivates the opposing one. In the middle of the hallway, place another trigger that reactivates both of them.

Yet another idea might be to use teleport elevators, like in the multiplayer world map. That seems to work, at least I've never heard of overlap glitches between the 8 cities. It would kinda destroy the walk-through magic tunnel experience tho. And I have no idea how to do it; there don't seem to be tutorials. Any hints?

https://dungeonsiege.fandom.com/wiki/Guide:_Siege_University_-_206:_Elevators

Your on-off switch triggers is a better idea though. If you do not want them, I would still just extend the corridor to 128+ meters instead of making a displacer.

Yeah I've seen that tutorial and I'll do it, maybe I find some inspiration anyways. But about teleport elevators it just says "Instant elevators (Hub/Displacer Elevators) are worthy of a 300-level Siege U doc." and such a tutorial doesn't exist. Maybe after the ele tut I can look at the MP map and understand how it's done.

The case of activating triggers is not so simple because as I said I want to do something more complex than that. There should be a "long way" on the ground from region A to B as well. And if the player starts at A (and the B triggers are deactivated) and they walk the way to B then the B triggers should be activated when they arrive and the (again overlapping) triggers of A should be deactivated. Can't see a way to do that other than having a complete chain of triggers along the whole way regions, always within frustum range, and not a single mistake to be made anywhere. After all, can't simply put a trigger there that activates the other trigger, the new trigger would have the same problem. Really wish the triggers were disabled by fading the nodes, or party_member_within_node worked as expected.

I'm afraid there is a reason why the multiplayer world uses teleport elevators. Otherwise all 8 towns would overlap each other, and that would be a giant mess with the stitching system working as it does.

Global variables have an infinite range. You can tell a trigger how to behave before it loads by setting a global variable with skrit, which is how quests are handled. They use the lines

set
GameAuditor.GetDb.SetInt(quest_name$, quest_stage$);
get
quest_stage$ = GameAuditor.GetDb.GetInt(quest_name$);

Technically if an A-side and a B-side trigger bottleneck each route between A and B, you can catch the game before it tries to render previously-passed-through, unhidden nodes at the destination and tell them to hide them.

But really, I do see the fundamental problem. Since it served you trigger boxes, I suppose the game will also serve you everything else, like un-rendered monsters aggro and collisions from B even if it is hidden correctly and you are in A. Gotta either teleport or use a long corridor then. I wonder if there could be such thing as a seamless teleport node in that corridor...

About global vars:
I see, I could use a var like char_at_region and set it to 1 for A and 2 for B. But how and when would I set it? I could set those "bottleneck triggers" at much more convenient locations that would basically guarantee no overlapping: down in the tunnel, and in the middle of the long way, which is more than a frustrum away from either A or B (except if some funnyguy has a far-sight mod installed, looking at you bare_elf).
But how do I set that variable? I don't see an option to execute a skrit in a trigger... Nor any option to check a variable in a trigger condition...

Meanwhile I'm getting more & more befriended with the idea of teleports.
The original idea was to have a seamless walk-through experience of the "funky" (read non-Euclidean) geometry. And not only the tunnel itself, where the trick would be instantaneously obvious (stand in town A, walk downstairs into the tunnel & upstairs on the other end a few meters later, and you're in a completely different place). Also the long way is non-Euclidean, but that's of course a little more subtle to notice (like when you walk a while in only one direction and end up where you started). And such a tunnel would be a powerful gimmick that would completely overshadow the more subtle geometry trick of the long way.
If however the "shortcut" from A to B is done with an entirely different mechanism, these two things would not be confused and the player could enjoy both in their own right.

The reason I want the shortcut is that I want the player to be able to go from A to B very quickly - but only after "earning" it by taking the long way around first.
Originally I planned to do this with doors into the tunnel that could only be opened from outside (with a simple door activation trigger, did it before).
Now instead I might use the mechanism as in the displacer platforms, that also need to be activated once from the "far end" and then can be used as often as the player wants.
I did that elevator tutorial and had some fun playing around with the movement hints. I'll look into the displacer implementation of the MP map tomorrow, hopefully I can figure out how to do it!

Already now I want to thank you for all your ideas and help in discussion.

It has been a while since I did any of this stuff, but iirc, the few bracketed [components] you see in the templates which do not involve hardcoded GPG components like aspect, invoke skrit files with name matching the component.

I.e. with notepad, add the component [foerstj's_global_script] {}, either to a new trigger template or maybe just to an instance of a trigger on the map, and it will execute foerstj's_global_script.skrit when the object gets loaded.

Kind of disappointing you'll have to settle for a teleporter, but it should be quite straightforward to mimic the displacer pads. That also sounds like a job for notepad.

I managed to put teleports into my map, yay! I made an extra little region to be my "hub", since I want to add a third place to visit but the only hub provided by the DS maps has 8 fields & pre-written texts on them of course. What's more, I managed to make the platforms flip over instead of flying upwards, and I added quests to activate both displacers from the outside (so the player can initially teleport into the hub but not out the other way - they have to walk the long way around once first). Full success and I love the result. Thank you again Tristan.