xazax Posted May 5, 2012 Posted May 5, 2012 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? 3
xazax Posted May 5, 2012 Author Posted May 5, 2012 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!
tr0n Posted May 7, 2012 Posted May 7, 2012 @xazax you mean my @oninit source modification ? Some people asked me why it's not merged up with the svn. http://rathena.org/board/topic/60694-oninit-trigger/
xazax Posted May 7, 2012 Author Posted May 7, 2012 Yeah. That also reflects, users probably want OnInit triggered by loadnpc.
Ai4rei Posted May 7, 2012 Posted May 7, 2012 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. 1
tr0n Posted May 7, 2012 Posted May 7, 2012 We could implement a oninit trigger into @loadnpc. So it loads the npc AND the oninit trigger.
xazax Posted May 7, 2012 Author Posted May 7, 2012 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?
Ai4rei Posted May 7, 2012 Posted May 7, 2012 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. 1
malufett Posted May 7, 2012 Posted May 7, 2012 I agree on Ai4rei...but if there is a way to refresh everything the better(like your just restarting the server)...
Brian Posted May 7, 2012 Posted May 7, 2012 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.
tr0n Posted May 7, 2012 Posted May 7, 2012 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. that's what i'm saying. @loadnpc to load the npc and the oninit label of that npc.
Ind Posted May 7, 2012 Posted May 7, 2012 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.
xazax Posted May 20, 2012 Author Posted May 20, 2012 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.
Recommended Posts