xazax Posted May 5, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share 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 Link to comment Share on other sites More sharing options...
Ind Posted May 5, 2012 Group: Members Topic Count: 169 Topics Per Day: 0.03 Content Count: 1260 Reputation: 750 Joined: 11/19/11 Last Seen: April 11, 2013 Share Posted May 5, 2012 indeed o.o perhaps useful Link to comment Share on other sites More sharing options...
xazax Posted May 5, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Author Share 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! Link to comment Share on other sites More sharing options...
tr0n Posted May 7, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Share 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/ Link to comment Share on other sites More sharing options...
xazax Posted May 7, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Author Share Posted May 7, 2012 Yeah. That also reflects, users probably want OnInit triggered by loadnpc. Link to comment Share on other sites More sharing options...
Ai4rei Posted May 7, 2012 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 425 Reputation: 359 Joined: 11/11/11 Last Seen: Thursday at 11:40 AM Share 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 Link to comment Share on other sites More sharing options...
tr0n Posted May 7, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Share Posted May 7, 2012 We could implement a oninit trigger into @loadnpc. So it loads the npc AND the oninit trigger. Link to comment Share on other sites More sharing options...
xazax Posted May 7, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Author Share 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? Link to comment Share on other sites More sharing options...
Ai4rei Posted May 7, 2012 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 425 Reputation: 359 Joined: 11/11/11 Last Seen: Thursday at 11:40 AM Share 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 Link to comment Share on other sites More sharing options...
malufett Posted May 7, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 554 Reputation: 70 Joined: 04/04/12 Last Seen: November 8, 2013 Share 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)... Link to comment Share on other sites More sharing options...
Brian Posted May 7, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share 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. Link to comment Share on other sites More sharing options...
tr0n Posted May 7, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Share 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. Link to comment Share on other sites More sharing options...
Ind Posted May 7, 2012 Group: Members Topic Count: 169 Topics Per Day: 0.03 Content Count: 1260 Reputation: 750 Joined: 11/19/11 Last Seen: April 11, 2013 Share 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. Link to comment Share on other sites More sharing options...
Ind Posted May 19, 2012 Group: Members Topic Count: 169 Topics Per Day: 0.03 Content Count: 1260 Reputation: 750 Joined: 11/19/11 Last Seen: April 11, 2013 Share Posted May 19, 2012 there you go masao, r16130 1 Link to comment Share on other sites More sharing options...
tr0n Posted May 20, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Share Posted May 20, 2012 dang. it's released! Link to comment Share on other sites More sharing options...
xazax Posted May 20, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Author Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts