Jump to content
  • 0

NpcKillEvent warning...Lots of


Alayne

Question


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  342
  • Reputation:   169
  • Joined:  02/25/12
  • Last Seen:  

Hi Guys.

 

Here's my problem. I'm a pretty...creative guy, and I've created lots and lots and lots of scripts. Around 400. The problem is that lots of them use the OnNPCKillEvent to do something special.

 

And sometimes, I don't know why, with some players I've got LOOOOOTTTTSSSS of warning in my map server, warning that the queue is full for this event.

 

What's the limit? How can i limit these warnings? Cause we're thinking that maybe it cause a map crash server if too much happened...

 

Does anybody ever met this problem?

 

Thanks for reading.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  96
  • Topics Per Day:  0.02
  • Content Count:  554
  • Reputation:   14
  • Joined:  09/24/12
  • Last Seen:  

Well... First of all.. 
I want to ask you where did you get those script?

Did it compatible with you database?

And for more effectiveness...
You can try to disable all those npc adn test it one by one to see the error...

Or you can post us the error on your map_server..

We can help you with that..

 

You question is too public and did not mention what the major source of the error...
 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Your problem, is that rAthena's src code, can only run X amounts of Events at any given time. Now, lets say, you did make 400scripts, if even 1/4 of those have OnNPCKillEvent label, thats 100 instance, that will run each time you kill a monster, now if 100 people kill a monster, thats 10,000 instances of the script being run, thats going to clog up your server and cause your problem. The only solution at this point, is to combine all or most of your OnNPCKillEvent scripts under the same label.

 

For Example:

Let's say I kill a monster while in ' Morroc Town '. These 2 scripts will activate. Since, Both NPC_A  & NPC_B have the OnNPCKillEvent, they will both try and work. However, as you can see below since they both say I need to be on a specific map, nothing happens. However, 2 instances of OnNPCKillEvent just ran.

prontera,178,150,4	script	NPC_A	123,{
mes "Hi, I'm NPC A";
close;	
OnNPCKillEvent:
	if( strcharinfo(3) == "pay_dun00" ){monster "this",0,0,"Poring",1002,10;} //Spawns 10Porings if I kill a monster while in Payon Dungeon Level 1.
	end;
}
prontera,180,150,4	script	NPC_B	123,{
mes "Hi, I'm NPC B";
close;	
OnNPCKillEvent:
	if( strcharinfo(3) == "prontera" ){set #CASHPOINTS,#CASHPOINTS + 10;}
	end;
}

But, if i were to combine the OnNPCKillEvents into 1. So that the scripts now look like this:

prontera,178,150,4	script	NPC_A	123,{
mes "Hi, I'm NPC A";
close;
}
prontera,180,150,4	script	NPC_B	123,{
mes "Hi, I'm NPC B";
close;
}


-	script	NPC_C	-1,{
	OnNPCKillEvent:
	if( strcharinfo(3) == "pay_dun00" ){monster "this",0,0,"Poring",1002,10;}
	if( strcharinfo(3) == "prontera" ){set #CASHPOINTS,#CASHPOINTS + 10;}
}

Now only 1 instance, is being run. However, it is doing the job both NPC A and NPC B would have done if they were not joined. This is the easiest way for me to explain this. I'm sorry if you do not understand.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  342
  • Reputation:   169
  • Joined:  02/25/12
  • Last Seen:  

No problem with you're explanation, I totally understand it. I just don't know about the count limit, but that totally logic.

 

I'll give it a try, thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...