NWN2 Dimension Door?

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

User avatar
Riotnrrd
DMA's Technical Liaison
Posts: 1682
Joined: Sat Jan 03, 2004 2:04 pm

NWN2 Dimension Door?

Post by Riotnrrd »

AL (et al), do we have existing code for NWN1 Dimension Door?

Any objections to moving it into NWN2?
HEEGZ
Dungeon Master
Posts: 7085
Joined: Wed Dec 28, 2005 4:17 pm
Location: US CST

Re: NWN2 Dimension Door?

Post by HEEGZ »

I think Ronan may have put Dim Door into NWN2 haks already. There was a post about this earlier, but I can't find it.
User avatar
Brokenbone
Chosen of Forumamus, God of Forums
Posts: 5771
Joined: Mon May 16, 2005 1:07 am
Location: London, Ontario, Canada

Re: NWN2 Dimension Door?

Post by Brokenbone »

It's in the NWN1 haks, something like dimdoor.nss

It has its share of strengths and weaknesses, as probably any teleporty magic would. Stuff like possibly compromising mod design in cases where you can jump a river or onto an unassailable cliff or whatever, whether just to travel or to harass non-ranged AI. Though by the same token, not being teleporty enough to bypass a locked door :P
ALFA NWN2 PCs: Rhaggot of the Bruised-Eye, and Bamshogbo
ALFA NWN1 PC: Jacobim Foxmantle
ALFA NWN1 Dead PC: Jon Shieldjack

DMA Staff
User avatar
Brokenbone
Chosen of Forumamus, God of Forums
Posts: 5771
Joined: Mon May 16, 2005 1:07 am
Location: London, Ontario, Canada

Re: NWN2 Dimension Door?

Post by Brokenbone »

I was slightly off on the name, you'd find it in ye olde ahp_3.0_2da.hak as as_s0_dimdoor.nss

You'll note it lets you drag along "buddies" (like other PCs if a PC caster, or same faction members if an NPC caster) up to a certain limit, you can't target buddies for tagalong though, same as buddies can't opt out. If they're really close to the caster, they get sucked up and ported to wherever the caster went. If this means you really wanted to get your wounded buddy out but your tank buddy was closer, tough, you and the tank are porting, the wounded guy is SOL and alone after the Dimdoor.

I'd suggest fooling with it in an NWN1 basemod just to see how it behaves there if interested in seeing how it might port to NWN2.

Code: Select all

////////////////////////////////////////////////////////////////////////////////
//
//  System Name : ALFA Core Rules
//     Filename : as_s0_dimdoor.nss
//      Version : 1.0
//         Date : 2006-09-05
//       Author : Ronan
//
//  Local Variable Prefix =
//
//  Dependencies external of nwscript:
//
//  Description
//  Generic reporting for the casting of spells which DMs need to be notified
//  of.
//
//  Revision History
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Includes ////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "em_include"

////////////////////////////////////////////////////////////////////////////////
// Constants ///////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

const float _DELAY = 2.0;

const int VFX_FNF_TELEPORT_IN = 471;
const int VFX_FNF_TELEPORT_OUT = 472;

////////////////////////////////////////////////////////////////////////////////
// Structures //////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Global Variables ////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Function Prototypes /////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

// This spell's code.
void main();

////////////////////////////////////////////////////////////////////////////////
// Function Definitions ////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

void main()
{
   // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run
   // this spell.
    if (!X2PreSpellCastCode())
    {
        return;
    }

    int nCasterLevel = GetCasterLevel(OBJECT_SELF);
    int nMetaMagic = GetMetaMagicFeat();
    location lTarget = GetSpellTargetLocation();

    int maxCreatures = nCasterLevel / 3;
    if(nMetaMagic == METAMAGIC_EMPOWER)
        maxCreatures = 2 * maxCreatures;

    effect eVis1 = EffectVisualEffect(VFX_FNF_TELEPORT_OUT);
    effect eVis2 = EffectVisualEffect(VFX_FNF_TELEPORT_IN);

    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis1, GetLocation(OBJECT_SELF));
    DelayCommand(_DELAY, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis2, lTarget));
    DelayCommand(_DELAY, AssignCommand(OBJECT_SELF, ActionJumpToLocation(lTarget)));

    object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(OBJECT_SELF));
    while(maxCreatures > 0 && GetIsObjectValid(oTarget)) {
        if(oTarget != OBJECT_SELF && ( GetFactionEqual(oTarget)) ) {
            int size = GetCreatureSize(oTarget);
            int creatureCost = 1;
            if(size == CREATURE_SIZE_LARGE)
                creatureCost = 2;
                else if(size == CREATURE_SIZE_HUGE)
                    creatureCost = 4;

            if(GetIsFriend(oTarget) && creatureCost <= maxCreatures) {
                maxCreatures = maxCreatures - creatureCost;
                DelayCommand(_DELAY, AssignCommand(oTarget, ActionJumpToLocation(lTarget)));
            }
        }
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, GetLocation(OBJECT_SELF));
    }
}
ALFA NWN2 PCs: Rhaggot of the Bruised-Eye, and Bamshogbo
ALFA NWN1 PC: Jacobim Foxmantle
ALFA NWN1 Dead PC: Jon Shieldjack

