Jump to content

Ai4rei

Members
  • Posts

    419
  • Joined

  • Last visited

  • Days Won

    36

Posts posted by Ai4rei

  1. It won't give you the freedom to decide the execution of OnInit upon @loadnpc.

    Let's say, you have some NPCs, where it would work fine but also have an NPC that halves the EXP rate (zero-configuration dynamics) in OnInit upon a condition (ex. time of day). Then if you update it while the EXP rate is 50%, it will once again apply it once more (25% original EXP rate), because it does not know, that it already initialized.

    The other way round, you have disabled OnInit, but have one or more NPCs where you would want to re-run the OnInit code after @loadnpc them; no tools at hand either, unless going for custom commands.

    • Upvote 1
  2. OnInit is invoked once all NPCs are (re)loaded, as part of the script engine's initialization. Rather than changing it's function, I'd prefer to have a separate OnLoad event. If that is a no-go, consider making this behavior optional per-NPC. Either as something like @donpcevent or an additional parameter in @loadnpc.

    • Upvote 1
×
×
  • Create New...