Editor - not using relative paths for all *.cgn data files !

Post bug reports and ask for help with other issues here.
Post Reply
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

Editor - not using relative paths for all *.cgn data files !

Post by DarkHorse2 »

Edit - I meant to post this in the "Technical Support" forum....

:oops:

BACKGROUND
This is my typical workflow....
1. I have a local directory mapped to a remote github repository as:

c:\<local dir name>\<remote repo name>\_<scenario name>\....

(i know it is hard to visualize without seeing a better example....)

The following would be an example...
  • c:\<local dir name>\Storm Over Europe(Mod 3).cgn
  • c:\<local dir name>\Storm Over Europe\_Storm Over Europe(Mod 3)\
Accordingly, c:\<local dir name>\<remote repo name>\ has been structure to correlate to:
My Games\Strategic Command WWII - War in Europe\Campaigns\

2. When editing a scenario, I work against the local repo directory.

3. When done, those changes are saved and the updated scenario is "installed" by copying the entire contents of
  • c:\<local dir name>\<remote repo name>\_<scenario name>\ and
  • c:\<local dir name>\<remote repo name>\<scenario name>.cgn
to:
My Games\Strategic Command WWII - War in Europe\Campaigns\

TLDR Summary:
I keep a mirror copy of scenario work in a different directory other than:
My Games\Strategic Command WWII - War in Europe\Campaigns\

ISSUE
The previous, so far, has worked fine and the Scenario Editor uses "relative paths" accordingly, with the exception of: localization.txt

In this case, when editing the scenario, it does not use a relative path for this file, but the absolute path of:
My Games\Strategic Command WWII - War in Europe\Campaigns\_<scenario name\localization.txt

:o

So, changes to c:\<local dir name>\<remote repo name>\_<scenario name>\localization.txt are NOT picked up when editing
the c:\<local dir name>\<remote repo name>\<scenario name>.cgn file.

Instead, those changes are ignored and the editor uses My Games\Strategic Command WWII - War in Europe\Campaigns\_<scenario name\localization.txt.

:(

CONCLUSION


The scenario editor is mixing "relative paths" and "absolute paths" for the associated scenario data files.

:cry:
Last edited by DarkHorse2 on Sun Aug 04, 2024 4:35 pm, edited 1 time in total.
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

Re: Editor - not using relative paths for all *.cgn data files !

Post by DarkHorse2 »

It took me a while to figure all this out and I had to work backwards to verify.


This is an example of the editor using the wrong unit name, when it should be using the string "Testing..." for the unit, but it is using the string content in the wrong "localization.txt" file.


SC3_WrongUnitTextName.jpg
SC3_WrongUnitTextName.jpg (21.28 KiB) Viewed 292 times
SC3_LocalizationSnippet.jpg
SC3_LocalizationSnippet.jpg (33.93 KiB) Viewed 292 times
User avatar
Hubert Cater
Posts: 6052
Joined: Mon Jul 22, 2013 11:42 am
Contact:

Re: Editor - not using relative paths for all *.cgn data files !

Post by Hubert Cater »

If you move and rename the campaign file, it has to be done within the Editor, as the Editor saves the 'filename' for internal use.

Just throwing this out there in case it applies, e.g. if you are manually moving and renaming the file, then it might not work as there might be a mismatch with the filename stored internally within the campaign via the Editor, and with the actual filename on your PC.
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

Re: Editor - not using relative paths for all *.cgn data files !

Post by DarkHorse2 »

This is worse than what I initially realized.

Much worse - which just reinforces my initial bug report of inappropriately mixing relative paths and absolute paths.

For example, I can open the *.cgn file from any directory, such as:
C:\Project\Scenario.cgn

But doing so (I just now discovered), it checks for various Event and AI files in the "Absolute" directories of:
C:\Users\<user>\Documents\My Games\Strategic Command WWII - War in Europe\Campaigns\_<Scenario>\Scripts\AI\
C:\Users\<user>\Documents\My Games\Strategic Command WWII - War in Europe\Campaigns\_<Scenario>\Scripts\Events\

But the editor is monitoring the "Relative Path" for file changes....
.\_<Scenario>\Scripts\AI\
.\_<Scenario>\Scripts\Events\

Like after I modify:
C:\Project\_<Scenario>\Scripts\AI\Guard.txt
RelativePathGuard.jpg
RelativePathGuard.jpg (106.23 KiB) Viewed 257 times
:?: :?: :?:

This is very bad....
Last edited by DarkHorse2 on Mon Aug 05, 2024 7:04 pm, edited 2 times in total.
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

Re: Editor - not using relative paths for all *.cgn data files !

Post by DarkHorse2 »

Additionally, editor changes to the Unit Names list are wrote out to the "Relative" Path of

.\Text\EN\Units.txt
DarkHorse2
Posts: 1070
Joined: Fri Feb 04, 2022 12:08 pm

Re: Editor - not using relative paths for all *.cgn data files !

Post by DarkHorse2 »

This is after opening the script dialog box here:
ScriptDialogBox.jpg
ScriptDialogBox.jpg (309.35 KiB) Viewed 246 times

Editor_File_Access.jpg
Editor_File_Access.jpg (845.47 KiB) Viewed 246 times
User avatar
Hubert Cater
Posts: 6052
Joined: Mon Jul 22, 2013 11:42 am
Contact:

Re: Editor - not using relative paths for all *.cgn data files !

Post by Hubert Cater »

For custom campaigns, the Editor will be looking for and assuming the files are in the USER 'My Documents' folder, hope this helps.

Hubert
Post Reply

Return to “Tech Support”