Jump to content

[LE] How do I make a 'concentration' type magic effect?


Recommended Posts

I have seen a ton of tutorials on 'fire and forget' but I don't understand how concentration works.

 

at the moment I am trying to make a magic effect that uses the magnitude as a percentage of the target's max health and heal or damage over time.

this is the code I have currently working.

Actor caster

Event OnEffectStart(Actor akTarget, Actor akCaster)
    caster = akCaster
    RegisterForSingleUpdate(0.0167)
EndEvent

Event OnUpdate()
    Float value = self.GetMagnitude() / 100 * 0.0167
    Action(caster,value)
    RegisterForSingleUpdate(0.0167)
EndEvent

the problem I have is that if I set 'RegisterForSingleUpdate' to 1 it is really staggered and doesn't feel that good or as nice to use as other concentration spells.

I set it 0.0167 because I figure that skyrim being capped at 60fps and setting the interval to 1/60 it would effectively enough run every frame and then I would normalise the 'value' by that delta to make it apply the 'action' over time making it smooth.

but it doesn't work the action applies to small. even then Magnitude is set to 10

 

is there a way to make this work like healing?

 

for example using papyrus can you make a healing spell that works identically to the one already in the game, but using custom magic effect?

and what would the code look like so I could use it as a reference.

 

I appreciate any help on this, and thank you in advance.

 

 

 

Link to comment
Share on other sites

Concentration spells are flagged as concentration rather than fire and forget. Take a look at the flames or sparks spells to see how they are set up. Both are concentration spells.

 

While papyrus can do many things that are handled by other aspects of the game engine, it is not always a viable replacement. You want a custom healing spell with custom magic effect? Duplicate the existing spell and effect and modify them as you desire. No need to mess with papyrus.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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