Zum Inhalt wechseln

Foto

New player stats - damage taken, potions consumed?


  • Bitte melde dich an um zu Antworten
4 Antworten in diesem Thema

#1
DarthGizka

DarthGizka
  • Members
  • 867 Beiträge

The "Heroic Accomplishments" section of the character screen has loads of statistics, but what I'd like to see in addition to damage dealt and hit rate would be damage taken and potions consumed, both for the player character and for the whole party. That would allow it much better to gauge the combat abilities of different characters than the number of different kinds of bugs quashed and so on.

 

It would be possible to display at least one stat by dumping into stealing failures, which for most characters is bound to be zero anyway.

 

The trickier question is how to gather the statistics without modifying the core scripts, which would result in the game's core scripts being replaced by their toolset versions. Even if it were possible to decompile the current scripts it would still be a logistical nightmare. Not to mention that this would clash with mods that eliminate the bugs from those scripts.

 

Is there a clean way of gathering these stats, maybe by writing some sort of non-intrusive event listener?


  • Abraham_uk gefällt das

#2
Abraham_uk

Abraham_uk
  • Members
  • 11.713 Beiträge

Neat idea.



#3
DarthGizka

DarthGizka
  • Members
  • 867 Beiträge

I found the RegisterEventListener() function, which looks like it could enable non-intrusive catching of EVENT_TYPE_DAMAGED. It'll require some plumbing, like a PRCSCR for initial hooking and then tracking party changes, but on the whole it looks viable.

 

Does anyone have experience using that function? There don't seem to be any examples in the game code itself, and the description in script.ldf is mighty odd.



#4
Sunjammer

Sunjammer
  • Members
  • 925 Beiträge

I played around with RegisterEventListener at some point in the past (there even a trigger resource in my sandbox mod that claims to still do it) however I don't recall getting it to work (at least not to my satisfaction) so I'd need to take another look at it.

 

However there is an alternative: have you tried overriding the event(s) using the engineevents 2DA? There is an article in the wiki about it (ignore the first section as that is really just writing an custom handler). If you do go down that route bear in mind that LOTS of things get damaged and remember to pass the event back to its default handler when your done.


  • DarthGizka gefällt das

#5
DarthGizka

DarthGizka
  • Members
  • 867 Beiträge

Thanks, that info is very helpful. I'll do some experiments with RegisterEventListener() and post the results. If I don't get anywhere with it then I'll check out the engineevents thing. I'm keeping it in reserve for now because I want the impact of the stats gathering as small as possible, with the least potential for unforeseen interaction with mods. But it looks like a great mechanism for experimentation, for hooking into the game without including lots of toolset code or otherwise replacing the scripts of the actual game, whatever their provenance (toolset, patch or mod).