About: NPC spawn's laying down and kneeling   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Spawning an NPC in praying or just about any other action is simple. To spawn them in praying, simply add the script below to the bottom of the NPC's OnSpawn script. This one is set to 90000 Sec., which should be long enough for the NPC to stay there until interupted. ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP,1.0,90000.0); A PC clicking on the NPC will make them get up, or you can use anouther script to send a ClearAllActions() to the NPC. To make them go back to kneeling, issue that same line in a script. NOTE: You may need to use AssignCommand() with it.

AttributesValues
rdfs:label
  • NPC spawn's laying down and kneeling
rdfs:comment
  • Spawning an NPC in praying or just about any other action is simple. To spawn them in praying, simply add the script below to the bottom of the NPC's OnSpawn script. This one is set to 90000 Sec., which should be long enough for the NPC to stay there until interupted. ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP,1.0,90000.0); A PC clicking on the NPC will make them get up, or you can use anouther script to send a ClearAllActions() to the NPC. To make them go back to kneeling, issue that same line in a script. NOTE: You may need to use AssignCommand() with it.
dcterms:subject
abstract
  • Spawning an NPC in praying or just about any other action is simple. To spawn them in praying, simply add the script below to the bottom of the NPC's OnSpawn script. This one is set to 90000 Sec., which should be long enough for the NPC to stay there until interupted. ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP,1.0,90000.0); A PC clicking on the NPC will make them get up, or you can use anouther script to send a ClearAllActions() to the NPC. To make them go back to kneeling, issue that same line in a script. NOTE: You may need to use AssignCommand() with it. To Spawn them sleeping is just as easy; getting them to wake up is another story. Add this script to the bottom of the NPC's OnSpawn script: effect eSleep = EffectSleep(); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSleep,OBJECT_SELF); Now, to get them to wake up, loop through the effects, look for the Sleep effect, and then remove it. You can wake them up anyway you want, and the scripting is similar, but I will do this in a Trigger near the NPC. When the PC enters the Trigger, the NPC will wake up. This is just basic; you could add it to the OnPerception and make a Skill check to see if the NPC "hears" the PC. Put this script in a Trigger neer the NPC and Replace "NPC_TAG" with that of the actual NPC. Make sure the TAG is unique. void main() { if(!GetIsPC(GetEnteringObject()))return; object oNPC = GetObjectByTag("NPC_TAG"); effect eSleep = GetFirstEffect(oNPC); while(GetIsEffectValid(eSleep)) { if(GetEffectType(eSleep) == EFFECT_TYPE_SLEEP) { RemoveEffect(oNPC,eSleep); } eSleep = GetNextEffect(oNPC); } } That's also the basics on how to remove any effect. RemoveEffect() alone won't do it. Unless you use some kind of a hak-pack. you won't be able to get the NPC to sleep on a bed. You can, however, get them to sleep on top of a bedroll.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software