Help.Grf to make mob names always visible

Started by dob_20, Feb 22, 2015, 08:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ludz69

#15
Hello. I have a question its kinda off topic coz I dont want to create a new thread for my simple question.

Question is: Whats the file name to remove the Torch or the Torch Light from dungeons? TIA

antonigaming

I followed everything you did here but mine just loads saying "Processing" and does nothing. What else could I have been missing? Maybe a redistributable file or something?


Quote from: Ara on Jan 26, 2021, 08:00 PM
I went through and tried running it myself and it worked fine. I don't know what's causing your error, but I had to make a couple edits to the script.

First off, you need a mob_db.txt I guess. I just copied the one from here: https://github.com/rathena/rathena/blob/master/db/re/mob_db.txt
If the server you're playing on has custom monsters, you might need to add them into the mob_db.txt yourself.

I pasted this in my Ragnarok Online folder (I'm just going to be reffering to this as "C:\Games\NovaRO" because that's what mine's is called.)

Then, take a look at the script. Near the top, you can see these lines:


var mobFolder = @"data\sprite\¸ó½ºÅÍ\";
var dataGrfName = @"C:\data.grf";
var newGrfName = @"C:\mobsWithName.grf";
var mobDbPath = @"C:\mob_db.txt";


You'll need to change the last 3 to your own Raganrok Folder. So I changed mine to


var mobFolder = @"data\sprite\¸ó½ºÅÍ\";
var dataGrfName = @"C:\Games\NovaRO\data.grf";
var newGrfName = @"C:\Games\NovaRO\mobsWithName.grf";
var mobDbPath = @"C:\Games\NovaRO\mob_db.txt";


You'll also need to use GRF Editor and I guess make an empty grf in your Ragnarok Online folder called mobsWithName.grf.

Then you can paste the edited script into ACTEditor's script runner and run it.

-----------------------------

If your server also has monster sprites in a GRF that isn't data.grf, you'll have to switch out that code line for the other GRF as well.

(example: after I finish running the script with data.grf, I'd switch the code to say


var mobFolder = @"data\sprite\¸ó½ºÅÍ\";
var dataGrfName = @"C:\Games\NovaRO\nova.grf";
var newGrfName = @"C:\Games\NovaRO\mobsWithName2.grf";
var mobDbPath = @"C:\Games\NovaRO\mob_db.txt";

You can see I changed data.grf -> nova.grf and mobsWithName.grf -> mobsWithName2.grf. Don't forget to make another empty GRF for this also. Run the script again and then merge mobsWithName.grf and mobsWithName2.grf and it should work fine.

owlow

I've been trying to do something similar and ran into a similar issue. I'm trying to remove all death animation frames from all the files in that folder but nothing happens if I run the script.

If I open an .act first and then run the script, it seems to work but doesn't save the files, then asks me to save the single .act I opened, which did get the frames removed correctly.

Anyone able to help?

var path = @"C:\sprite\test";

foreach (var actFile in Directory.GetFiles(path, "*.act")) {
    var sprFile = actFile.ReplaceExtension(".spr");
    var act2 = new Act(actFile, sprFile);
   
    for (int aid = 32; aid < act.Actions.Count; aid++) {
        for (int fid = act.Actions[aid].Frames.Count - 1; fid >= 1; fid--) {
        act[aid].Frames.RemoveAt(fid);
           }
    }
   
    act2.SaveWithSprite(actFile, sprFile);
}

Ara

Quote from: owlow on Apr 09, 2023, 03:59 PM
I've been trying to do something similar and ran into a similar issue. I'm trying to remove all death animation frames from all the files in that folder but nothing happens if I run the script.

If I open an .act first and then run the script, it seems to work but doesn't save the files, then asks me to save the single .act I opened, which did get the frames removed correctly.

Anyone able to help?

var path = @"C:\sprite\test";

foreach (var actFile in Directory.GetFiles(path, "*.act")) {
    var sprFile = actFile.ReplaceExtension(".spr");
    var act2 = new Act(actFile, sprFile);
   
    for (int aid = 32; aid < act.Actions.Count; aid++) {
        for (int fid = act.Actions[aid].Frames.Count - 1; fid >= 1; fid--) {
        act[aid].Frames.RemoveAt(fid);
           }
    }
   
    act2.SaveWithSprite(actFile, sprFile);
}


The issue here is that you're saving a variable called "act2", but you're doing the actions on a variable called "act". Just change every instance of "act" with "act2" in your code (e.g. act[aid] ---> act2[aid]) and it should work.


===============================================

Also, it doesn't seem like I can edit my old message, but rAthena has swapped out mob_db.txt for mob_db.yml. The script doesn't really work with the yml file, even if you convert it into a txt file instead.

For anyone looking for a mob_db.txt file, you can try this one: https://github.com/evertonsnake/rathena/blob/master/db/re/mob_db.txt

Or if you try to find another one (that's perhaps more updated?), the format should look something like that.

owlow

Quote from: Ara on Apr 09, 2023, 07:30 PM
The issue here is that you're saving a variable called "act2", but you're doing the actions on a variable called "act". Just change every instance of "act" with "act2" in your code (e.g. act[aid] ---> act2[aid]) and it should work.

Thank you very much, it's working now.

NeOBR

Quote from: Ara on Apr 09, 2023, 07:30 PMThe issue here is that you're saving a variable called "act2", but you're doing the actions on a variable called "act". Just change every instance of "act" with "act2" in your code (e.g. act[aid] ---> act2[aid]) and it should work.


===============================================

Also, it doesn't seem like I can edit my old message, but rAthena has swapped out mob_db.txt for mob_db.yml. The script doesn't really work with the yml file, even if you convert it into a txt file instead.

For anyone looking for a mob_db.txt file, you can try this one: https://github.com/evertonsnake/rathena/blob/master/db/re/mob_db.txt

Or if you try to find another one (that's perhaps more updated?), the format should look something like that.


Hi Ara, I know the topic has been stopped for a while I'm having an error in the script I didn't find a mob.db but the version I have of act editor I believe is not compatible with the current script, it's giving an error


'GRF.ContainerFormat.Commands.CommandsHolder<GRF.Core.FileEntry>' does not contain a definition for 'AddFileAbsolute' and no extension method 'AddFileAbsolute' accepting a first argument of type 'GRF.ContainerFormat.Commands.CommandsHolder<GRF.Core .FileEntry>' could be found (are you missing a directive or an assembly reference?)"

I'm probably using a very recent version of act editor, do you have the version that works with this script?

@Tokeiburu

ishida20

Quote from: NeOBR on Jan 11, 2024, 08:39 PMHi Ara, I know the topic has been stopped for a while I'm having an error in the script I didn't find a mob.db but the version I have of act editor I believe is not compatible with the current script, it's giving an error


'GRF.ContainerFormat.Commands.CommandsHolder<GRF.Core.FileEntry>' does not contain a definition for 'AddFileAbsolute' and no extension method 'AddFileAbsolute' accepting a first argument of type 'GRF.ContainerFormat.Commands.CommandsHolder<GRF.Core .FileEntry>' could be found (are you missing a directive or an assembly reference?)"

I'm probably using a very recent version of act editor, do you have the version that works with this script?

@Tokeiburu


Sorry for the bump, can anyone please help as I am having the same error when running the script on ACTEditor 1.2.8. It seems that it doesn't recognize the command 'AddFileAbsolute'. I have a mob_db.txt but I am not sure if it's updated or the one needed.

Please help because the mobsWithName.grf that Tokeiburu has provided doesn't have certain mobs like Archer Skeleton and Skeleton Soldier, etc. I would like to have it added using the script.

If you also have a download link for a known working mob_db.txt that would be greatly appreciated. I am hoping for a response and thank you so much in advance.

Ara

Quote from: ishida20 on Apr 07, 2024, 08:49 PMSorry for the bump, can anyone please help as I am having the same error when running the script on ACTEditor 1.2.8. It seems that it doesn't recognize the command 'AddFileAbsolute'. I have a mob_db.txt but I am not sure if it's updated or the one needed.

Please help because the mobsWithName.grf that Tokeiburu has provided doesn't have certain mobs like Archer Skeleton and Skeleton Soldier, etc. I would like to have it added using the script.

If you also have a download link for a known working mob_db.txt that would be greatly appreciated. I am hoping for a response and thank you so much in advance.

Quote from: NeOBR on Jan 11, 2024, 08:39 PM'GRF.ContainerFormat.Commands.CommandsHolder<GRF.Core.FileEntry>' does not contain a definition for 'AddFileAbsolute' and no extension method 'AddFileAbsolute' accepting a first argument of type 'GRF.ContainerFormat.Commands.CommandsHolder<GRF.Core .FileEntry>' could be found (are you missing a directive or an assembly reference?)"

I went to go bother Tokei a bit (^u^) and turns out "AddFileAbsolute" has been replaced with "AddFile", which is why it stopped working on newer versions of ActEditor.

If you're getting the error regarding that, find and replace (ctrl + h) and replace every instance of "AddFileAbsolute" with "AddFile" and the script should work.

=======

On another note, looks like the last mob_db.txt I posted broke as well huh... I've attached some sort of version of mob_db.txt that I had lying around. It's called mob_db.rar but that's just because I had to compress it so that RMS would let me attach it (file size limit is 100KB, uncompressed the file is like 300ish KB), obviously extract it back to a txt if you want to try using it.

Download here: You cannot view this attachment.

ishida20

@Ara

I apologize for the late response and I hope it's not too late to say, THANK YOU!
It worked with the latest version of Tokei's ACTEditor and I found out the reason why some mobs were not included in his original mobsWithName.grf.

It turns out that the mob_db.txt that we have is indeed outdated. (or the current data.grf's that we have just updated) Some .act files within data.grf has different name tags compared to the ones from mob_db.txt (e.g. Archer Skeleton has an .act file name of SKEL_ARCHER in data.grf but mob_db.txt has it named ARCHER_SKELETON)

If anyone wants to change this, just simply rename the mob_db.txt name to the ones in your data.grf.

Once again, I appreciate your help as this has been triggering my OCD for a while since I started using Tokei's GRF.  /heh