Conceptual question: is it possible to transition between maps using calculated X,Y coordinates for arrival point?

Hello everyone, it’s Dustin.

We’re working on an idea for a “hidden realm” module for November 21’s custom content challenge. We envision a sort of spirit realm that is normally not visible to PCs but overlays the prime material with a one-to-one correspondence, geometrically. Picture the map of the spirit realm overlaying the prime. If you’ve played Dragon Age: Origins, then the idea is similar to the environment of the quest to kill a demon in the Fade.

So, a PC could transition from prime to spirit by activating a device and return by deactivating it. The PC would depart from prime location <X,Y> and arrive at spirit location <X,Y> where X=X & Y=Y, for any (X,Y). Ergo, arrival point on the destination map would be determined by the coordinates, not standard landing zones/doors.

Conceptually this seems straight-forward, but scripting-wise we’re not sure since we’re utter noobs as builders. Would moving the PC from map-to-map make sense and is it reasonably doable?

This might not be the best way to think about it. For example, would it make more sense to have one map that switches sets of placeables as the PC transitions between realms?

Other thoughts?

We’re happy & willing to learn but don’t want to go down a blind alley out of inexperience, given the challenge’s deadline. The only item I’m familiar with that does something similar is the Stone of Recall, which has a specific landing zone on the destination map.


It is perfectly doable and there are ready tools to facilitate it. You can get PC’s current coordinates using GetPosition, build target location using that, then jump.

Primer on locations:

Location(object, vector, float) - NWN Lexicon

Most of the code:

location lDest = Location(
	GetObjectByTag("TAG_OF_DESTINATION_AREA"), // target area
	GetPosition(oPC), // target coords
    GetFacing(oPC)); // target azimuth

AssignCommand(oPC, ClearAllAction()); // clear jumper's action queue
AssignCommand(oPC, ActionJumpToLocation(lDest)); // teleport

Note: if PC’s facing isn’t the same at the other end (but you want that), store it in a variable before jumping and restore with SetFacing (also via command assignment).


1 Like

Thanks Shadooow & NWShacker!