DragonKnightOfBreeze / Paradox-Language-Support

IDEA Plugin: Paradox Language Support.
https://windea.icu/Paradox-Language-Support
MIT License
37 stars 4 forks source link

Victoria 3 filepath mod vs. game assets #84

Closed kaiser-chris closed 3 weeks ago

kaiser-chris commented 3 weeks ago

Hi,

sorry for being annoying about issues, but I found another minor one.

when referencing texture assets in Victoria 3 they are referenced gfx/... but are placed in game/gfx/...

In CWT file it just references filepath. This works for mod files but not for base game files.

Example of a modded script and base game texture is:

pmg_street_lighting = {
    texture = "gfx/interface/icons/generic_icons/mixed_icon_base.dds"
    production_methods = {
        pm_no_street_lighting
        pm_gas_streetlights
        pm_electric_streetlights
    }
}

image Texture exists in: \<steamapps>\Victoria 3\game\gfx\interface\icons\generic_icons\mixed_icon_base.dds

Here an example of a modded script and texture:

mana = {
    texture = "gfx/interface/icons/goods_icons/mana_crystals.dds"
    cost = 30
    category = staple
    tradeable = no

    prestige_factor = 8

    consumption_tax_cost = 200
}

image Texture exists in: \<project>\mod\gfx\interface\icons\goods_icons\mana_crystals.dds

IDE Setup: image

Regards,

Chris

DragonKnightOfBreeze commented 3 weeks ago

image

DragonKnightOfBreeze commented 3 weeks ago

This issue is finally caused by the game/ path prefix in plugin builtin configs which are forked from cwtools-vic3-config repo, with no more compatible processing.

Plugin should work fine if you remove these game/ path prefixes in your local config files.

DragonKnightOfBreeze commented 3 weeks ago

This issue is finally caused by the game/ path prefix in plugin builtin configs which are forked from cwtools-vic3-config repo, with no more compatible processing.

Plugin should work fine if you remove these game/ path prefixes in your local config files.

Sorry I'm not sure this is right, but plugin should do more compatible work for cwt configs indeed. Like upper case identifiers (ROOT = COUNTRY, and the possible game/ path prefix ...)

kaiser-chris commented 3 weeks ago

Sorry but I modified the CWT for goods. For me it is only filepath. Missed adding it to my post.

I tested modifying the CWT files and when I use texture = filepath[game] base game images are found but not modded ones. And if I just use texture = filepath, the mod images are found but not base game images.

Also because you mentioned it in a deleted post. Here are my launcher settings:

{
    "formatVersion": 1.1,
    "gameId": "victoria3",
    "displayName": "Victoria 3",
    "version": "1.7.5 (Kahwah)",
    "rawVersion": "1.7.5",
    "distPlatform": "steam",
    "ingameSettingsPath": "pdx_settings.json",
    "gameDataPath": "%USER_DOCUMENTS%/Paradox Interactive/Victoria 3",
    "modPath": "mod",
    "modExtension": "zip",
    "modStubberPath": "../binaries/victoria3.exe",
    "modStubberData": { 
        "args": [ "--mod_stubber" ],
        "type": "MOD_NAME_PROMPT"
    },
    "isLooseFilesModSupported": true,
    "distPlatformModsEnabled": true,
    "dlcPath": "../game",
    "ingameSettingsLayoutPath": "settings-layout.json",
    "themeFile": "./assets/theme-settings.json",
    "browserDlcUrl": "",
    "browserModUrl": "",
    "exePath": "../binaries/victoria3.exe",
    "exeArgs": [ "-gdpr-compliant" ],
    "alternativeExecutables": [
            {
        "label": {
            "de": "Spiel im Debug-Modus öffnen",
            "en": "Open game in Debug Mode",
            "es": "Abrir juego en modo de depuración",
            "fr": "Ouvrir le jeu en mode débogage",
            "ja": "デバッグモードでゲームを開",
            "ko": "디버그 모드로 게임 열기",
            "pl": "Uruchom grę w trybie debugowania",
            "pt": "Abrir jogo em modo debug",
            "ru": "Запустить игру в режиме разработчика",
            "zh-hans": "以调试模式打开游戏"
        },
        "exePath": "../binaries/victoria3.exe",
        "exeArgs": [ "-gdpr-compliant","-debug_mode" ]
        }
    ]
}
DragonKnightOfBreeze commented 3 weeks ago

Paradox-Language-Support-1.3.19.zip

Hi, I just uploaded a pre-release of 1.3.19, please check this. (IDE should reindex after plugin updated)

kaiser-chris commented 3 weeks ago

Hi it seems to work and it does not at the same time:

Path working and clickable: image

Warning that the file does not exist: image

What I tried:

EDIT: modded files still fully work

DragonKnightOfBreeze commented 3 weeks ago

The code logic about paradox path aka path shown in quick documentation may need to be refactored, for, some how, there are some entry paths (so named in plugin code) in different games. e.g, for Stellaris, pdx_online_assets is an entry path.

DragonKnightOfBreeze commented 3 weeks ago

Think of the file <gameRootPath>/pdx_online_assets/gfx/interface/online_feed_background.dds, Can it be referenced by pdx_online_assets/gfx/interface/online_feed_background.dds or gfx/interface/online_feed_background.dds, or by pdx_online_assets/gfx/interface/online_feed_background.dds everywhere and by gfx/interface/online_feed_background.dds under pdx_online_assets.

I may need ask tboby or pdx for this question.

DragonKnightOfBreeze commented 3 weeks ago

Paradox-Language-Support-1.3.19.zip

kaiser-chris commented 3 weeks ago

Worked like a charm.

Thank you as always!

DragonKnightOfBreeze commented 3 weeks ago

Will be fixed in 1.3.19, but code logic about file path may need to be refactored in the future