Elias555 Posted April 4, 2018 Author Share Posted April 4, 2018 Weird. The following ideas are probably not that good, but it's the best I can think of right now:1. In an OnInit event somewhere, register for the appropiate magic casting animation with RegisterForAnimationEvent (this only works though if you actually know who's going to use the spell, like if it's a player-only spell). If you're lucky you can catch the exact time the spell is used with OnAnimationEvent.2. Make your spell a self targeting scripted spell that casts the real spell via script OnEffectStart. This might throw a great number of new issues at you though...Thanks. I did think of those already. 1. is what I was leaning towards and scanning via perk but I'd prefer to find something else. 2. Visually looks bad for a projectile but functions fine for basic spells. Link to comment Share on other sites More sharing options...
RichWebster Posted April 4, 2018 Share Posted April 4, 2018 (edited) Weird. The following ideas are probably not that good, but it's the best I can think of right now:1. In an OnInit event somewhere, register for the appropiate magic casting animation with RegisterForAnimationEvent (this only works though if you actually know who's going to use the spell, like if it's a player-only spell). If you're lucky you can catch the exact time the spell is used with OnAnimationEvent.2. Make your spell a self targeting scripted spell that casts the real spell via script OnEffectStart. This might throw a great number of new issues at you though...Thanks. I did think of those already. 1. is what I was leaning towards and scanning via perk but I'd prefer to find something else. 2. Visually looks bad for a projectile but functions fine for basic spells.Edit: What if you make your spell totally scripted? Just have a script magic effect when the spell is cast, and then call Cast() on the target which is the projectile spell. Edited April 4, 2018 by B1gBadDaddy Link to comment Share on other sites More sharing options...
Elias555 Posted April 4, 2018 Author Share Posted April 4, 2018 Weird. The following ideas are probably not that good, but it's the best I can think of right now:1. In an OnInit event somewhere, register for the appropiate magic casting animation with RegisterForAnimationEvent (this only works though if you actually know who's going to use the spell, like if it's a player-only spell). If you're lucky you can catch the exact time the spell is used with OnAnimationEvent.2. Make your spell a self targeting scripted spell that casts the real spell via script OnEffectStart. This might throw a great number of new issues at you though...Thanks. I did think of those already. 1. is what I was leaning towards and scanning via perk but I'd prefer to find something else. 2. Visually looks bad for a projectile but functions fine for basic spells.Edit: What if you make your spell totally scripted? Just have a script magic effect when the spell is cast, and then call Cast() on the target which is the projectile spell. I'm not sure I follow. Do you mean FF, Self. Script casts the spell remotely and then I can call the check from the self targeted spell? That's what wormple was suggesting in his second point. Did you mean something else? Link to comment Share on other sites More sharing options...
RichWebster Posted April 4, 2018 Share Posted April 4, 2018 (edited) Essentially but you don't really need to check for the cast event in this scenario, because you're manually calling it in a script. You know when it happens. But you probably want target, not self. So you can cast the proper spell at the right target. Edited April 4, 2018 by B1gBadDaddy Link to comment Share on other sites More sharing options...
Elias555 Posted April 5, 2018 Author Share Posted April 5, 2018 (edited) Essentially but you don't really need to check for the cast event in this scenario, because you're manually calling it in a script. You know when it happens. But you probably want target, not self. So you can cast the proper spell at the right target.I went with an ability. It's not really working the way I want. Keyword Property MyKeyword Auto VisualEffect Property MyEffect Auto Event OnSpellCast(Form akSpell) Spell SpellCast = akSpell as Spell If SpellCast.HasKeyword(MyKeyword) Debug.Notification("That's a fire spell!") MyEffect.Play(Game.GetPlayer(), 3) EndIf EndEvent It compiles but doesn't fire when I use something like flames. The keyword is filled with MagicDamageFire which flames has. The Effect doesn't play either when tested without the keyword. Edit:I got the visual to play. I should have done more testing.It was working on a different event. Still need help on both. Edited April 5, 2018 by Elias555 Link to comment Share on other sites More sharing options...
candlepin Posted April 5, 2018 Share Posted April 5, 2018 (edited) Cooldowns on activators: Let me preface this with the fact that I haven't worked much with activators. I would like to create an activator that is placed in multiple locations throughout Skyrim (on the order of 10-20). The activator does what I would like it to do; it gives the player an item when activated. Here's what I've come up with, but I was wondering if anyone foresees a problem with this approach. Or if they know of a simpler or better way of doing it. I'm open to suggestions! The script: ObjectReference Property PlayerRef Auto Int Property TimerID Ingredient Property Ingred Bool TimesUp = 1 Event OnActivate(ObjectReference akActionRef) If TimesUp == 1 TimesUp = 0 PlayerRef.AddItem(Ingred) StartTimer(86400, TimerID) ; 86400 seconds = 1 day EndIf EndEvent Event OnTimer(int aiTimerID) If aiTimerID == TimerID TimesUp = 1 EndIf EndEvent When filling the properties I would choose a different integer (likely a high number that is unlikely to be duplicated by other mods) to fill for TImerID and make sure it is unique for each instance of the activator. Edited April 5, 2018 by candlepin Link to comment Share on other sites More sharing options...
TheWormpie Posted April 5, 2018 Share Posted April 5, 2018 The functions StartTimer and OnTimer only exist in the FO4 Creation Kit, not in Skyrim as far as I can see on the wiki. You need to use RegisterForSingleUpdate (or RegisterForSingleUpdateGameTime) and OnUpdate instead. Also remember to end your property lines with "auto". Link to comment Share on other sites More sharing options...
candlepin Posted April 6, 2018 Share Posted April 6, 2018 The functions StartTimer and OnTimer only exist in the FO4 Creation Kit, not in Skyrim as far as I can see on the wiki. You need to use RegisterForSingleUpdate (or RegisterForSingleUpdateGameTime) and OnUpdate instead. Also remember to end your property lines with "auto". Thanks, I didn't catch that StartTimer was for FO4 but not Skyrim. RegisterForSingleUpdate worked, thanks. Link to comment Share on other sites More sharing options...
candlepin Posted April 6, 2018 Share Posted April 6, 2018 Next question: :) I'm trying to script getting an actor to go to sleep and, so far, this works well by having them activate an invisible bedroll. The issue I'm running into is that I can't figure out how to wake them up. I've tried finding an answer to this on the CK wiki and various forums, to no avail. Any help is, as always, appreciated. Link to comment Share on other sites More sharing options...
RichWebster Posted April 7, 2018 Share Posted April 7, 2018 Next question: :) I'm trying to script getting an actor to go to sleep and, so far, this works well by having them activate an invisible bedroll. The issue I'm running into is that I can't figure out how to wake them up. I've tried finding an answer to this on the CK wiki and various forums, to no avail. Any help is, as always, appreciated.Have you tried getting them to activate the bed again? Link to comment Share on other sites More sharing options...
Recommended Posts