Dialogue GUI/System

Everything about development and the OpenMW source code.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Dialogue GUI/System

Post by gus »

Too late :p
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Dialogue GUI/System

Post by gus »

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?
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Dialogue GUI/System

Post by sirherrbatka »

*How can I check if an NPC is dead?
I'm not sure If you can. I think that you can only can check for journal entry after killing a npc.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Dialogue GUI/System

Post by Zini »

What do you need this for? The dialogue GUI should not need to interact with this kind of stuff.
*I've a MWWorld::Ptr& actor. How can I get it's race?it's class?
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).
*How can I check if an NPC is dead?
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.
*Know if the player carry a certain item?
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?
User avatar
pvdk
Posts: 528
Joined: 12 Aug 2011, 16:34

Re: Dialogue GUI/System

Post by pvdk »

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.
I believe that is the way it is checked in Morrowind, at least in scripts. The functions GetHealth and GetHealthGetRatio are used.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Dialogue GUI/System

Post by gus »

Thanks!
What do you need this for? The dialogue GUI should not need to interact with this kind of stuff.
I'm working on the dialogue system ;) (the dialogue GUI is functional now)
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?
Sure, it can wait.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Dialogue GUI/System

Post by Zini »

I'm working on the dialogue system ;) (the dialogue GUI is functional now)
Okay. Assigned the task to you.
I believe that is the way it is checked in Morrowind, at least in scripts. The functions GetHealth and GetHealthGetRatio are used.
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.
User avatar
pvdk
Posts: 528
Joined: 12 Aug 2011, 16:34

Re: Dialogue GUI/System

Post by pvdk »

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.
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.
User avatar
hircine
Posts: 157
Joined: 06 Aug 2011, 07:18

Re: Dialogue GUI/System

Post by hircine »

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.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Dialogue GUI/System

Post by Zini »

giving it, its health back via the setav or similiar commands does nothing
That part is interesting. Does nothing as in:

a) doesn't resurrect him

or as in:

b) doesn't restore his health

?
Post Reply