DO NOT USE INVISIBILITY

General forum for server information, questions, and announcements.

Moderators: Wynna, NWN2 - 03 DM

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

Re: DO NOT USE INVISIBILITY

Post by NESchampion »

Is there any practical reason we can't make use of something like this which was originally meant to make MP invisibility actually function as invisibility (i.e. before it used to not make the character invisible to other PCs, so he changed it to do that)?

From the look of it he just removed the existing invisibility effect (commented it out) and then substituted his own effect and checks upon that for hide / spot and for various forms of blindsight etc. Even if we can't use this sort of setup in full, perhaps it'd be a useful starting point to edit into our own working set of scripts.
Current PC: Olaf - The Silver Marches
johnlewismcleod
Dungeon Master
Posts: 2021
Joined: Mon Nov 17, 2008 1:37 am
Location: Tarrant County, Texas

Re: DO NOT USE INVISIBILITY

Post by johnlewismcleod »

It certainly looks like a fix to me. If not perfect, it seems close.

Thanks for looking and finding, NES :D
I seek plunder....and succulent greens


[Wynna] Chula Lysander: [Talk] *Shakes head* I've been in worse situations. He was just....unjoyful! *stomps foot*


Retired PC's: Torquil, Gwenevere
Former PC's: Rugo, Flora, Rory Mor
User avatar
Rotku
Iron Fist Tyrant
Posts: 6948
Joined: Tue Jan 06, 2004 1:09 am
Location: New Zealand (+13 GMT)

Re: DO NOT USE INVISIBILITY

Post by Rotku »

From my understanding, that's not the core problem.
< Signature Free Zone >
User avatar
Blindhamsterman
Haste Bear
Posts: 2396
Joined: Fri Jun 04, 2004 11:13 am
Location: GMT

Re: DO NOT USE INVISIBILITY

Post by Blindhamsterman »

core problem is that monsters dont roll spot/listen checks as of the latest patch... so actually the above solution should work in theory.
User avatar
dirsa
Orc Champion
Posts: 417
Joined: Tue Oct 25, 2005 12:33 pm

Re: DO NOT USE INVISIBILITY

Post by dirsa »

Erevain wrote:core problem is that monsters dont roll spot/listen checks as of the latest patch... so actually the above solution should work in theory.
that doesn't sound quite right... how do they detect stealthed characters then? and they do...
fighting for peace is like screwing for virginity
User avatar
Rotku
Iron Fist Tyrant
Posts: 6948
Joined: Tue Jan 06, 2004 1:09 am
Location: New Zealand (+13 GMT)

Re: DO NOT USE INVISIBILITY

Post by Rotku »

Shows how on to it I am. I'll go back to hiding in my cave, far away from this technology thing.
< Signature Free Zone >
User avatar
Blindhamsterman
Haste Bear
Posts: 2396
Joined: Fri Jun 04, 2004 11:13 am
Location: GMT

Re: DO NOT USE INVISIBILITY

Post by Blindhamsterman »

[quote="dirsa"][quote="Erevain"]core problem is that monsters dont roll spot/listen checks as of the latest patch... so actually the above solution should work in theory.[/quote]

that doesn't sound quite right... how do they detect stealthed characters then? and they do...[/quote]

they can spot someone using hide/MS but not invisible as of latest patch.
User avatar
dirsa
Orc Champion
Posts: 417
Joined: Tue Oct 25, 2005 12:33 pm

Re: DO NOT USE INVISIBILITY

Post by dirsa »

Erevain wrote:they can spot someone using hide/MS but not invisible as of latest patch.
that would tell me that the problem is with invisibility, not the monsters... after reading what nesschampion posted a link to - it would sound like a fix to me...
fighting for peace is like screwing for virginity
User avatar
Curmudgeon
Gadfly
Posts: 4312
Joined: Thu Oct 07, 2004 12:07 am
Location: East coast US

Re: DO NOT USE INVISIBILITY

Post by Curmudgeon »

I'll note that fix is over 2-1/2 years old, and the current Invisibility issues came in with Patch 1.23

:evil:
- Curmudgeon
HDM ALFA 03 - The Silver Marches
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Maxim #12: A soft answer turneth away wrath. Once wrath is looking the other way, shoot it in the head." - The Seventy Maxims of Maximally Effective Mercenaries

"This is not my circus. These are not my monkeys."

