ActiveMagicEffect troubles

Post » Tue Jun 19, 2012 6:38 am

I am trying to fire a message from a magic effect, but it's not working. Am I not allowed to call certain functions from within this type of script?

My code is below. The message property is correctly filled, and the actual magic effect (which I omitted for brevity) works *perfectly* but I just can't fire messages... nor, it seems, can I register for updates (that fails too).

I've got two scripts I've tried to use.

(The spell is a version of the Vampiric Drain spell)


In this version, the message never, ever shows up.
Event OnEffectStart(Actor akTarget, Actor akCaster)     TVMTestingMsg.Show()     ;the rest of the spell code is here, and that works 100% as it shouldEndEvent;rest of the script does what it should



In this version, the message also does not ever show up.
Event OnEffectStart(Actor akTarget, Actor akCaster)     RegisterForSingleUpdate(1)     ;the rest of the effectstart script does exactly what it should, all the timeEndEventEvent OnUpdate()     TVMTestingMsg.Show()EndEvent


I am absolutely 100% dead certain that the message property is filled. I've checked it every single time I've compiled the script. But it *never* shows up even though the spell works in the game (I'm draining life, but no message!)

If I can figure out what I can and cannot do in this type of script, I'll be so much closer to finishing my mod (on another note: man, scope-creep is deadly).
User avatar
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm

Post » Tue Jun 19, 2012 6:22 am

I have had a messagebox show up in a spell script with no problem.
Are you sure you have the correct script attached to the magic effect?
Have you compiled the script?
User avatar
Fluffer
 
Posts: 3489
Joined: Thu Jul 05, 2007 6:29 am

Post » Mon Jun 18, 2012 11:26 pm

I have had a messagebox show up in a spell script with no problem.
Are you sure you have the correct script attached to the magic effect?
Have you compiled the script?

Yeah. It's very bizarre. I'm editing the script directly from the magic effect and I have compiled it after every change.

Where in the script do you fire your messages?
User avatar
djimi
 
Posts: 3519
Joined: Mon Oct 23, 2006 6:44 am

Post » Tue Jun 19, 2012 2:07 am

Since my message is a messagebox with two buttons, I am also getting the value of which button was pressed.

Message Property QuestionMSG  Auto Actor casterObjectReference casterRefint ButtonEvent OnEffectStart(Actor akTarget, Actor akCaster)caster = akCastercasterRef = (caster as ObjectReference)Button = QuestionMSG.Show()endEvent
User avatar
Oscar Vazquez
 
Posts: 3418
Joined: Sun Sep 30, 2007 12:08 pm

Post » Mon Jun 18, 2012 7:36 pm

I've had problems with messages bit showing up. No idea what fixed it though.
User avatar
Sarah Knight
 
Posts: 3416
Joined: Mon Jun 19, 2006 5:02 am

Post » Mon Jun 18, 2012 9:56 pm

Alrighty then. I'm going to go try again. I think I'm going to try doing it in different types of spells too.

This one is "concentration"

Edit: okay, so it works... but only if I trash the script and create an entirely new one with nothing else in it. As soon as I add the rest of the code, the message stops firing but the spell keeps working. I just... don't... get it. Oh well. It's a starting point.

Thanks for the replies - the confirmation that the messages do fire was very helpful!
User avatar
Nicholas
 
Posts: 3454
Joined: Wed Jul 04, 2007 12:05 am

Post » Tue Jun 19, 2012 7:54 am

I've been experimenting with some scripted spells also and have noticed some oddities.

Most recently I had a constant effect type spell that refused to give a Debug.Notification message in its OnEffectFinish event
(though the wiki says those events are dicey...so idk)

Is concentration the casting type of the spell in question?
User avatar
Joey Avelar
 
Posts: 3370
Joined: Sat Aug 11, 2007 11:11 am

Post » Tue Jun 19, 2012 7:11 am

Is concentration the casting type of the spell in question?

After I rebuilt from scratch, on the concentration spell, everything worked exactly as it should have. My own problem came from trying to add to an existing script -- I had copied Bethesda's code for the Vampire Drain vfx (the connecting line between actors) - and then dropped in some of my own and that was when things failed. In the end, I needed to keep my own script separate from that one, but both of them are on the effect (and everything works swimmingly).

I think these things just happen now and again and they are not specific to the type of spell.
User avatar
Nathan Barker
 
Posts: 3554
Joined: Sun Jun 10, 2007 5:55 am

Post » Mon Jun 18, 2012 11:44 pm

I have some general question about this spell GraniteDevil. You don't have to divulge any secret info, I'm just wondering because I've been trying to get a scripted concentration spell to work.

How are you utilizing the OnEffectStart/Finish events? Does the magic effect you're using have a duration?

I've been unable to do anything useful with my spell because its uses a 0 duration magic effect and the effect is over before any useful checks get run on it.
User avatar
Sarah Evason
 
Posts: 3507
Joined: Mon Nov 13, 2006 10:47 pm


Return to V - Skyrim