Jump to content

Inconsistent results from a user-defined OnDeath handler with filters


DaWrecka

Recommended Posts

Wow, a lot happened after I went to bed.

The trouble with any actor templated to a levelled list is that their base object (GetBaseObject, aka gbo) is not static, but dynamic, ie if you called getbaseobject on the ref in-game you would get a form whose formid starts with FF (255). This explains the problem with some of the debug readouts, in that IsInList called on the ref won't match the base form that is stored in the geck. To get that base form, you'd need GetBaseForm (gbf) and look it up in the list with ListGetFormIndex.

 

That it should also be a problem for a formlist working as filter for an event handler is new to me, but I honestly didn't test event handlers as much as arrays, string vars etc, at the time i wrote the tutorial (and haven't had much use for them either so far, except UDEs). I suspect the filter check done by the event handler follows the gbo rather than the gbf method. So it seems that you're stuck with using a formlist of refs rather than forms.

 

The trouble with any actor templated to a levelled list is that their base object (GetBaseObject, aka gbo) is not static, but dynamic, ie if you called getbaseobject on the ref in-game you would get a form whose formid starts with FF (255).

This was exactly what I'd expected. However, OP said checking their base ID in-game with GBO did return the same ID as what was on the form list passed to the handler. Either that or we misunderstood one another. But the thing that I find interesting and confusing here is that there are other levelled actors on the form list that have their deaths registered accurately by the handler as intended.
Not quite accurate; I think some clarification is in order.

 

Taking Grouse as an example; Grouse has his own NPC_ form, base ID xx015698; If you call GetBaseObject on GrouseRef, his reference in the world which has a formID of xx033174, it returns the value xx015698, which is on the NPCParadiseFallsSlaverLIST. However, the NPC_ record Grouse uses LvlSlaver as a template. The same applies for Carolina Red, Jotun, Ymir, Pronto, and Richter; all six use LvlSlaver, all six have their own NPC_ form which is referenced in the world, all six references return the expected base form when you call GetBaseObject on them, all six references return a value for GetBaseObject which IS on the filter list. And none of the six is caught by the event handler if the filter FLST uses those base forms.

 

LvlSlaver is, itself, an NPC_ record; however, it uses EncSlaver as its template, which is indeed a LVLN, or leveled NPC, record.

 

The other candidates on the SlaverLIST include EulogyJones, Forty, and ParadiseFallsSlaver1, which have no template at all; ParadiseFallsSlaver2, 3, 4 and 5, and ParadiseFallsSlaverGuard01, which use ParadiseFallsSlaver1 as their template; Cutter, who uses DocAATEMPLATE as her template; and ParadiseFallsSlaverGuard02, ParadiseFallsSlaverGuard03, and ParadiseFallsSlaverGuard04, which use ParadiseFallsSlaverGuard01.

 

So to answer Mktavish's question...

Which Lvled actors did have their death registered ?

None of them. Of the NPCs using LvlSlaver as their template, none of them are processed by the event handler, unless I filter based on their refs and not their base forms.

 

How about a formlist with the refs instead?

This works - at least it does in this instance, because all of the references are already persistent. I'm not sure whether it would work in a different case where one or more of the references weren't already persistent.

 

EncSlaver is the Base ID of the lvled character in the mix. Why those specific named base Id's show up in the render window as an M with an arrow.

It holds 8 base ID's of other NPC's to pick from , what the NPC LvlSlaver relys for everything in template data.

 

LvlSlaver is just an intermediary I guess. Never having a ref id of it ???

 

So was saying you take all 8 base ID's from the pic list of EncSlaver ... and put in a form list.

But then also if you click opening up some of those in its list ... you will see some rely on still more others.

 

So then the end of those strings need to be what is in the form list right ?

 

Ugg ... think better forget about that route.

This sounds like a rabbit hole that Alice would run from screaming if she so much as glanced at it.

Whats wrong with just passing the 6 ref ID's next to the Resident list ?

In this particular case: Nothing. But that might not be the same for all cases.

 

The easier thing in my view would be to set a variable from a script on each npc.

 

Most have one already in this script " ParadiseFallsSlaverScript" But some don't like Grouse.

 

So could just copy/paste this block from that one to his.

 

Begin OnDeath

set MQ07.KillCount to ( MQ07.KillCount + 1 )

End

 

Or probably better just make your own "OnDeath" block similar ... setting a variable in a quest script , or the quest script that rewards the player for this.

The reason I want to avoid this is conflicts; if I edit those scripts, but another mod is installed that ALSO edits those scripts, it's a crapshoot whether I get the events I need. Setting up an event handler avoids that conflict - assuming it works reliably, of course.

 

EDIT: No, I don't know why the forum isn't displaying the timestamps and handles for the quotes. It wants to be dumb, I guess.

Edited by DaWrecka
Link to comment
Share on other sites

Ah I see. Well, if there is ever a need to do this with NPCs that aren't persistent already and you wish to avoid a conflict, you can use an array loop to catch them and then either add them to a form list to be passed to an event handler all at once or set the event handler these NPCs individually.

Link to comment
Share on other sites

Wow, a lot happened after I went to bed.

 

EDIT: No, I don't know why the forum isn't displaying the timestamps and handles for the quotes. It wants to be dumb, I guess.

 

 

I see the time stamps just fine on the quotes ^shrug^

 

But hmmmm ... interesting ... need some time to digest the info ... plus I just figured out the difference between GBO & GBF .

 

Ahhh I see the value of not editing vanilla scripts :ohmy: ... ya could be another Alice rabbit hole o_O

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...