Realmslore: Daily Dwarf Common
User avatar
NESchampion
Staff Head - Documentation
Posts: 884
Joined: Thu Jul 13, 2006 12:46 am

Re: DO NOT USE INVISIBILITY

Post by NESchampion »

Curmudgeon wrote:I'll note that fix is over 2-1/2 years old, and the current Invisibility issues came in with Patch 1.23

:evil:
Noted, but it looks like when comparing the invisibility scripting he just replaced the existing effect (which at the time didn't hide PCs from other PCs visually) with his own script that did and provides a spot / listen check. Obviously I haven't been able to test it on any of the existing servers, but if it could be used to replace the old effect and has spot and listen checks, then maybe it can be modified in to replace the new effect (that creates super invisibility). Even if it can't, maybe one of our more code-proficient gurus could use it as a baseline or for ideas.

-----------

The bulk of the modified invisibility code this person created is in the file dd_inv_inc.nss:

Code: Select all

//::///////////////////////////////////////////////
//:: PW Invisibility FIX include 
//:: dd_inv_inc.nss
//:: Copyright (c) 2007 Dedo
//:://////////////////////////////////////////////
/*
    Constants and utility functions for MP invisibility
*/
const int INVISIBLE = 2;
const int TRANSPARENT = 1;
const int VISIBLE = 0;
const int INVISID = 999;
const int TRANSPID = 998;
const int SVIRNEFBLIN_INVISIBILITY = 944;
const int DUERGAR_INVISIBILITY = 804;
const int SPOT_DC = 30;
const string SPOTTED = "You have a hunch something's there";
const string HEARD = "You hear strange noises";
//const string HEARD = "Senti dei rumori sospetti";
//const string SPOTTED = "Ti sembra che ci sia qualcosa intorno";

int EnemySeeing(object oPC)
{
	location lPCPosition = GetLocation(oPC);
	object oEnemy = GetFirstObjectInShape(SHAPE_SPHERE,30.0,lPCPosition,FALSE,OBJECT_TYPE_CREATURE);
	int iMoveSilently = d20(1) + GetSkillRank(SKILL_MOVE_SILENTLY, oPC, FALSE);
	while (GetIsObjectValid(oEnemy))
	{
		if ((GetHasSpellEffect(SPELL_SEE_INVISIBILITY, oEnemy) ||
			GetHasSpellEffect(SPELL_BLINDSIGHT, oEnemy) ||
			GetHasSpellEffect(SPELL_TRUE_SEEING, oEnemy) ||
			GetHasSpellEffect(SPELL_I_SEE_THE_UNSEEN, oEnemy)) && (oEnemy != oPC))	
			{
				if (LineOfSightObject(oPC, oEnemy)) { return 1; }
			}
		if (GetIsPC(oEnemy) && oEnemy != oPC)
		{
			float fDistance = GetDistanceBetween(oPC, oEnemy);
			if (fDistance <= 10.0 && (d20(1) + GetSkillRank(SKILL_SPOT, oEnemy, FALSE)) >= SPOT_DC) SendMessageToPC(oEnemy, SPOTTED);
			if ((d20(1) + GetSkillRank(SKILL_LISTEN, oEnemy, FALSE)) >= iMoveSilently + FloatToInt(fDistance/3)) SendMessageToPC(oEnemy, HEARD);
		}
		oEnemy=GetNextObjectInShape(SHAPE_SPHERE,30.0,lPCPosition,FALSE,OBJECT_TYPE_CREATURE);	
	}
	return 0;
}

void SetInvisible(object oTarget, float fDuration)
{
	effect eTrueInvis = EffectVisualEffect( VFX_DUR_CUTSCENE_INVISIBILITY );
	ApplyEffectToObject(DURATION_TYPE_TEMPORARY, SetEffectSpellId(eTrueInvis, INVISID), oTarget, fDuration); 
	SetLocalInt(oTarget, "STATUS", INVISIBLE);
}

void SwitchInvisibility(object oPC, int iStatus)
{
	effect eLook = GetFirstEffect(oPC);
	effect e1 = EffectVisualEffect( VFX_DUR_INVISIBILITY );
	effect e2 = EffectVisualEffect( VFX_DUR_CUTSCENE_INVISIBILITY );
	while (GetIsEffectValid(eLook)) 
	{
		if (GetEffectSpellId(eLook) == INVISID && iStatus != INVISIBLE) {RemoveEffect(oPC, eLook);}
		if (GetEffectSpellId(eLook) == TRANSPID && iStatus != TRANSPARENT) {RemoveEffect(oPC, eLook);}
		eLook = GetNextEffect(oPC);
	}
	switch (iStatus)
	{
	case 1:
		ApplyEffectToObject(DURATION_TYPE_PERMANENT, SetEffectSpellId(e1, TRANSPID), oPC);
		SetLocalInt(oPC, "STATUS", TRANSPARENT);
		break;
	case 2:
		ApplyEffectToObject(DURATION_TYPE_PERMANENT, SetEffectSpellId(e2, INVISID), oPC);
		SetLocalInt(oPC, "STATUS", INVISIBLE);
		break;
	default:
		DeleteLocalInt(oPC, "STATUS");
		break;
	}
}
The rest is just edits to the base invisibility scripts to call this scripting instead of running the default vfx. Would need one of our coders to take a look at this though to get a better idea of whether or not it would work for us, as my knowledge of NWScript is basically nil.
Current PC: Olaf - The Silver Marches
Sandermann
Rust Monster
Posts: 1228
Joined: Sun Jul 18, 2004 3:01 pm
Location: Richmond, North Yorkshire

Re: DO NOT USE INVISIBILITY

Post by Sandermann »

The problem is not one of checks, or what effect is applied.
core problem is that monsters dont roll spot/listen checks as of the latest patch... so actually the above solution should work in theory.
Monsters DO roll checks, because one NPC can spot another NPC.

The problem is the 1.23 patch cnaged the core engine effect of the invisibility effect.

We tested it quite throughly before making the initial post about no tusing invis without a DM and the following is true.

an NPC CAN NOT spot a PC
a PC CAN NOT spot a PC
a PC CAN spot an NPC
an NPC CAN spot an NPC

As the spell script does not differentiate between the effect used for a PC or an NPC this means the core coding has been changed. This was done (as stated by OE) because most players thought it was a bug that they could be detected while invis and they got sick of dealing with the complaints.

We can't use or adapt a solution to the previous bug. Essentially we do not need to. as PCs can spot NPCs and NPCs can spot each other we can streamline the code to only run checks for NPC vs PC or PC vs PC detection - the game engine already handles the other scenarios correctly.

What we do need to do is decide HOW to handle this and this call has to come from tech.

-as an aside, you also cant use "EFFECT_CUTSCENE_INVISIBLE" as this renders a PC as a non-game entity. The character can not be affected by AoE's, wont activate scripted triggers and cant be seen by a DM. Its something only to be used ,as the name suggests, when rendering a cutscene :P
PC: Liasola Dark Arrow
Ex PC: Arzit'el Tlabbar

Blindhamsterman : "I think Sand may have just won the internet"
User avatar
NESchampion
Staff Head - Documentation
Posts: 884
Joined: Thu Jul 13, 2006 12:46 am

Re: DO NOT USE INVISIBILITY

Post by NESchampion »

Hmm, tricky indeed. I suppose working with the DM will have to suffice for now then.
Current PC: Olaf - The Silver Marches
User avatar
Ithildur
Dungeon Master
Posts: 3548
Joined: Wed Oct 06, 2004 7:46 am
Location: Best pizza town in the universe
Contact:

Re: DO NOT USE INVISIBILITY

Post by Ithildur »

Possible starting point suggestion until a more elegant solution can be found (I doubt OE will fix this anytime soon): Script in a new invisibility/greater invis/walk unseen. Change effects of these so that when the spell is cast, three scripted effects kick in, lasting the duration of the spell/invocation

1. Hide ranks boosted to set amount; 30 ranks seems a good compromise based on invisibility detection rules for 3.5e (I'm presuming implementing RAW exactly may not be a viable option for NWN2; this can be discussed or even further refined based on distance, movement, location, etc if someone is ambitious enough to try to make it more like RAW; see below).

The boost is a SET amount, not an additional +30 to existing hide ranks, since invisiblity should not grant any advantages to someone with high Hide ranks over someone wearing a bright yellow clown costume and having zero ranks in Hide (MS is not affected at all by this obviously).

2. 50% concealment is given to the 'new'invis' creature, lasting for duration of the spell (ie minute/lvl or until character attacks; in the case of greater invis, simply duration of spell as the concealment should remain even with attacking). This is pretty self explanatory.

3. Grant the Hide In Plain Sight ability to the character which lasts for the duration of the spell as per normal, which means it's gone when an attack is made except in the case of Greater Invis it remains.

RAW rules for detecting invisible things:
A creature can generally notice the presence of an active invisible creature within 30 feet with a DC 20 Spot check. The observer gains a hunch that “something’s there” but can’t see it or target it accurately with an attack. A creature who is holding still is very hard to notice (DC 30). An inanimate object, an unliving creature holding still, or a completely immobile creature is even harder to spot (DC 40). It's practically impossible (+20 DC) to pinpoint an invisible creature's location with a Spot check, and even if a character succeeds on such a check, the invisible creature still benefits from total concealment (50% miss chance).

30 ranks in hide with temporary HIPS may be a workable compromise because a DC 20 spot shouldn't reveal anything more than a 'haunch something's within 30 feet' per RAW, but someone in NWN2 who spots the 30 ranks hips guy can pretty much pinpoint the guy and target him with a variety of options for at least several seconds. Hence the DC should be higher than 20, arguably even higher than 30.

Practically speaking in a RP environment, you really shouldn't be running around at full speed while invis very often as it defeats the aim of trying to remain undetected (the exception is detection has occured, escape quickly) so having your movement rate reduced to walking by having to go into stealth mode isn't that much of setback imo.

In addition, having temporary hips grants additional opportunities to slip away safely unseen (or set up for your own attack); it's a powerful ability that balances out the disadvantages of a 30 Hide which is much more vulnerable than being RAW invisible.

Finally, all these effects end if the 'new invis' character attacks, unless they have Greater Invisibility.

The net affect would be closer in overall balance to Invisibility affects by RAW compared to the default OE Invisibility effect for handling invisible PCs, and certainly closer than no Invisibility at all... at least without extremely complicated scripting and possibly running up against game engine limitations.

Additional issue that was brought up: Detection via spells, such as See Invisibility, True Sight, Blind Sight, See the Unseen. I do not have access to technical details of how these spells work but if they work by simply blocking/supressing/ending a specific effect called 'Invisibility' for the caster/recipient of spell, then I'd imagine it wouldn't be too difficult to tweak them to block/end the 'new invisibility' effects for the caster/recipient of spell. If these spells do not function this way, then I'd have no idea atm.

Discuss/pick away; I know it's far from perfect, but I wanted to throw it out there in the off chance this wasn't already discussed at some point.
Formerly: Aglaril Shaelara, Faerun's unlikeliest Bladesinger
Current main: Ky - something

It’s not the critic who counts...The credit belongs to the man who actually is in the arena, who strives violently, who errs and comes up short again and again...who if he wins, knows the triumph of high achievement, but who if he fails, fails while daring greatly.-T. Roosevelt
User avatar
Curmudgeon
Gadfly
Posts: 4312
Joined: Thu Oct 07, 2004 12:07 am
Location: East coast US

Re: DO NOT USE INVISIBILITY

Post by Curmudgeon »

Sandermann wrote:
what if for instance my character swallowed a potion of invisibility to get out of a lethal situation, would that be considered cheating?
Ideally no, but your PC shouldnt be robbed of this opportunity to escape. We are still playing this by ear for the moment.

For now id continue to use this action (though I can only speak for BG), make the DMs aware of it and if we think its necessary the situation can be re-played.
Same applies to TSM and all Live servers.
- Curmudgeon
HDM ALFA 03 - The Silver Marches
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Maxim #12: A soft answer turneth away wrath. Once wrath is looking the other way, shoot it in the head." - The Seventy Maxims of Maximally Effective Mercenaries

"This is not my circus. These are not my monkeys."

Realmslore: Daily Dwarf Common
User avatar
Blindhamsterman
Haste Bear
Posts: 2396
Joined: Fri Jun 04, 2004 11:13 am
Location: GMT

Re: DO NOT USE INVISIBILITY

Post by Blindhamsterman »

well... with a clear ruling, i remove my last statement and say that I hope there is an active plan to do something to fix the spell...
Standards Member


Current PC: Elenaril Avae'Kerym of the Lynx Lodge
<Heero>: yeah for every pc ronan has killed dming, paazin has killed 2 with his spawns
Post Reply