Talk:Scripting MagicEffect

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Timers[edit source]

I see here that OnTimer is used but OnTimerGameTime - ScriptObject may be more appropriate so that effects relate to the users timescale. I also suspect there to be oddities from sleeping and fast travel but I have not tested this script to confirm the suspicion.Scrivener07 (talk) 2016-11-06T21:38:18 (EST)

Generic[edit source]

Some improvements could be made to make this script apply to more situations.

  • The subject ActorValue could be renamed from "ActionPoints" to something like "SubjectValue"
  • The script could be configured to increment or decrement.
  • The scripts "Increment" or "Step" property could be exposed to the papyrus property manager.
  • I dont think setting the MGEF's subject actor to none on completion is the proper way for the script to clean up.

These are my opinions on the script. Scrivener07 (talk) 2016-11-06T22:10:19 (EST)


Thanks for the suggestions! I'm not a scripting guru myself - pretty much self-taught, with no CS background - but I just wanted to get something out there because there it doesn't seem like there is much out there for OnTimer related events at the moment, at least that I could find using Google.

  • OnTimerGameTime does seem to make some sense, although if the script is activated by a magic effect, and then the player sleeps or waits, won't the script still be running even though the effect might be expired by the elapse of game time?
  • I went with ActionPoints just because it's a common value and would be immediately familiar to any modder, so they'd be able to grok the intent of the script immediately.
  • I'm not familiar with the possible means to reconfigure the script to change increment to decrement or expose its properties to the Papyrus property manager; how would that be done?
  • When I chatted with Nexus kinggath about using effectActor = None he mentioned that it was necessary to make sure that effectActor didn't remain lodged in memory and interfere if the script is used elsewhere again. Is there a better way to do this? Aib (talk) 2016-11-07T13:39:23 (EST)

I made a bunch of changes so the script is a little more versatile, including exposing a lot of things as properties, for people who just want to copy-paste it. Per the clean-up, we're not actually setting the subject actor to None, we're clearing out the temporary variable we used to hold the actor reference (it's probably not even necessary, but better safe than persistent). Kinggath (talk) 2016-11-08T12:43:23 (EST)