DMA Staff
User avatar
NESchampion
Staff Head - Documentation
Posts: 884
Joined: Thu Jul 13, 2006 12:46 am

Re: NWN2 Dimension Door?

Post by NESchampion »

Was any decision ever made on this? I know it's ancient but I'd love to see this spell make it in game; exploitation can be investigated by DMs if/as needed if it's possible to get this working at all.
Current PC: Olaf - The Silver Marches
User avatar
mogonk
Dire Badger
Posts: 133
Joined: Sat Nov 13, 2010 8:48 am

Re: NWN2 Dimension Door?

Post by mogonk »

I don't know enough about the exploitation issues to know whether this would be viable or not, but if we do implement it I think we should also replace the existing "Flee the Scene" invocation with the dimension door effect, per PnP.

Party buffs aren't exactly the first thing you think of when you think of Warlocks.

edit: Haven't found a Standards discussion on Dim Door specifically, but the response to the idea of changing Flee the Scene in the discussion on Warlocks was universal opposition. Seems like Standards is not in favor of this.
Zelknolf
Chosen of Forumamus, God of Forums
Posts: 6139
Joined: Tue Jul 05, 2005 7:04 pm

Re: NWN2 Dimension Door?

Post by Zelknolf »

This spell isn't as exploitable as it looks, due to the fact that it requires line of sight to establish the target of the dimension door (i.e. you can't DD through a closed/ locked door; can't DD through walls; can't DD across areas; really can't use DD for all of the stuff you would use it for in PnP), but back in ye olde days of NWN1, one of the additions I made to the haks was a series of scripts to handle climbing / flying / jumping (later swimming, but that one got disabled on every project I worked on because it was too intensive to build -- can't tell the difference between a river and a bottomless chasm by a script unless you make the builders label their rivers and bottomless chasms), which got quite a bit of flak here on ALFA. I also recall a Dimension Door 1/day item that was forcibly turned into a bonus spell slot.

That said, the NWN1 Dimension Door is pretty durn effective. Would be technically possible to bring it over, provided there was a receptive climate for it.
SwordSaintMusashi
Mook
Posts: 963
Joined: Mon Oct 10, 2005 4:49 pm
Location: Virginia
Contact:

Re: NWN2 Dimension Door?

Post by SwordSaintMusashi »

Are we speaking of the NWN2 version not requiring line of sight, or the PnP version? Because the PnP version does NOT require line of sight:

http://www.d20srd.org/srd/spells/dimensiondoor.htm

