Rayek Posted February 13, 2017 Share Posted February 13, 2017 (edited) I'm trying to enable a spell effect (The animated static)...but only for a couple of seconds every time the activator is selected. I have the basic enable script (below) but I am unclear on how to add the StartTimer Function: Scriptname RE_EnableTimerScript extends ObjectReference ObjectReference Property SpellEffect Auto Event OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() SpellEffect.Enable() Endif EndeventAny help is appreciated. Since a timer would be added...will it just re-start the effect/timer each time the activator is clicked? Thanks. Edited February 13, 2017 by Rayek Link to comment Share on other sites More sharing options...
Lisselli Posted February 13, 2017 Share Posted February 13, 2017 (edited) This isnt FO4. StartTimer doesn't exist. You need to use OnUpdate, or a short wait instead. So after the enable line, you can add Utility.wait(x.x) x.x being how many(as a float) seconds you want the thing to be enabled, and then disable after it.You may need to take in account for things like the person spamming the activation, which would cause threading. Simplest way I think would be to a check if the thing is already disabled first? Edited February 13, 2017 by Lisselli Link to comment Share on other sites More sharing options...
Masterofnet Posted February 13, 2017 Share Posted February 13, 2017 (edited) Is this what you are trying to do? If you are working with scripts these two pages will be useful to you. https://www.creationkit.com/index.php?title=Category:Script_Objectshttps://www.creationkit.com/index.php?title=While Scriptname RE_EnableTimerScript extends ObjectReference ObjectReference Property SpellEffect Auto Event OnActivate(ObjectReference akActionRef) GoToState("Waiting") ; https://www.creationkit.com/index.php?title=State_Reference SE(akActionRef); Why did I use a function? GoToState("") ; Back to the empty state - The state outside defined states. Endevent Function SE(ObjectReference A) ;Why did I have to define the action ref and not the SpellEffect? If A == Game.GetPlayer() Else Return EndIf SpellEffect.Enable() Utility.Wait(2.0) ; https://www.creationkit.com/index.php?title=Utility_Script SpellEffect.Disable() EndFunction State Waiting Event OnActivate(ObjectReference akActionRef) EndEvent EndState Edited February 13, 2017 by Masterofnet Link to comment Share on other sites More sharing options...
Rayek Posted February 13, 2017 Author Share Posted February 13, 2017 (edited) Thanks @Lisselli and @Masterofnet. Ahhh...I need to stop looking for help by typing Creation Kit only. @Masterofnet Yes, that works exactly how I was hoping. I appreciate the references for the information as well...learning to fish as opposed to just being handed a fish. I know it's not much but I will include you guys in the credits of my mod as a lil thank you if you don't mind. Edited February 13, 2017 by Rayek Link to comment Share on other sites More sharing options...
Masterofnet Posted February 13, 2017 Share Posted February 13, 2017 It would be an honor. Keep up the good work! :devil: Link to comment Share on other sites More sharing options...
Rayek Posted February 14, 2017 Author Share Posted February 14, 2017 As an addition...is there a way to make that spell fade away instead of 'Pop' when it disappears after the wait time is ended? I'm guessing no as I've been looking for the last 30m or so... Link to comment Share on other sites More sharing options...
Masterofnet Posted February 14, 2017 Share Posted February 14, 2017 I would be very surprised if you can not. However, I only have experience doing it with NPCs and the function will only work on actors. I am sure someone will be able to help you figure out how to do it with an object reference. https://www.creationkit.com/index.php?title=SetAlpha_-_Actor Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 14, 2017 Share Posted February 14, 2017 Check out the Disable page on the CK wiki.In order to make the object or effect fade away, you should simply be able to do something like: SpellEffect.Disable(true) Link to comment Share on other sites More sharing options...
Rayek Posted February 14, 2017 Author Share Posted February 14, 2017 (edited) Nice...will give it a shot. Thanks @IsharaMeradin and again @Masterofnet Edited February 14, 2017 by Rayek Link to comment Share on other sites More sharing options...
Rayek Posted February 14, 2017 Author Share Posted February 14, 2017 (edited) This actually works great...for almost everything. Oddly enough one of the items I'm using it for DLCCraftingStaffWorkbench will not fade...while everything else I've tested does. It insists on popping. Figures. Makes me wonder if there is a .nif property or a setting that doesn't allow it to fade...Might be because it has a 2nd Marker Model attached. Thanks again @IsharaMeradin EDIT: For the record it is the extra Marker Model that was added that made it unable to fade. I just created a static in the exact same location, nulled all textures but the marker for the DLCCraftingStaffWOrkbench (renamed of course) and added the static to to script...fade is now intact. Edited February 14, 2017 by Rayek Link to comment Share on other sites More sharing options...
Recommended Posts