dizietemblesssma Posted April 9, 2020 Share Posted April 9, 2020 Hi,I'm trying to test something and it involves a spell which is cast when entering a cell. For debugging purposes the two scripts I'm using have been reduced to: Scriptname dz_location_finder Extends ObjectReference Event OnCellAttach() Actor PlayerRef = Game.GetPlayer() Spell dz_get_location debug.notification("Casting location spell") dz_get_location.Cast(PlayerRef,PlayerRef) EndEvent Scriptname WhereAmI Extends MagicEffect Actor Property PlayerRef Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ;/ ;;find location Keyword LocTypeHabitation ;ObjectReference PlayerRef = Game.GetPlayer() Location playerLoc = PlayerRef.GetCurrentLocation() Bool Habit ;;add to variable If playerLoc.HasKeyword(LocTypeHabitation) Habit = True Else Habit = False EndIf /; debug.notification("Habitation") EndEvent I get the first debug notification - "Casting location spell", but no matter what options I choose for the magic effect and the spell in the creation kit; I cannot get the debug notification "Habitation" to fire. The first script is attached to a trigger box just inside the Solitude gate (only because I know that OnCellAttach will work with that).The second is used to make a magic effect which inturn is used for a spell. I'd dearly loive to know where I'm going wrong here. diziet Link to comment Share on other sites More sharing options...
dylbill Posted April 9, 2020 Share Posted April 9, 2020 Your second script needs to extend ActiveMagicEffect , not MagicEffect. Link to comment Share on other sites More sharing options...
dizietemblesssma Posted April 10, 2020 Author Share Posted April 10, 2020 Your second script needs to extend ActiveMagicEffect , not MagicEffect.Wow! :)Thankyou, didn't realise you could make mistakes there and still compile, so never thought to look!However. now I can only get the "Habitation" message once every load i.e as soon as the game loads, even if that is into an interior cell that isn't in Solitude. The "Casting location spell" still happens everytime when entering Solitude so I think it's about the options for magic effect and spell in the CK. Any ideas? diziet Link to comment Share on other sites More sharing options...
dizietemblesssma Posted April 11, 2020 Author Share Posted April 11, 2020 I got this to work. after much experimentation. Amongst other things the keyword has to be set as a property in the CK or else it is never found on/in the location. Link to comment Share on other sites More sharing options...
Recommended Posts