Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-opening: Unloadnpc does not allow re-loading of NPC #203

Closed
raynra opened this issue Jan 4, 2015 · 17 comments
Closed

Re-opening: Unloadnpc does not allow re-loading of NPC #203

raynra opened this issue Jan 4, 2015 · 17 comments

Comments

@raynra
Copy link

@raynra raynra commented Jan 4, 2015

For example:
@loadnpc npc/custom/resetnpc.txt
@unloadnpc Reset Girl
@loadnpc npc/custom/resetnpc.txt <-- will not work second time

This was broken back in August due to:
402170c

This was supposed to fix it:
https://rathena.org/board/tracker/issue-9311-loadnpcfile-bug/?gopid=28440#entry28440

@cydh
Copy link
Contributor

@cydh cydh commented Jan 5, 2015

why don't just remove that @unloadnpc? haha.

personally I never use that command nowadays, I prefer @unloadnpcfile. Just because when @unloadnpc it unload a NPC doesn't care the file path, so when use @loadnpc it will loads all NPCs in same file, there's NPC duplication possibilities.

@raynra
Copy link
Author

@raynra raynra commented Jan 5, 2015

Ah, thanks for clarifying that up, Cydh. Perhaps @unloadnpc should be depreciated in favor of @unloadnpcfile then?

@chriser-
Copy link

@chriser- chriser- commented Jan 5, 2015

i added @reloadnpc a long time ago on my server, and i think it would be a good idea to implement it on rathena. all it does is just @unloadnpcfile and @loadnpc (copy&pasta)
and i have never ever used @unloadnpc because i think its totally not needed (especially when you can rightclick > kill, which basically does the same)

@Emistry
Copy link
Contributor

@Emistry Emistry commented Jan 6, 2015

I believe @unloadnpcfile wouldnt remove any permanent monster spawn script.
when using the custom made @reloadnpc as stated by @chriser- , I think it would make the case worst by keep repeating the permanent monster spawn, end up the map flood with the monsters if the user keep use @reloadnpc without aware there are permanent monster script there.
Depend on the script, sometime you might not want the script to trigger other OnInit label from other npc within the same file, @unloadnpc + @loadnpc would still the best option.

rightclick > kill , doesnt alway work. I mean under certain circumstance it is not available depend on client diff I think.

** but I like the idea for using @reloadnpc too xD

@marky291
Copy link
Contributor

@marky291 marky291 commented Jan 6, 2015

I created my own reload - @refreshfile

I took both @unloadnpcfile and @loadnpc commands from source code and combined it into the one command. Which runs both unloadnpcfile first and load npcs automatically. Saves huge amount of time when testing an NPC and need it to refresh.

@chriser-
Copy link

@chriser- chriser- commented Jan 6, 2015

thats exactly what i wrote xD

@marky291
Copy link
Contributor

@marky291 marky291 commented Jan 7, 2015

I see, nice to know others have the same idea. This should be added, don't know why not.

Also @unloadnpc is very handy when you have a set of npcs in one file but need to emergency kill one due to exploit or bug, not that it happens often but nice option to have.

@anacondaq
Copy link

@anacondaq anacondaq commented Jan 7, 2015

@refreshnpc will be awesome command for different purposes on the fly.

@raynra
Copy link
Author

@raynra raynra commented Jan 8, 2015

Is anyone else experiencing @unloadnpcfile sometimes failing after a reload of a script?
For example, just right now, I did:

@unloadnpcfile npc/custom/warper.txt
@loadnpc npc/custom/warper.txt
@unloadnpcfile npc/custom/warper.txt
File not found.
@unloadnpcfile failed.

It seems like when it fails, it never works again.

@cydh
Copy link
Contributor

@cydh cydh commented Jan 8, 2015

@raynra hmm never
I used those commands repeatedly when test a NPC without restart server.

@cydh
Copy link
Contributor

@cydh cydh commented Mar 31, 2015

err yea, somehow confirmed for CentOS. for @loadnpc -> @unloadnpcfile, the failed to @loadnpc again.
can anyone test this? https://gist.github.com/cydh/99f991dce97f6e975424

@brianluau
Copy link
Contributor

@brianluau brianluau commented May 11, 2015

When @loadnpc fails because the file is already loaded, the current message is:
261: Script could not be loaded.

Suggestion - change the message to something like "File is already loaded." or "Script is already loaded."

@rubie123
Copy link

@rubie123 rubie123 commented Jun 12, 2015

This issue still exists. my current revision is: 0d8a7c0
I tried to find if you guys already had a fix for this and found this topic. So is there a fix?

@anacondaq
Copy link

@anacondaq anacondaq commented Jun 13, 2015

confirm

@rubie123
Copy link

@rubie123 rubie123 commented Jun 24, 2015

Hope this will be fixed soon...

@Everade
Copy link
Contributor

@Everade Everade commented May 1, 2016

confirmed

Ruining my day since > 1 Year

@Everade
Copy link
Contributor

@Everade Everade commented Jul 21, 2021

It's still driving me crazy.
Would be great if this could be avoided:
image

The only workaround that exists is to increase the slash count.
It has not been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants