Jump to content

OnInit label


xazax

Recommended Posts


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

indeed o.o perhaps useful

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

@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


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  419
  • Reputation:   355
  • Joined:  11/11/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

We could implement a oninit trigger into @loadnpc.

So it loads the npc AND the oninit trigger.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  419
  • Reputation:   355
  • Joined:  11/11/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

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

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

there you go masao, r16130

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

dang. it's released!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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...