ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   How to get information about monsters? (https://www.esoui.com/forums/showthread.php?t=9579)

Regretfulone 02/10/21 07:30 PM

How to get information about monsters?
 
Hi all,

I am working on an addon and I require information about units that you are in combat with (post combat). I have already added LibCombat to the addon and some information comes through, like a name or the unitId, but I would like to know more about these units.

The unitId is only applicable to that monster when it has spawned and therefore is not entirely helpful. I would like to be able to maybe take that unitId and get more info about the monster, like is it dead, what is its universal identifier (since some critters and enemies share the same name like scorpions or wasps).

I have tried looking through the Wiki at the ingame available functions as well but I am at a loss. Does anyone know if this is possible or where to maybe look deeper?

Thanks!

awfuldead 02/11/21 12:44 AM

You can see what commands are available to you in the API documentation, but I'll say right away that information about the monster outside the battle cannot be obtained. Even bosses don't have unique IDs

API

Baertram 02/11/21 05:31 AM

During fight the unitId should be unique and you are able to react on events like event_combat_event etc. to check what these unitIds did, if they are alive etc.
via GetUnit*(unitTag) API functions from the API file that was linked above.
Or from the event parameters.

After the fight you cannot do this as the units get destroyed afaik, even if you just left combat without fighting (by running away).
Not each critter or boss or player got a unique Id you are able to reuse later on, sorry.

And some information about enemies (NPCs or players) cannot be obtained at all (also not during fights, like what skills they use etc.).

Regretfulone 02/11/21 09:50 AM

Thank you for the info! I was trying to make an addon that would track kill counts of mobs and their locations. It sort of works right now, but since it is based on the name of the unit that comes through, you definitely get some weird "kills" like the Ice Barrier spell.

I will have to take a look at the functions for getting unit information and see what I can grab from that. The current method I have in place records kills for every non-friendly unit in combat, even if you die and don't kill them all. That is why I was asking how to figure out if enemies are still alive or not.

Food for thought though. Thanks :)

awfuldead 02/12/21 11:52 AM

Quote:

Originally Posted by Regretfulone (Post 43192)
The current method I have in place records kills for every non-friendly unit in combat, even if you die and don't kill them all. That is why I was asking how to figure out if enemies are still alive or not.

what about add a condition to check if the player is alive?

Baertram 02/12/21 12:17 PM

I think he wanted to know if the critter is alive, not the player.
As there is no uniqueId for the critter and nothing after fight you could just check during fight what unitTags exist and also check if a unitTag gets destroyed -> should be the case as it will be killed.
EVENT_UNIT_DESTROYED (*string* _unitTag_)
-> Maybe not working for NPCs and critters, just group members and bosses .

* IsUnitDead(*string* _unitTag_)
** _Returns:_ *bool* _isDead_
GetUnitPower(CombatMechanicType)
+ the other GetUnit* and IsUnit* functions from the API txt documentation.

Maybe these only work with the unitTags you get from events and/or the "reticleover" where you need to move the crosshair above an enemy.

If these unitTags are not working for critters you might only be able to use events where there are _sourceUnitId_and _targetUnitId_ to identify the involved combatants.

Regretfulone 02/12/21 12:24 PM

Quote:

Originally Posted by awfuldead (Post 43194)
what about add a condition to check if the player is alive?

So with LibCombat, I am using the FightSummary to parse the information. The problem is that if you die, all the enemies from the fight still come through and you can't get information about whether they were actually killed. I think Baertram's reply below is in line with what I was thinking where with the fight summary, I may need to check if each unit exists or not.

Quote:

Originally Posted by Baertram (Post 43195)
I think he wanted to know if the critter is alive, not the player.
As there is no uniqueId for the critter and nothing after fight you could just check during fight what unitTags exist and also check if a unitTag gets destroyed -> should be the case as it will be killed.
EVENT_UNIT_DESTROYED (*string* _unitTag_)
-> Maybe not working for NPCs and critters, just group members and bosses .

* IsUnitDead(*string* _unitTag_)
** _Returns:_ *bool* _isDead_
GetUnitPower(CombatMechanicType)
+ the other GetUnit* and IsUnit* functions from the API txt documentation.

Maybe these only work with the unitTags you get from events and/or the "reticleover" where you need to move the crosshair above an enemy.

If these unitTags are not working for critters you might only be able to use events where there are _sourceUnitId_and _targetUnitId_ to identify the involved combatants.

Thanks for the input Baetram! I am thinking about how I might still be able to pull off the addon and this is definitely helpful! I was also thinking that it is likely that I will need to give people an option to create a 'blacklist' or an 'ignore' list so that they can ignore kills for silly things like Ice Barrier spell, unless they want to track that.

The other issue I foresee is that when citizens or npcs in a city become hostile and you kill them, that is also tracked. That is why I was hoping ESO offered a way to identify creatures that you can fight (alit, durzog, etc.).

Baertram 02/12/21 01:13 PM

You could maybe use the EVENT_JUSTICE* events to check if you have attacked any NPC. If it fires during combat it most probabyl was not because of stealing goods :p
Most probably the infamythresholdtype should be one of the higher ones if you attack or even kill an NPC:

h5. InfamyThresholdsType
* INFAMY_THRESHOLD_DISREPUTABLE
* INFAMY_THRESHOLD_FUGITIVE
* INFAMY_THRESHOLD_NOTORIOUS
* INFAMY_THRESHOLD_UPSTANDING


All times are GMT -6. The time now is 02:35 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI