Angst Posted December 31, 2011 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 97 Reputation: 20 Joined: 11/13/11 Last Seen: February 14, 2023 Share Posted December 31, 2011 I'd like to request an edit to the command @unloadnpc to unload the whole text file by directory. Like @loadnpc <directory>/file.txt Unloadnpc would do the same thing but unload: @unloadnpc <directory>/file.txt This way @loadnpc <directory>/file.txt doesn't create duplicates. Thanks for your time. Quote Link to comment Share on other sites More sharing options...
Jonne Posted December 31, 2011 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 153 Reputation: 33 Joined: 12/24/11 Last Seen: September 30, 2024 Share Posted December 31, 2011 I'd like to request an edit to the command @unloadnpc to unload the whole text file by directory. Like @loadnpc <directory>/file.txt Unloadnpc would do the same thing but unload: @unloadnpc <directory>/file.txt This way @loadnpc <directory>/file.txt doesn't create duplicates. Thanks for your time. Only hardly possible. When loading NPCs, they are parsed and then saved, but not by their source but by their unique name. That's why there is @unloadnpc <name> but @loadnpc <file>. To do this you would have to keep track of any NPC in any file or go through the whole file looking for NPCs and check whether they exist and then remove them. I suggest just using @unloadnpc <name> to unload NPCs... Quote Link to comment Share on other sites More sharing options...
FatalEror Posted December 31, 2011 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 67 Reputation: 23 Joined: 11/14/11 Last Seen: October 3, 2014 Share Posted December 31, 2011 (edited) Try this: unloadscript.patch Tested and working on my Windows(rathena-10.sln), not sure about Linux thought.. Edited December 31, 2011 by FatalEror Quote Link to comment Share on other sites More sharing options...
Jonne Posted December 31, 2011 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 153 Reputation: 33 Joined: 12/24/11 Last Seen: September 30, 2024 Share Posted December 31, 2011 Try this: Tested and working on my Windows(rathena-10.sln), not sure about Linux thought.. Looking over your patch it does what I described. But I would refrain from using this method but much rather suggest sv_parse. It parses a string with delimiters. It is also used by the npc_parsesrcfile() function, which loads all scripts. I think your code might have problems for example when I use the warp command after a tab or similiar. Also I have a question, how does this behave: strtok(NULL, " "); You use this three times and I don't get it. I appreciate you share you knowledge Quote Link to comment Share on other sites More sharing options...
Question
Angst
I'd like to request an edit to the command @unloadnpc to unload the whole text file by directory.
Like @loadnpc <directory>/file.txt
Unloadnpc would do the same thing but unload: @unloadnpc <directory>/file.txt
This way @loadnpc <directory>/file.txt doesn't create duplicates.
Thanks for your time.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.