Jump to content

Scripting basics?


NanakoMagojiro

Recommended Posts

Hi everyone. I'm an experienced coder from other OOP languages, so i don't feel i'll have much trouble with papyrus, but i'm just getting started with it.

 

I've been looking over the events list on the creationkit wiki, and i can't seem to find event hooks for the things i want to check.

 

i'd like to run code when:

 

-The object (a weapon) is sheathed or unsheathed (NOT just when it's equipped)

-The actor holding this weapon starts/stops blocking (regardless if anything is hitting them)

 

Also, i've not really worked with something like onHit before, but i get the idea of how it works. Is it possible to use that to, for instance, reduce or prevent damage from a blow that would otherwise kill the actor ?

Link to comment
Share on other sites

Papyrus seems to have a lot less functions that the Oblivion scripting language, so I'm really looking forward to the release of SKSE.

 

Back to what you need, a way to tell when a weapon is sheathed or unsheathed. You can check this thread by kuertee. So you just need to have a magic effect script which will set some variables or run functions on your real script, and have the effect it's attached to only run with the conditions "IsWeaponOut" pr "IsBlocking". Make sure that you set the conditions in the spell window, not magic effect window though. For some reason, the latter doesn't work for me.

Link to comment
Share on other sites

SKSE is already out? The SkyUI mod requires it, and i have it installed already o.o

 

that implementation for my problem seems extremely fiddly and counterintuitive. is there a way to create and dispatch custom events ? Failing that, even when the appropriate variable is set, how is my weapon script going to know that it has changed?

 

my application for the blocking, specifically, would require things to be pretty instant in terms of performance.

Link to comment
Share on other sites

SlowdownStrikeScript.psc

 

There's an IsBlocking implementation in there that's ready-rolled from Beth.

 

There's might also the possibility of using registerForAnimationEvent() to roll your own custom kind of event.

The trouble is there's currently not much known about what names are used or valid.

Link to comment
Share on other sites

No, SKSE with Papyrus functionality isn't out yet, but according to the thread, it shouldn't be long.

 

I hadn't considered the delay with using those conditionals. In my experience, using magic effects with conditionals have 0.5 to 1 second delay time.

 

Go with tunaisafish's suggestion and use RegisterForAnimationEvent(). I just tried some out, and I think these are the ones you need:

 

RegisterForAnimationEvent(akTarget, "WeaponDraw")
RegisterForAnimationEvent(akTarget, "WeaponSheathe")
RegisterForAnimationEvent(akTarget, "BlockStartOut")
RegisterForAnimationEvent(akTarget, "BlockStop")

Link to comment
Share on other sites

  • Recently Browsing   0 members

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