Monsters not spawning from Encounters in Mask of the Betrayer for players of level 31 or above

I’ve been receiving reports that monsters from encounter triggers are not spawning if the player is level 31 or above in the first areas of the Mask of the Betrayer (such as Okku’s barrow, but possibly even farther).
I opened the toolset and tried to see if there was a script that prevented the spawns if the level was above 30, but I had no luck so far.

Could anyone help me find the possible “culprit” among all those scripts? Maybe I didn’t look very well and it passed me by without me noticing. Encounters themselves have no “on enter” script associated to them.

hey Clang,

im a bit busy to poke at this myself but … you say that Encounters fail to spawn ?

have you tried setting up an Encounter in a newly created module and run it against L31+

 
am thinking it could be something hardcoded re. Encounters …?

Hello KevL_s,
actually I didn’t really test this myself, but a few people have been telling me that in Motb players of level 31 (but might as well be 41) or above find the dungeons almost empty (story-related encounters still happen).
I suppose I’ll give it a shot when I have time, I was hoping it was something more related to Mask of the betrayer since the reports I got were always about Bear God’s barrow being nearly empty.

well im thinking there aren’t really many Encounters used in the OC or expansions … (i could be wrong – haven’t actually looked). They’re kinda rare because, i assume, the changes that Nwn2 did to encounters made them both more complicated and kinda gimpy (but powerful in adaptability)

so yeah id set up a test case in a new module, to parse down the environment ( if you have to )

1 Like

bleargh, it really seems to be hardcoded, and it’s not even the level itself (up to level 40 they still spawn), but the exp as well. So if you are level 40 with just the exp needed to be level 40 they still spawn, if you are level 40, but with 10 more millions or so of exp to spare they don’t spawn.
Maybe there’s a workaround by adding an onter-script to them. Maybe.

yeh that’s def. blargh  :|

i imagine it’s totally doable, but its something to chase after and add ‘overrides’ to for any module …

or at least any module designed for levels over (xx)

hey. Hunt through the 2das … there might be one governing levels that stops at L40 …

i remember seeing something like that, in one of them @L40 … maybe

1 Like

good idea, maybe I’ll look into that, thanks.

1 Like

exptable.2da is one of them, stock version goes up to L40

There are other, more obscure tables like xptable.2da (which i think is for granting xp). And beware of 2das in campaign-folders – but those are usually for granting xp also.

 
extending exptable.2da is worth a shot if you haven’t already …

I had no luck so far, the closest I came to was encdifficulty.2da but even setting all those values to 160 or 255 didn’t fix the problem, exptable 2da was already changed of course and xptable didn’t help either.

I think it will be “easier” to just make a workaround script at this point.

The workaround script is even very easy to implement, I managed to make it spawn for a level 160 character simply with this as the OnEnter script:

void main()
{
	object oPC = GetEnteringObject();	
	object oENC = OBJECT_SELF;
	float fCR = IntToFloat(GetHitDice(oPC));
	TriggerEncounter(oENC, oPC, 0, fCR);
}

Now the problem is to attach it to every stock/campaign encounter out there… LE SIGH
and since encounters are pasted already, I’m not even sure if changing the blueprint will actually fix the problem… it might not work at all.

nope. Instead if the area has an onenter (or even the Module onenter-ish) override those script(s) and ‘get’ each Encounter object (loop over objects in each area) then use

int SCRIPT_ENCOUNTER_ON_OBJECT_ENTER        = 0; // <-
int SCRIPT_ENCOUNTER_ON_OBJECT_EXIT         = 1;
int SCRIPT_ENCOUNTER_ON_HEARTBEAT           = 2;
int SCRIPT_ENCOUNTER_ON_ENCOUNTER_EXHAUSTED = 3;
int SCRIPT_ENCOUNTER_ON_USER_DEFINED_EVENT  = 4;

void SetEventHandler( object oObject, int iEventID, string sScriptName );

to insert your script on every placed encounter

mmmm if it works… I might have a more general solution. One that does not require to hunt for every area on-enter script out there.
The idea is to give an item to the player (with the proper description) that, when activated, it applies an Aura effect that simply checks the entering objects nearby the player, checks if they are encounters, checks their events and eventually replaces the event handles with the script above.

IF it works, I’ll post the “Sometimes my genius is… it’s almost frightning” meme.
Or maybe I’ll post the follow up it if it doesn’t (“Stupidest idea ever”).

Wand of SuperEpic Encounters

loop through all areas in the module
    loop through all objects in the area
        if Encounter-object and not done
            issue warning if there's already an OnEnter script on it
            apply your OnEnter script
            set done on object

Ring of SuperEpic Resonance

- put on the ring and a vfx pulses out like a radar every second (pseudo HB)
- if an Encounter-object is within distance, apply your OnEnter script and mark it done.

