Dialogue GUI/System
Re: Dialogue GUI/System
I've a few questions regarding dialogues:
*I've a MWWorld::Ptr& actor. How can I get it's race?it's class?
*How can I check if an NPC is dead?
*Know if the player carry a certain item?
*I've a MWWorld::Ptr& actor. How can I get it's race?it's class?
*How can I check if an NPC is dead?
*Know if the player carry a certain item?
- sirherrbatka
- Posts: 2159
- Joined: 07 Aug 2011, 17:21
Re: Dialogue GUI/System
I'm not sure If you can. I think that you can only can check for journal entry after killing a npc.*How can I check if an NPC is dead?
Re: Dialogue GUI/System
What do you need this for? The dialogue GUI should not need to interact with this kind of stuff.
Anyway, anything I can offer you now will become wrong in a week or two. Maybe best assume NPCs don't carry items for now?
Use the get function of the Ptr to get a pointer to the LiveCellRef. Then use the base member (look up the NPC class in components/esm).*I've a MWWorld::Ptr& actor. How can I get it's race?it's class?
Difficult. We have no concept of dead yet. I guess you could check the HP. If it is not positive, the NPC can be considered dead. I am not entirely sure if that would be accurate though. Maybe it would be better to assume all NPCs are alive for now.*How can I check if an NPC is dead?
Difficult. I am revamping the container class currently. Well, I was before bug-hunting and other miscellaneous activity on the forum ate all my time.*Know if the player carry a certain item?
Anyway, anything I can offer you now will become wrong in a week or two. Maybe best assume NPCs don't carry items for now?
Re: Dialogue GUI/System
I believe that is the way it is checked in Morrowind, at least in scripts. The functions GetHealth and GetHealthGetRatio are used.Zini wrote:Difficult. We have no concept of dead yet. I guess you could check the HP. If it is not positive, the NPC can be considered dead. I am not entirely sure if that would be accurate though. Maybe it would be better to assume all NPCs are alive for now.
Re: Dialogue GUI/System
Thanks!
I'm working on the dialogue system (the dialogue GUI is functional now)What do you need this for? The dialogue GUI should not need to interact with this kind of stuff.
Sure, it can wait.Difficult. I am revamping the container class currently. Well, I was before bug-hunting and other miscellaneous activity on the forum ate all my time.
Anyway, anything I can offer you now will become wrong in a week or two. Maybe best assume NPCs don't carry items for now?
Re: Dialogue GUI/System
Okay. Assigned the task to you.I'm working on the dialogue system (the dialogue GUI is functional now)
Are you sure about that? I vaguely remember something about that you can't resurrect NPCs by simply increasing the health again (once it is at zero). In this case the NPC stays dead. But it's been a long time since I worked with this stuff and it is quite possible that I remember incorrectly.I believe that is the way it is checked in Morrowind, at least in scripts. The functions GetHealth and GetHealthGetRatio are used.
Re: Dialogue GUI/System
You are certainly correct if the NPC is dead from the start of the game. I don't know what happens when you set the health of a NPC you killed though.Zini wrote:Are you sure about that? I vaguely remember something about that you can't resurrect NPCs by simply increasing the health again (once it is at zero). In this case the NPC stays dead. But it's been a long time since I worked with this stuff and it is quite possible that I remember incorrectly.
Re: Dialogue GUI/System
when you kill an NPC its dead(hurr durr, pretty sure there is a flag saying its dead). giving it, its health back via the setav or similiar commands does nothing. you have to RA (can't remember if resurrect command was in MW) RA = Reset Actors. which RESETS ALL ACTORS.
Re: Dialogue GUI/System
That part is interesting. Does nothing as in:giving it, its health back via the setav or similiar commands does nothing
a) doesn't resurrect him
or as in:
b) doesn't restore his health
?