Scripts on Perks: Some clarification...

Post » Mon Nov 19, 2012 1:21 am

So I see that in addition to the various entry points and methods on Perks the window has a section for Papyrus Scripts as well. This leads me to question the behavior of these attached scripts.

My intuition tells me they likely behave as any other constant effect spell script. If the player has the perk, the script is constantly applies.

I found myself questioning that behavior however, when it came to using it in conjunction with certain entry points. It almost seemed logical at some point to assume they might apply when the conditions of that entry point (and any defined conditions for it) were met.

For example, a perk set to mod spell magnitude of the player's spells when a target they are attacking was friendly, would only apply the script when the player cast a spell and hit a target that was friendly. Make sense?

I am just curious now if anyone can state definitively what is the behavior of these scripts, otherwise that will be one more thing on what is now shaping up to be a depressingly long list of trial and error sessions in the path of my next major modding endeavor.
User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm

Post » Sun Nov 18, 2012 12:02 pm

Are you talking about this:
http://www.creationkit.com/Perk_Fragments

Or the scripts that are attached directly to the perk itself?

I would imagine the perks attached directly to the script just run when the perk is active, but that doesn't seem particularly useful.

Actually, neither really seem useful since the fragments extend the perk script...
User avatar
Rob Smith
 
Posts: 3424
Joined: Wed Oct 03, 2007 5:30 pm

Post » Mon Nov 19, 2012 12:00 am

For example, a perk set to mod spell magnitude of the player's spells when a target they are attacking was friendly, would only apply the script when the player cast a spell and hit a target that was friendly. Make sense?
I doubt it.

I have always assumed that the script would "always" fire, but if there were conditions on it that were not met, it would fail to affect the target.

I guess the use of debug.messagebox would tell you if and when the thing was firing?

(I do not know for certain, just my assumption from the way other similar things in CK/Game seem to work. Maybe Justin, or one of the other leet-coders on here knows for sure??).
User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm

Post » Sun Nov 18, 2012 10:55 am

Scripts don't just happen, they almost always respond to events.

So, the question you really need to have answered is "what events will a perk receive."

Answer: I have no idea. But a perk will not receive "OnEffectStart." If the perk's entry is an Ability, that ability will receive that event, but you'd need to attach your script to the ability, not the perk.
User avatar
Amanda savory
 
Posts: 3332
Joined: Mon Nov 27, 2006 10:37 am

Post » Sun Nov 18, 2012 7:49 pm

First, there are not the fragments and the attached scripts. The attached script are the fragments merged together (similar to what happens with the fragments of a quest stages that can be found merged together in the ques script tab).

Second, each fragment is only executed when the perk entry conditions are meet and the script dissapear from the NPC (you won't see it if you use the SV console command on the NPC) when not.
User avatar
Kayla Oatney
 
Posts: 3472
Joined: Sat Jan 20, 2007 9:02 pm

Post » Sun Nov 18, 2012 9:54 pm

First, there are not the fragments and the attached scripts. The attached script are the fragments merged together (similar to what happens with the fragments of a quest stages that can be found merged together in the ques script tab).

Second, each fragment is only executed when the perk entry conditions are meet and the script dissapear from the NPC (you won't see it if you use the SV console command on the NPC) when not.

Did you test that or did you just read this?
"With the current design, NPCs won't run activate entry point perk entries"

Because it seems like it used to be that way, but recently I've made some entry point perks (not with script fragment, but with other effects) and they worked on NPCs.
User avatar
Kat Stewart
 
Posts: 3355
Joined: Sun Feb 04, 2007 12:30 am

Post » Mon Nov 19, 2012 12:00 am

Did you test that or did you just read this?
"With the current design, NPCs won't run activate entry point perk entries"

Because it seems like it used to be that way, but recently I've made some entry point perks (not with script fragment, but with other effects) and they worked on NPCs.
I tested it (well at this point, more than testing I would say I'm using it). Anyway, I was not talking about NPCs not running activate entry points (something that indeed I'm doing), I was talking about scripts from perks being removede from the perk owner while the entry point conditions aren't meet.
User avatar
Lory Da Costa
 
Posts: 3463
Joined: Fri Dec 15, 2006 12:30 pm


Return to V - Skyrim