candlepin Posted April 7, 2018 Share Posted April 7, 2018 Next question: :smile: I'm trying to script getting an actor to go to sleep and, so far, this works well by having them activate an invisible bedroll. The issue I'm running into is that I can't figure out how to wake them up. I've tried finding an answer to this on the CK wiki and various forums, to no avail. Any help is, as always, appreciated.Have you tried getting them to activate the bed again? Doh! The thought hadn't even crossed my mind that that would work. But, in fact, it works perfectly! Many thanks, good sir! Link to comment Share on other sites More sharing options...
candlepin Posted April 7, 2018 Share Posted April 7, 2018 After further testing it seems this approach only works for the player, not NPCs. For some reason I can't seem to get NPCs to activate the bed in the first place. :/ Link to comment Share on other sites More sharing options...
TheWormpie Posted April 7, 2018 Share Posted April 7, 2018 (edited) After further testing it seems this approach only works for the player, not NPCs. For some reason I can't seem to get NPCs to activate the bed in the first place. :/Use aliases and sleep packages instead. Condition the package so that it only runs at the specific circumstances you want, then run EvaluatePackages() on the actor in question when you want it to start. EDIT: Or better than using conditions and EvaluatePackages - just put the sleep package in a scene and Start() that scene. Edited April 7, 2018 by wormple12 Link to comment Share on other sites More sharing options...
napagokcc Posted April 7, 2018 Share Posted April 7, 2018 Please ..! I need kind a tutorial to change the appearence of NPC using presets ... Or maybe it's impossible at all ..? Link to comment Share on other sites More sharing options...
RichWebster Posted April 7, 2018 Share Posted April 7, 2018 Please ..! I need kind a tutorial to change the appearence of NPC using presets ... Or maybe it's impossible at all ..?If you mean create an NPC using the character creator presets in the game the easiest way is probably to load up the game and make that character, export the data and import it into the CK. https://forums.nexusmods.com/index.php?/topic/572037-character-face-export/ Link to comment Share on other sites More sharing options...
napagokcc Posted April 7, 2018 Share Posted April 7, 2018 Please ..! I need kind a tutorial to change the appearence of NPC using presets ... Or maybe it's impossible at all ..?If you mean create an NPC using the character creator presets in the game the easiest way is probably to load up the game and make that character, export the data and import it into the CK. https://forums.nexusmods.com/index.php?/topic/572037-character-face-export/ Thank you very much Link to comment Share on other sites More sharing options...
TheWormpie Posted April 8, 2018 Share Posted April 8, 2018 (edited) Is it possible to receive an event when the player has mined an ore somehow? There's OnStoryAddToPlayer, but none of the aiAcquireTypes seems to fire on this kind of action. Otherwise, a related question: When the player mines an ore, does he actually equip a pickaxe (so that I can call GetEquippedWeapon or something like that), or is it all handled around such functionality via animations? ... and otherwise, a third related question: If I'm to use some work-around method involving Animation Events, can someone help me find the name of a mining animation that I can register for? Edited April 8, 2018 by wormple12 Link to comment Share on other sites More sharing options...
RichWebster Posted April 8, 2018 Share Posted April 8, 2018 Is it possible to receive an event when the player has mined an ore somehow? There's OnStoryAddToPlayer, but none of the aiAcquireTypes seems to fire on this kind of action. Otherwise, a related question: When the player mines an ore, does he actually equip a pickaxe (so that I can call GetEquippedWeapon or something like that), or is it all handled around such functionality via animations? ... and otherwise, a third related question: If I'm to use some work-around method involving Animation Events, can someone help me find the name of a mining animation that I can register for? You might be able to do something with registering for an animation event. The one when you exit mining the floor is IdlePickaxeFloorExit, and I think the enter one is IdlePickaxeFloorEnter. Look at MineOreFurnitureScript for the exit ones. What you could probably do is just script to register each time the player starts mining, and then start tracking OnItemAdded for ore items. Link to comment Share on other sites More sharing options...
TheWormpie Posted April 8, 2018 Share Posted April 8, 2018 Is it possible to receive an event when the player has mined an ore somehow? There's OnStoryAddToPlayer, but none of the aiAcquireTypes seems to fire on this kind of action. Otherwise, a related question: When the player mines an ore, does he actually equip a pickaxe (so that I can call GetEquippedWeapon or something like that), or is it all handled around such functionality via animations? ... and otherwise, a third related question: If I'm to use some work-around method involving Animation Events, can someone help me find the name of a mining animation that I can register for? You might be able to do something with registering for an animation event. The one when you exit mining the floor is IdlePickaxeFloorExit, and I think the enter one is IdlePickaxeFloorEnter. Look at MineOreFurnitureScript for the exit ones. What you could probably do is just script to register each time the player starts mining, and then start tracking OnItemAdded for ore items. That was more or less what I was thinking, thanks :) Link to comment Share on other sites More sharing options...
candlepin Posted April 8, 2018 Share Posted April 8, 2018 After further testing it seems this approach only works for the player, not NPCs. For some reason I can't seem to get NPCs to activate the bed in the first place. :/Use aliases and sleep packages instead. Condition the package so that it only runs at the specific circumstances you want, then run EvaluatePackages() on the actor in question when you want it to start. EDIT: Or better than using conditions and EvaluatePackages - just put the sleep package in a scene and Start() that scene. Tried this and I'm still having some trouble getting it to work. I tried doing this via the alias/sleep package route, since I want to be able to do this with multiple NPCs at the same time and wasn't sure if that would be easy/possible via a scene (I also have zero experience with scenes and they frankly seem daunting...). Then again, I've only done a little bit of work with quest aliases and basically nothing with behavior packages, so hopefully you or someone else can bear with me. Here's how I set up the Quest Alias and the Sleep Package: Quest alias:New quest, Start Game Enabled, Priority 99Alias: Optional, Allow Reuse in QuestFind Matching Reference: In Loaded Area, ClosestConditions: Target HasMagicEffectWithKeyword (specific keyword added by effect) == 1Alias Package Data: new sleep package New Sleep Package:Name Type Value PublicSleep Location Location Near editor location, radius 500 YSearch Criteria Target Selector MyInvisibleBedroll Y (plus a few more, but it's basically a clone of the standard sleep package) Script attached to the magic effect:OnEffectStart Bedroll = akCaster.PlaceAtMe(InvisibleBedroll) ; akCaser is correct, checked via DebugNotification akCaster.EvaluatePackage()OnEffectFinish akCaster.EvaluatePackage() ; will they automatically reevaluate their package once effect is gone? Bedroll.Delete() I feel like I made a simple mistake here, but I'm just not familiar enough with this stuff to figure it out. Maybe attach a script to the quest alias that runs EvaluatePackage? But, if so, what sort of event would that be under? OnInit? As always, any help is appreciated! Link to comment Share on other sites More sharing options...
Recommended Posts