Aller au contenu

Photo

How do I start an NPC laying on the ground until healed?


  • Veuillez vous connecter pour répondre
14 réponses à ce sujet

#1
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
This seems like it should be easy, but I'm having trouble finding how to do it.

I want to start an NPC laying on the ground (deadish) until the PC examines and heals him.

Any suggestions?

Thanks!

#2
Phaenan

Phaenan
  • Members
  • 315 messages
Hmm.

Never did that myself so I'm just throwing guesses, but maybe a simple custom core to the creature using the YadayadaSPAWN and the click/use events ? The spawn part should be able to force the npc into a laying animation.

What I'm not sure of, off the top of my head, is the healing part provided you meant "heals him through magic".

#3
Nattfodd

Nattfodd
  • Members
  • 321 messages
You have to set the ambient behaviour of the NPC. Into the area editor, place it in the point you need, then access its properties into the object inspector. You have to choose the field "variables" and a window will pop up. Browse variables and locate the AMBIENT_ANIM_PATTERN; here insert the number of the aniomations listed into ambient_ai.xls you want the NPC to perform (in your case i think the number 17, i don't know if you want it unconscious or not). Then type 19 into the variable AMBIENT_SYSTEM_STATE (this tells the game to start the ambient system as soon as the NPC spawns).



For examinations and healing i think you can set a dialog with the NPC.

#4
Eshme

Eshme
  • Members
  • 756 messages
I think of examples from the game. There are in the Korkari wilds, the wounded soldier. And in Brecilian forest the wounded dale. Perhaps u find examples from those? I cant tell myself

#5
Craig Graff

Craig Graff
  • Members
  • 608 messages
Check the variables on pre200cr_dying.utc if you want to see what was done for the dying soldier in the wilds.

#6
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
Thanks for all the responses.



I see the variables that make the dying soldier lay down (AMBIENT_ANIM_PATTERN = 17 and AMBIENT_SYSTEM_STATE = 15), and I see the plot and script associated with the soldier, but I don't see how he gets up. How do I change these values to make the NPC be standing whenever he is encountered again after he is healed?


#7
Craig Graff

Craig Graff
  • Members
  • 608 messages
Give him a new AMBIENT_ANIM_PATTERN from ambient_ai.xls with Ambient_Start (something like 2 should work).

(Edited to correct the function call to the more standardized method.)

Modifié par Craig Graff, 14 février 2010 - 01:19 .


#8
Baracuda6977

Baracuda6977
  • Members
  • 353 messages
my guess is the wounded soldier stands up as a dialogue scripted action, simply store a plot flag or something to determine if he is standing or laying

#9
Phaenan

Phaenan
  • Members
  • 315 messages

Craig Graff wrote...
Give him a new AMBIENT_ANIM_PATTERN from ambient_ai.xls with SetLocalInt (something like 2 should work).


Just for future reference, aren't we to use Ambient_OverrideBehaviour() and such to alter ambient behaviour on the go ? The 2DA comments say so, but since they're not always up to date, I'm just making sure. :?

Modifié par Phaenan, 14 février 2010 - 01:02 .


#10
Craig Graff

Craig Graff
  • Members
  • 608 messages
Yes, that's the proper way. Although that's really only if you want to be able to return to the base behavior - if you want a new default, you should use Ambient_Start to replace the original.

#11
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
Just out of curiosity, does anybody know what AMBIENT_SYSTEM_STATE = 15 does?



The wiki only lists up to 10 (sorry, make that 16 because the wiki says the values are in hexadecimal - it doesn't list the hex equivalent of 15).

#12
Phaenan

Phaenan
  • Members
  • 315 messages
The wiki says 1, 2, 4, 8, 16, so I'd say it has a definite bitfield feel. Basically you can prolly combine, and 15 may well be 1+2+4+8 :o

Modifié par Phaenan, 14 février 2010 - 01:30 .


#13
PavelNovotny

PavelNovotny
  • Members
  • 344 messages

Craig Graff wrote...

Give him a new AMBIENT_ANIM_PATTERN from ambient_ai.xls with Ambient_Start (something like 2 should work).


So, do I do this from within the plot script like this:

            case HEAL_WOLFMIER:   // Wolfmier stands up when healed.
            {
                SetLocalInt(oConversationOwner, AmbientAnimPattern, 2);  

                break;
            }
 
Or do I do something else using Ambient_Start? I'm not sure how Ambient_start fits in.

The goal is to make it so that once the character is healed he always starts out with the ambient relaxed (standing).

Thanks!

#14
Phaenan

Phaenan
  • Members
  • 315 messages
If I understood correctly, you won't need Ambient_Start() if you want to permanently change the NPC behaviour. So a SetLocalInt(oNPC, "AMBIENT_ANIM_PATTERN", 2) should work, even you may have to wait until the NPC ends his/her current animation set before the new pattern actually kicks in.

#15
Nattfodd

Nattfodd
  • Members
  • 321 messages

Phaenan wrote...

If I understood correctly, you won't need Ambient_Start() if you want to permanently change the NPC behaviour. So a SetLocalInt(oNPC, "AMBIENT_ANIM_PATTERN", 2) should work, even you may have to wait until the NPC ends his/her current animation set before the new pattern actually kicks in.


You are right, but i read on toolset wiki that it's better to use the Ambient_*() functions.
social.bioware.com/wiki/datoolset/index.php/Ambient_behaviour