Jump to content

[LE] Quick Questions, Quick Answers


Recommended Posts

 

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

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 by wormple12
Link to comment
Share on other sites

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

 

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

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 by wormple12
Link to comment
Share on other sites

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

 

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

 

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 99

Alias: Optional, Allow Reuse in Quest

Find Matching Reference: In Loaded Area, Closest

Conditions: Target HasMagicEffectWithKeyword (specific keyword added by effect) == 1

Alias Package Data: new sleep package

 

New Sleep Package:

Name Type Value Public

Sleep Location Location Near editor location, radius 500 Y

Search 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...