Jump to content

[RESOLVED] Self Test Spell Casts Repeatedly


Recommended Posts

Posted (edited)

Sorry to come up with a new question so quickly. I've made a lot of headway with a mod I've been working on, but I'm getting a little stuck again.

 

So a good few years ago, a forum member had helped me with a simple mod that applied an overlay effect onto a character who had been spanked via an animation. Back then, I was too overwhelmed to dissect the mod and take it further, though it was pretty neat. Now I've returned to it and updated it slightly, but I've run into a bit of a snag.

 

Inside the mod, there was a test spell that could be cast onto an NPC, and it would trigger the effect. It was mostly so I could play about with the timing to affect the progress of the effects. However, looking at the actual files, that test spell used one of the main effects than the test effect. 

 

I have updated and played about with the forms to create a new test spell (SPEL) and Magic Effect (MGEF), but one that I can cast on myself as the player. I felt this would be easier because I could easily remove my character's clothes and see what was happening underneath. However, when I cast the spell, I get a very odd issue where it seems like it is casting itself repeatedly, even if I cast it once. I can see the effect marker on the right hand of the screen fading in repeatedly.

 

I've looked at MatchMaker, which does the same, but I couldn't see anything I was doing differently. So I'm wondering if there is something fundamental I'm missing.

 

The three files are:

spelllsandeffects.png

 

The spell configuration:

spellconfig.png

 

The Magic Effect configuration:

spellmagiceffect.png

 

The script shows the Debug message:

Scriptname RYDB_SpankTestSpell extends activemagiceffect  

Event OnEffectStart(Actor akTarget, Actor akCaster)
	SelfSpankTestSpell.cast(akTarget, akTarget)
	debug.notification("Casted on " + akTarget.getDisplayName())
endEvent

Spell Property SelfSpankTestSpell Auto

 

Thanks for any advice. :D

Edited by rydin
Marking as resolved
  • rydin changed the title to Self Test Spell Casts Repeatedly
  • 2 weeks later...
Posted (edited)

Sometimes there is information attached to certain things that you can't see or change. Try to use a vanilla effect and just changed the script. For example duplicate SprigganCallEffect and rename (or something like this). Simply replace the script with your own and remove the requirements. That might solve your problem.

 

Ps: when you want to do something to the player characters it is much easier to use the function Game.GetPlayer()

Edited by DarkBlade13
Posted
11 hours ago, DarkBlade13 said:

Sometimes there is information attached to certain things that you can't see or change. Try to use a vanilla effect and just changed the script. For example duplicate SprigganCallEffect and rename (or something like this). Simply replace the script with your own and remove the requirements. That might solve your problem.

 

Ps: when you want to do something to the player characters it is much easier to use the function Game.GetPlayer()

 

Thanks. I'll give this a go. :)

Posted
On 8/20/2023 at 11:03 PM, rydin said:
Scriptname RYDB_SpankTestSpell extends activemagiceffect  

Event OnEffectStart(Actor akTarget, Actor akCaster)
	SelfSpankTestSpell.cast(akTarget, akTarget)
	debug.notification("Casted on " + akTarget.getDisplayName())
endEvent

Spell Property SelfSpankTestSpell Auto

 

I am assuming the Property SelfSpankTestSpell points to the spell itself, doesn't that make this recursive? As in when the effect starts, the spell gets casted again and then the effectstart event gets triggered again.

Posted

Thank you @wareware and @DarkBlade13. Just by removing the second line where the spell is recast, I got the desired action to have a debug notice, and the spell runs to natural completion. This allows me to move forward and work better at getting this mod right. Much appreciated for your help!!

  • rydin changed the title to [RESOLVED] Self Test Spell Casts Repeatedly

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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