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

Small issue #56

Open
911reg opened this issue Jan 7, 2023 · 5 comments
Open

Small issue #56

911reg opened this issue Jan 7, 2023 · 5 comments
Labels
decompiler Issues related to decompilation enhancement T3D Text 3D Format (DefaultProperties etc)

Comments

@911reg
Copy link

911reg commented Jan 7, 2023

Hey there Eliot, first of all, thanks again for the great app! This issue isn't really related to a bug or a problem with the app, it's more like a question, if solved it might be useful for someone else as well.

So basically, i've been trying to extract *.uc files from a file (this one specifically)

The problem i'm having is the following:
This is what the defaultproperties look like:

Sin título

when they should look like this:

Screenshot_2

So basically it's showing up as "L2EffectEmitter" instead of "L2EffectEmiter'L2EffectEmiter0'

I'm 100% doing something wrong here, do you perhaps know how to solve this?
Here's the Array Definition i'm using: Package.Class.PreshotAction:ObjectProperty

Also, when i see the script inside UE Explorer, the reference is there, but it isn't applied to the ShotAction line for whatever reason

// Reference: L2EffectEmitter'l2_14207_skill.L2EffectEmitter53'
ShotAction(0)=L2EffectEmitter53

Screenshot_1

PD: i can fix this by hand, but sadly, i'd have to do that manually for over 4000 files.

@EliotVU
Copy link
Owner

EliotVU commented Jan 7, 2023

Are you trying to re-compile the code? If so, either references should be fine, the compiler generally just looks up the object by the name's hash.

Nonetheless I'll label this issue as an enhancement request to output a qualified reference instead.

@911reg
Copy link
Author

911reg commented Jan 7, 2023

I'm trying to recompile, yeah, but i'm getting the 'unknown property' warning in ucc.exe. The file gets compiled, but ot doesn't work ingame, though it works if i add the part that's missing manually

Screenshot_3

@EliotVU EliotVU added the decompiler Issues related to decompilation label Jan 13, 2023
@EliotVU EliotVU added this to the 1.4.0 milestone Jan 13, 2023
@EliotVU
Copy link
Owner

EliotVU commented Jan 13, 2023

Strange, normally the compiler understands such references, maybe it's different for L2.

I will address this issue in the next release by always outputting a fully qualified reference.

@EliotVU EliotVU added the T3D Text 3D Format (DefaultProperties etc) label Jan 13, 2023
@EliotVU
Copy link
Owner

EliotVU commented Jan 13, 2023

Related issue #40

@911reg
Copy link
Author

911reg commented Jan 14, 2023

Nice! I just ended up making a small tool to "fix" the files for me, it worked as a temporary measure xD
i'll leave it here just in case

#include <iostream>
#include <fstream>
#include <dirent.h>
#include <string>

using namespace std;

int main() {
    DIR* dir;
    struct dirent* ent;
    if ((dir = opendir(".")) != NULL) {
        while ((ent = readdir(dir)) != NULL) {
            string fileName = ent->d_name;
            if (fileName.find(".uc") != string::npos) {
                // found a .uc file
                cout << "Editing file: " << fileName << endl;
                ifstream inputFile(fileName);
                string line;
                string editedFile;
                while (getline(inputFile, line)) {
                    if (line.find("Action(") != string::npos) {
                        // found a line with "Action("
                        int equalPos = line.find("=");
                        if (equalPos != string::npos) {
                            // found the "=" symbol on the same line as "Action("
                            line.replace(equalPos, 1, "=L2EffectEmitter'");
                            line += "'";
                        }
                    }
                    editedFile += line + "\n";
                }
                inputFile.close();
                // overwrite the .uc file with the edited content
                ofstream outputFile(fileName);
                outputFile << editedFile;
                outputFile.close();
            }
        }
        closedir(dir);
    }
    else {
        cout << "Error opening directory" << endl;
    }
    return 0;
}

@EliotVU EliotVU removed this from the 1.4.0 milestone Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decompiler Issues related to decompilation enhancement T3D Text 3D Format (DefaultProperties etc)
Projects
None yet
Development

No branches or pull requests

2 participants