CnCNet / WorldAlteringEditor

Map editor for C&C: Red Alert 2, C&C: Tiberian Sun and Dawn of the Tiberium Age.
Other
81 stars 26 forks source link

[Bug] Map editor removes [Countries] section in RA2YR missions when saved, an essential section used by singleplayer houses. #206

Open MikillRosen opened 1 month ago

MikillRosen commented 1 month ago

What lack of RA2YR knowledge does to a mf. I thought the mod I was working on is broken in singleplayer, until I found this bug out after several hours of ditching the mission I was working on.

Obviously, the solution is to make it so the map editor NEVER removes the section.

Rampastring commented 1 month ago

As far as I know, the [Countries] section is unnecessary in RA2+YR unless the map actually has new countries defined. If the map has new countries defined, WAE writes the new map-defined countries to the [Countries] section.

Note that WAE had bugged handling of countries prior to v1.1.2, so you need to have at least that version (and preferably the latest one) for YR singleplayer mapping.

MikillRosen commented 1 month ago

Well, the mission I'm working on doesn't work without the section apparently. Fyi, I'm editing a mission for the Ion Shock mod.

Rampastring commented 1 month ago

I just tried making a basic YR SP map with WAE and it runs without issue, even without a [Countries] section.

MikillRosen commented 1 month ago

Cool, you're not suffering the same issue. What about mine though? I'm not exactly making a new mission from scratch, you know

Rampastring commented 1 month ago

I don't know. It could be an issue with Ion Shock. Or it might be an edge case bug in WAE. Or you might be doing something wrong. Hard to say. I can't realistically provide support for anything but vanilla.

Maybe you could reach out to other YR mappers/modders and figure out why not having [Countries] in the map causes a crash, then add more detail here if there's a valid use-case for having the [Countries] section in a map even when the map does not have new countries defined.

MikillRosen commented 1 month ago

I just tried making a basic YR SP map with WAE and it runs without issue, even without a [Countries] section.

I tested this now, and it seems to work. It seems I'm only getting the issue when I'm editing a mission from another mod (which has a different set of countries) in another mod. I could try to fix the issue myself, but it's technically not broke if all the mission needs is a set [Countries] section, so it's WAE being broke. Even FA2 doesn't remove that section.

Rampastring commented 1 month ago

I have a few questions.

1) What does the [Countries] section look like in RULESMD.INI of Ion Shock?

2) What does the [Countries] section look like in the map before it has been edited with WAE?

3) Could you upload the EXCEPT.TXT file from the game crash?

MikillRosen commented 1 month ago

Ion Shock

[Countries]
0=GDISide
1=SteelTalon
2=ZOCOM
3=NodSide
4=BlackHand
5=MarkedOfKane
6=Scrin
7=Cabal
8=Forgotten
9=Corp
10=Neutral
11=Special
12=Americans

Mission

[Countries]
0=Americans
1=Alliance
2=French
3=Germans
4=British
5=Africans
6=Arabs
7=Confederation
8=Russians
9=YuriCountry
12=Neutral
13=Special

Basically the default selection of countries in YR.

And here's the Except you need, for whatever reason. except.txt

Rampastring commented 1 month ago

I can't replicate the issue in the latest version of WAE. I replicated your setup, and when I save the map, WAE writes the [Countries] section for me, including only the new countries present in the map. I also discussed it with @ZivDero and he can't find a problem either.

That being said, I suggest you clean up the section in the map. The game concatenates the sections on load, and your sections contain duplicate entries compared to the rulesmd.ini list, making it hard to follow. FinalAlert2 seems to also parse this kind of a list incorrectly. I wouldn't be surprised if the map has some bugged triggers as a result of this.