/etc

I’m almost laughing if it didn’t hurt so much /shrug

Sadly the second one does not properly work, because for some reason, AreaOfEffects do not detect encounters as valid objects, in fact they are being very wanky for me, with heartbeats not working at all, so I had to settle with the first one. You use the item, it loops all areas in the module, all objects, all encounters, and fixes accordingly.

After a few tests it seems to work and somehow fix the problem, spawns resume as intended.
It fixes only the module you are currently playing of course, so during campaigns it needs to be used more than once.

The AreaOfEffect solution would have been better as the player would have needed to click only once and then forget about it, until death or whatever else removed the effect, but I suppose it was not just meant to be.

1 Like

/curious

what function are you using in the AoE loop?

GetFirst/NextObjectInShape()
GetNearestObject()

?

 
other possibilities …

// Is this creature in the given subarea? (trigger, area of effect object, etc..)
// This function will tell you if the creature has triggered an onEnter event,
// not if it is physically within the space of the subarea
int GetIsInSubArea(object oCreature, object oSubArea=OBJECT_SELF);

//RWT-OEI 04/17/08
//Given an area ID and a position in that area, returns the first sub-area that is found at that position.
//SubAreas are triggers, AoEEffectObjects, and Encounters.
//Use with GetNextSubArea() to iterate over all the sub-areas at this position.
// oArea = The area to search
// vPosition = The position to evaluate for sub areas.
object GetFirstSubArea( object oArea, vector vPosition );

//RWT-OEI 04/17/08
//Given an area ID, returns the next subarea to be found at the position specified when GetFirstSubArea()
//was called. It is necessary to call GetFirstSubArea() before calling this function in order to get
//any results back.
// oArea = The area to return the next SubArea from.
object GetNextSubArea( object oArea );

First I used the OnEnter script of the AreaOfEffect, then I tried GetFirst/Next Object in Shape.

But the fact is that the AreaOfEffects (I meant to use it like an aura, such as Aura of courage) scripts are not running very well, the Area does not seem to move with my characters at all (as it should since it’s applied via EffectAreaofEffect), also, heartbeats are not running at atll, I know because the first part of the heartbeat area script was to send a message that the heartbeat was running and I never saw it once.

The way I applied the effect was (and it worked as the aura icon appeared):

if (GetHasSpellEffect(FX_ENCFIX, oPC) == TRUE)
		{
			RemoveEffectsFromSpell(oPC, FX_ENCFIX);
			FloatingTextStringOnCreature("*Encounter fix turned OFF*", oPC, FALSE);
		}
		else
		{
			effect eFX = EffectAreaOfEffect(AOE_PER_CUSTOM_AOE, "", "enc_fix_apply");
			eFX = SupernaturalEffect(eFX);
			eFX = SetEffectSpellId(eFX, FX_ENCFIX);
			DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eFX, oPC));
			FloatingTextStringOnCreature("*Encounter fix turned ON*", oPC, FALSE);
		}

then, the script I tried on Heartbeat was:

void main()
{
	object oPC = GetFirstPC();
	SendMessageToPC(oPC, "Heartbeat running");
	location lAREA = GetLocation(OBJECT_SELF);
	object oENC = GetFirstObjectInShape(SHAPE_SPHERE, 2.0, lAREA, FALSE);
	while (oENC != OBJECT_INVALID)
	{
		SendMessageToPC(oPC, GetName(oENC));
		oENC = GetNextObjectInShape(SHAPE_SPHERE, 2.0, lAREA, FALSE);
	}
}

The second code was just to test the heartbeat script (if it was working at all), it was not meant to fix encounters yet. It didn’t even detect the PC with the aura itself.

what about trying a straight pHB script running on the PC?

just, you know, try and get something working auto …

That’s something I’d prefer to avoid, it would involve the use of delays (I don’t even know how well they would overlap the various saves and loads) and the player might have trouble stopping them.

I’ll give the Area of Effect another chance this weekend, but if I can’t get it to work, I’ll just stick to the solution that loops all areas in the module, I was pleasantly surprised to see it didn’t cause eccessive lag/freezing. I can always disable it for multiplayer or restrict it only to server owner.

1 Like

I found where the problem was, applying the effect from the item script counted the item as the owner of the aura, so it actually didn’t spawn at all. So I just called an Execute script on the player and applied it from there.

After a few tests, GetEnteringObject (on the OnEnter script of the aura) or GetFirstInPersistentObject (In Heartbeat) do not recognize encounters, they are probably placed below or above (or beyond?!) the aura so it doesn’t catch them.

However, GetFirstObjectInShape in the heartbeat script does work, and considering how close it is to the kind of solution I wanted, I think I can safely go ahead and post this, knowing that sometimes in the future, this will break something in plain sight obscure:

2 Likes