Modyfing ActiveMagicEffect variables from outside

Post » Mon May 13, 2013 3:34 pm

Is that possible? I couldnt ever set ActiveMagicEffect script as property and now I'm back to this topic.

Thanks.

User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Mon May 13, 2013 1:49 pm

Can you be a bit more specific about what you're trying to do? I'm assuming the reason why you can't set an ActiveMagicEffect proprerty is due to the fact that each magic effect applied gets its own unique ActiveMagicEffect instance.

User avatar
Chrissie Pillinger
 
Posts: 3464
Joined: Fri Jun 16, 2006 3:26 am

Post » Mon May 13, 2013 7:54 am

Well, mojo22, its good its you actually. I'm trying to find ActiveMagicEffect instance the similar way you find alias script instances in example here: http://www.gamesas.com/topic/1458562-referencealias-oninit-onreset-triggers/ - but other way around.

I would be casting "ActiveMagicEffect's" from Alias script OnSelf (in sense of same actor), then I want an ActiveMagicEffect script to modify ReferenceAlias scripts properties and have access to its functions.

[edit] Ok, I messed up an above description...

ActiveMagicEffect script would modify ReferenceAlias script

and ReferenceAlias script have "access" to ActiveMagicEffect <- two way communication basically

Is that possible with ActiveMagicEffects at all?

User avatar
jasminĪµ
 
Posts: 3511
Joined: Mon Jan 29, 2007 4:12 am

Post » Mon May 13, 2013 5:22 pm

Ok still not entirely sure what shenanigans you're up to from your description, but I believe this communication is in fact possible :smile:. I just did a quick test before reading your post. I set up a quest and an ability, and allowed the quest to communicate with the activemagiceffect attached the ability that I add to the player.

Scriptname _Test_QuestChangeScript extends Quest  _Test_AMEChangeScript Property kAME Auto ;initially none - but will get filled when the ActiveMagicEffect is appliedEvent OnInit()    RegisterForSingleUpdate(5.0)endEventEvent OnUpdate()    if kAME        kAME.fCoolFloat = 7.7        Debug.Notification("We changed the AME float to "+kAME.fCoolFloat)    else        Debug.Notification("No AME detected")    endIf    RegisterForSingleUpdate(5.0)endEvent

Scriptname _Test_AMEChangeScript extends activemagiceffect  float Property fCoolFloat Auto_Test_QuestChangeScript Property _Test_QuestAMEChanger Auto ;links to the quest script so we can tell it what ActiveMagicEffect instance to manipulateEvent OnEffectStart(Actor akTarget, Actor akCaster)    _Test_QuestAMEChanger.kAME = selfendEventEvent OnEffectFinish(Actor akTarget, Actor akCaster)    _Test_QuestAMEChanger.kAME = NoneendEvent

This method should work for you assuming my testing method was correct. Upon launching Skyrim, I got the repeating messages stating that no AME was detected. Then after adding the ability, I got the message stating that it detected the AME and successfully returned 7.7 for the float value.

User avatar
carly mcdonough
 
Posts: 3402
Joined: Fri Jul 28, 2006 3:23 am


Return to V - Skyrim