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.