Jump to content
xazax

OnInit label

Recommended Posts

Right now it does not trigger for npc's loaded via @loadnpc. I think it is a confusing and unlogical behavior. Do you think we should change this?

  • Upvote 3
Link to comment
Share on other sites

I think even there is a custom command in the source mod sections just for triggering the oninit label of an npc. Lets make it obsolete! :)

Link to comment
Share on other sites

Yeah. That also reflects, users probably want OnInit triggered by loadnpc.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

I would prefer @loadnpc to trigger the OnInit label by default, and add an option (parameter) to avoid that. Opinion?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

I agree on Ai4rei...but if there is a way to refresh everything the better(like your just restarting the server)...

Link to comment
Share on other sites

We could implement a oninit trigger into @loadnpc.

So it loads the npc AND the oninit trigger.

I would prefer @loadnpc to trigger the OnInit label by default, and add an option (parameter) to avoid that. Opinion?

If it could trigger the OnInit labels only in the script that was loaded.

Link to comment
Share on other sites

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.

We could implement a oninit trigger into @loadnpc.

So it loads the npc AND the oninit trigger.

I would prefer @loadnpc to trigger the OnInit label by default, and add an option (parameter) to avoid that. Opinion?

If it could trigger the OnInit labels only in the script that was loaded.

it is possible to run the oninit (or any npc event) solely on the npcs being loaded by the @loadnpc call.

Link to comment
Share on other sites

Just a small notice, it would be nice to have an additional optional parameter to loadnpc to be able to avoid triggering oninit script just in case.

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.