Jump to content

Conditions on abilities/spells


Recommended Posts

@ Rasikko


Oh man... don't think that i was bothered by it !!.

It's a shame that one can not put on a written post his writing mood, i just meant that i still have a lot to learn, as we all do until the day we all go to Sovngarde...


Thanks again.

Link to comment
Share on other sites

If you want to at least get a handle on optimizing your scripts, something you have control over, then I could suggest making use of Debug.StartStackProfiling()/StopStackProfiling(), and see if your scripts are too slow (I usually try to get mine under 1s), it's in milliseconds, so you'll need to convert to seconds. It will tell you what functions are making other functions "wait" (queuing) and how long this wait is(for example, pretty much any function that returns a reference is gonna take time to return). The beauty of papyrus is that you don't necessarily need to put everything in one script, slower operations can be called elsewhere - running in parallel.

Ok, thanks, I'll try comparing using this. :smile:

 

 

diziet

 

Link to comment
Share on other sites

Adding here for anyone reading:

 

using the following testscript:

scriptname testscript extends Activemagiceffect


Event OnEffectStart(Actor Target, Actor Caster)

debug.messagebox("effect starting")



EndEvent
Event OnEffectFinish(Actor Target, Actor Caster)

debug.messagebox("effect finishing")

EndEvent

and using the 'getcombatstate' condition,

 

I was unable to get the debug message boxes when placing a condition on the magiceffect like this:

 

 

but if I create the ability/spell using the effect and add the condition there:

 

 

then whenever I enter or exit combat i get the messages, demonstrating that conditions on abilities/spells can generate oneffectstart/finish events as the conditions come and go; which was a query I had ealier. I also double checked each time the effect finished that the abilty was no longer listed in the magic menu and that was infact the case. Whenever combat started, the ability was listed again.

Link to comment
Share on other sites

then whenever I enter or exit combat i get the messages, demonstrating that conditions on abilities/spells can generate oneffectstart/finish events as the conditions come and go; which was a query I had ealier. I also double checked each time the effect finished that the abilty was no longer listed in the magic menu and that was infact the case. Whenever combat started, the ability was listed again.

 

 

 

well, it seems I spoke to soon, everything I said in my previous post is true... for the player. For my follower, nada, I can give the NPC the spell with the ablity effect and in the console 'hasspell' shows she has the spell, but at no point does she ever get the effect. if I give myself the spell, I get the effect when in combat.

I've been reading around and I can't find anything suggesting that the isincombat or getcombatstate conditions don't work for NPcs so I'm stumped.

At the moment all the effect does is display a message that the effect is starting or stopping, as above.

Any help please?

 

edit: my apologies, turns out that my problem is not conditions, but the magic effect dispelling on a worldspace change, at least if I give Serana the spell in Whiterun and run in and out of Breezehome the effect stays (checked in console and with the FX aura) but if I fast travel or exit the Whiterun gates; Serana loses the magic effect, though she keeps the spell. This does not happen for the player, which is why I did not pick up on it straight away.

Still bugging me, but I think it may be a script issue.

 

edit2: I don't think it is a script issue after all, with the most basic of scripts made into an ability:

scriptname testscript extends Activemagiceffect


Event OnEffectStart(Actor Target, Actor Caster)

debug.messagebox("effect starting")



EndEvent
Event OnEffectFinish(Actor Target, Actor Caster)

debug.messagebox("effect finishing")

EndEvent

and given to both player and follower in the console while in Whiterun; upon exiting the Whiterun gates, the OnEffectFinish messagebox fires, once.

Using the console to check, the player still has the ability but the follower does not - hence the OnEffectFinish event.

I have a horrible feeling that this is either a Skyrim bug or it's meant to be this way and I can't give a follower a permanent ability (at least till I want to remove it!)

 

 

diziet

Link to comment
Share on other sites

Is this linked to actors resetting when the cell they belong to resets?

I'm not sure I would know, do cells reset each time fast travel or worldspace change happens?

 

To maybe get around this I'm wondering if there is a way to get the OnEffectFinish event to reapply the spell/magiceffect? If the event had a 'wait then action' command, would the wait and command happen after the game registered the finish event and 'removed' the ability?

 

I did some googling and came across talk of reference aliases which I've never used and the caveat of persistence which I'm not sure I understand in reference to a follower.

 

 

diziet

Link to comment
Share on other sites

Give your npc a 'Perk' and let the perk handle the 'Ability / Spell'.

In order for the 'Ability / Spell' to be constant and to not be affected by 'OnCellDetach, OnCellAttach, OnUnload, OnLoad', the ability spell must be in its "Race".

Link to comment
Share on other sites

 

Give your npc a 'Perk' and let the perk handle the 'Ability / Spell'.
In order for the 'Ability / Spell' to be constant and to not be affected by 'OnCellDetach, OnCellAttach, OnUnload, OnLoad', the ability spell must be in its "Race".

 

Can perks be given/removed dynamically by script or do they have to be set in the creation kit? I ask because my ability is intended currently to be given by a spell to an NPC selected in an MCM menu, this menu can be filled with with any list (up to ten) of NPCs the player chooses.

 

diziet

Link to comment
Share on other sites

  • Recently Browsing   0 members

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