You pick a direction and a distance, or visual a spot you want to go to within the spell's range. The whole point of it was to bypass doors and other obstacles. In NWN2, that would translate to being able to click on a hallway you can see but don't have access to (which we all know we can do: NWN2's hiding rooms ability is not super effective). Or being able to choose a distance: short, medium, far, and teleporting accordingly, with the spell failing if it takes you to a place you can't go. (I know NWN1 had scripts for that last part. Used them alot in some old NWN1 servers).
Current PCs:
Zova Earth Breaker, Monk of Rasheman
Alyra Ashedown, Knight Commander of Silverymoon
Zelknolf
Chosen of Forumamus, God of Forums
Posts: 6139
Joined: Tue Jul 05, 2005 7:04 pm

Re: NWN2 Dimension Door?

Post by Zelknolf »

Zelknolf wrote:really can't use DD for all of the stuff you would use it for in PnP
I did mention that I wasn't talking about the PnP version. But if we do want to give capacity to DD into invalid locations (which would come with allowing targeting without line of sight), we're lookin' at some significant server load for calculating a nearby valid location (tricky business), putting the PC there (not so tricky), putting damage in place (also not tricky), and figuring out how this would be worked into a combat situation (tricky business). Or making the spell pretty significantly more powerful than it's pen and paper version of itself -- which I would say consequenceless failure of the spell would be. Half of the reason to not DD without LoS is the risk of popping into a den of bad guys after having lost 14 of your dwindling wizardly hit points.
User avatar
mogonk
Dire Badger
Posts: 133
Joined: Sat Nov 13, 2010 8:48 am

Re: NWN2 Dimension Door?

Post by mogonk »

Zelknolf wrote:we're lookin' at some significant server load for calculating a nearby valid location
That seems like a fairly solid argument against implementing the PnP version of the spell. More server load is not something we need.

A version of DD requiring LOS would still have uses. Maybe make it a 3rd lvl spell instead of 4th to reflect the reduced functionality?
Zelknolf
Chosen of Forumamus, God of Forums
Posts: 6139
Joined: Tue Jul 05, 2005 7:04 pm

Re: NWN2 Dimension Door?

Post by Zelknolf »

mogonk wrote:That seems like a fairly solid argument against implementing the PnP version of the spell. More server load is not something we need.

A version of DD requiring LOS would still have uses. Maybe make it a 3rd lvl spell instead of 4th to reflect the reduced functionality?
No harm in proposing it. I might argue to leave it fourth level and add simpler functionality that lacks the complications that the spell's full PnP-like power would cause -- like "Target a door to DD to the other side of the door." and/or "Target an AT to go through the AT" -- add the standard RP item clause (( "DMs may choose to use this as if it were PnP, but are not obligated to. As long as they play fair -- NPCs with PnP DD shouldn't be about unless PCs can do the same." )), and say that we're covering most of the bases. At least we're covering the bases that don't require us to call GetDistanceBetweenLocations, and that one is a pure rotten bastard for some unknown reason.
User avatar
mogonk
Dire Badger
Posts: 133
Joined: Sat Nov 13, 2010 8:48 am

Re: NWN2 Dimension Door?

Post by mogonk »

Zelknolf wrote: I might argue to leave it fourth level and add simpler functionality that lacks the complications that the spell's full PnP-like power would cause -- like "Target a door to DD to the other side of the door." and/or "Target an AT to go through the AT"
Makes a lot of sense. Good call.
User avatar
Blindhamsterman
Haste Bear
Posts: 2396
Joined: Fri Jun 04, 2004 11:13 am
Location: GMT

Re: NWN2 Dimension Door?

Post by Blindhamsterman »

"Target a door to DD to the other side of the door." and/or "Target an AT to go through the AT"
this sounds like a pretty elegant way of handling the spell, I like it.
User avatar
NESchampion
Staff Head - Documentation
Posts: 884
Joined: Thu Jul 13, 2006 12:46 am

Re: NWN2 Dimension Door?

Post by NESchampion »

Posting the info on Dimension Door here for quick reference within the thread:
Dimension Door
Conjuration (Teleportation)
Level: Brd 4, Sor/Wiz 4, Travel 4
Components: V
Casting Time: 1 standard action
Range: Long (400 ft. + 40 ft./level)
Target: You and touched objects or other touched willing creatures
Duration: Instantaneous
Saving Throw: None and Will negates (object)
Spell Resistance: No and Yes (object)

You instantly transfer yourself from your current location to any other spot within range. You always arrive at exactly the spot desired—whether by simply visualizing the area or by stating direction. After using this spell, you can’t take any other actions until your next turn. You can bring along objects as long as their weight doesn’t exceed your maximum load. You may also bring one additional willing Medium or smaller creature (carrying gear or objects up to its maximum load) or its equivalent per three caster levels. A Large creature counts as two Medium creatures, a Huge creature counts as two Large creatures, and so forth. All creatures to be transported must be in contact with one another, and at least one of those creatures must be in contact with you.

If you arrive in a place that is already occupied by a solid body, you and each creature traveling with you take 1d6 points of damage and are shunted to a random open space on a suitable surface within 100 feet of the intended location.

If there is no free space within 100 feet, you and each creature traveling with you take an additional 2d6 points of damage and are shunted to a free space within 1,000 feet. If there is no free space within 1,000 feet, you and each creature travelling with you take an additional 4d6 points of damage and the spell simply fails.
Targeting a door to appear on the other side of it seems more than reasonable to me, and requiring line of sight for non-DM use would be fine too.

One thing worth considering: would it be possible to bring other people along with you a'la the boat systems in TSM using auto-follow? If so is there any way to select as per PnP (1 extra person per three levels meaning 2-6 extra people total) or would it just drag whoever is following you in? Assuming with LOS requirements for non-DM use there are no chances for damaging yourself and others.

Things to consider for any Standards suggestions if a thread is made.
Current PC: Olaf - The Silver Marches
User avatar
Brokenbone
Chosen of Forumamus, God of Forums
Posts: 5771
Joined: Mon May 16, 2005 1:07 am
Location: London, Ontario, Canada

Re: NWN2 Dimension Door?

Post by Brokenbone »

The old version DRAGGED whoever was closest, and started up counting units of largeness to see how much you could afford within a medium sphere... see the code quote thingy from a much earlier post.

It did not issue a quiz to nearby people to say "hey are you willing to take a ride", it simply dragged faction equals, I do not know what that means though. People 100% friendly to you, like a "defender" who isn't aggravated and attacking you? Or is it people only from the PC faction? Could it possibly drag off a PC who you wanted to kill on an isolated cliff top / across a river / across a wall while his/her friends plinked ineffectually against you with arrows or were denied other attack by terrain? Don't know!
ALFA NWN2 PCs: Rhaggot of the Bruised-Eye, and Bamshogbo
ALFA NWN1 PC: Jacobim Foxmantle
ALFA NWN1 Dead PC: Jon Shieldjack

DMA Staff
Locked