Skip to content

[miracle request] scripts complex string alias recognition #44

@GarompaEstomper

Description

@GarompaEstomper

Many people have raised the issue that some maps are being packed with missing files causing crashes due to scripts. The scripts are ok but the issue comes from them using aliases. That resguy, used to pack the maps, doesn't recognize. Here's an example

CASE 1:
PrecacheGeneric ("sprites/whatever.spr") <-(since the full path is there, resguy seems to see it just fine)

CASE 2:
"mapfolder/whatever.spr" <-(I think resguy doesn't read it since it doesn't start with "sprites/" , maybe a fix could be that if a file is .spr then the path it always should start with sprites/ even if it doesn't have it, to help cases like this)

CASE 3:
SPRITE_WHATEVER = "sprites/whatever.spr"
PrecacheGeneric (SPRITE_WHATEVER) <- (I think resguy can't read this. So maybe it should just look for file paths regardless of if they are precaches or not)

CASE 4:
SPRITE_WHATEVER = "sprites/" + WHATEVER + ".spr" <- (And even worse case than case 3, omg, I've seen this in the CSO weapons pack)
WHATEVER = whatever

I know you don't have the obligation to fix this since its mostly how people do their scripts and not a resguy problem. But I'm suggesting a workaround for these cases in case you want to raise to the occasion and be a messiah of might and magic (level 2 because you already are for your amazing tools). I'm not a programmer but maybe the fix is easy? I'd imagine detecting filenames alongside with filetypes (whatever.spr or whatever + .spr detected as whatever.spr) and if no clear path is detected then maybe work backwards or search in a fixed folder to find the filename and include that.
So if you have the case 4, resguy would read whatever + .spr as whatever.spr and look in the same line for key strings like "sprites/" or "cso" (for example) and build the path out of nothing to check if the file is there, like detecting sprites/cso/whatever,spr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions