-
Notifications
You must be signed in to change notification settings - Fork 40
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
Feature Request - Customize addon naming scheme #699
Comments
You can rename addons in a post-build hook. I can paste an example used in CUP later today. |
Could do that yeah, just thought a built in solution would be nice as well. |
let addons = HEMTT_OUT.join("addons");
let prefix_len = HEMTT.project().prefix().len();
for pbo_path in addons.list() {
let rpbo = pbo_path.file_name();
// Weapons_CUP_Weapons_ACR.pbo => cup_weapons_acr.pbo
if rpbo.starts_with("Weapons_CUP_") {
rpbo.crop(prefix_len + 1);
rpbo.make_lower();
let rpbo_path = addons.join(rpbo);
if !pbo_path.move(rpbo_path) {
fatal("Failed to rename " + pbo_path + " to " + rpbo_path);
}
}
} |
Looks simple enough, thanks! |
I tried it out on my project but it seems running the hook in INFO Binarized 29 files
INFO Built 39 PBOs
INFO Running hook: post_build/01_rename_pbos.rhai
INFO Copied 5 files
ERROR IO Error: The system cannot find the file specified. (os error 2)
|
Can you include the project and the branch you are trying this on with the failing script? I can take a look sometime |
Our project's repo is private because a lot of our models are community donated. You should have gotten an invitation to the project |
Currently, HEMTT will always use a project's prefix for pbo names, and will result in
prefix_addon.pbo
. I have a different usecase where we want our main prefix to be used for pbo names instead, or to just add a new property for the pbo prefix specifically.Our main prefix is an acronym for the group, and then each mod's prefix is the name of the mod. I.e.
\ls\core\...
is the file path for the core mod,\ls\battlefields\
for another mod, etc.However, this would result in our pbo names being
core_addon.pbo
orbattlefields_addon.pbo
, which isn't ideal. Having someway to control the naming schemes for pbos would be great, that way we could format them to bels_core_addon.pbo
/ls_battlefields_addon.pbo
or justls_addon.pbo
.Some ideas:
usemainprefix = true
: would use mainprefix instead of prefixpboprefix = "prefix"
: would be used for pbo names, or prefix if not definedThe text was updated successfully, but these errors were encountered: