![]() |
[Research] failed to increase total npc because of npc quota
First sorry if this is in wrong section, wasn't sure where to put it because if we solve it, it will become a server mod and Tutorial.
----------------------------------------------------------------------- Ok, I have been bugged by this error ever since C4 came out, and because i can't find the "ItemOwned bug" posted in the server red message topic and increasing the max spawn count seems to be a bad work around, IE random_respawn spawning all the NPCs, is not very random. I have done some very little testing (because my dev server is locked in storage while they fix my house after the flood) but i noticed that if i lock all players out until the NPC server finishes loading. I do not get any errors about this. So i figured I could narrow it down to the ON_NPC_DELETED Handel. After decompiling it and fixing a few names to match the proper push_event/push_const's i came out with this [EXAMPLE NPCPOS] Code:
npcmaker_ex_begin [TeritoryName] name=[MakerName] ai=[random_spawn] maximum_npc=1 Code:
EventHandler ON_NPC_DELETED(deleted_def,i0,i1,i2,maker0,def0)now you might have noticed the *******'s Thats the line i think is wrong. Cause it looks like it seeing how many are spawned of the selected SpawnDefine and not how many npcs are spawned in the actual npcmaker or myself.total and myself.npc_count So i have come up with this new AI and would like some feedback on my theory Code:
EventHandler ON_NPC_DELETED(deleted_def,i0,i1,i2,maker0,def0)hope you can see what im getting at, i wrote this while i was thinking about it :) UPDATE 1=========== I opened L2NPC in a hex editor and found a refrence to "mMaximumNPC maximun_npc" all in an area with other what looks like maker functions. so now i need someone who can help me find the ID for that value so i can change the push_event/push_const in the AI |
sometimes it is normal warning, for example for treasure chests and mimics in some places.
|
not really cause the random_spawn is the one used for them and those are the ones that really got me interested in this, and if you watch the numbers are usually a lot higher then 1 and that would make since from my point of view because its trying to spawn say 6 more boxes when one dies so ill see numbers like [11/6] 11 becasue 1 gets spawned of 6, this also leads mw to thinking that raising the max NPC is bad, because in one i was looking up the maker was set to max of 6 NPCs but there where 4 npc lines with a total of 6 each so if i where to up the max to 24 then i would have 12 chests and 12 mimics in a small area meant for 6 NPC's
|
THe fix is very easy.
Just replace (def0.total - def0.npc_count) to (def0.total - i0) Thx for this fix to Vaniok :) |
Hmm dies i0 contain the new total spawned??
If so, thank you very much I would still like to know how to find the numbers to use for variables. |
Im pretty sure they are declared on the npc class.
|
Well i was playing around and thinking about it, and noticed the when the handle starts by decreasing the count by 1 no matter what. So i figured that because of that, theres no need to see how many spawns are available, so i changed it to just spawn 1 no matter what. and now i share it
Code:
handler 1 115 // ON_NPC_DELETEDand decompiled for easy view Code:
EventHandler ON_NPC_DELETED(deleted_def,i0,i1,i2,maker0,def0)I have not fully tested this but after randomly checking the NPC console i have not seen any more errors in the last 24 hours. |
hmm
I make all changes to AI what I find here on PP but still have this problem on mob spawn position created with L2scriptMaker.. why?
|
Quote:
In my research: - Quot fix fix 99% problems with spawns and errors. - But somewhere leave problem. Maybe it npcpos error with maximum_npc. But i do fix it easy. I do increase this bug territory. Check logs and increase this value to required value. Last L2SM do scanning logs and fix npcpos.txt. |
| All times are GMT. The time now is 21:45. |