xna-cncnet-client icon indicating copy to clipboard operation
xna-cncnet-client copied to clipboard

Implement custom mission support with CampaignTagSelector

Open SadPencil opened this issue 1 year ago • 11 comments

This PR includes and therefore closes #367 and closes #370, avoiding maintaining too many PRs

This PR works with https://github.com/CnCNet/yrpp-spawner/pull/19

the campaign tag selector

This PR is backward compatible as by default the option is off. Modders can enable the CampaignTagSelectorEnabled option to use this feature.

This feature enables modders to make a "choose your side" interface before the campaign selector. Choosing among "Act 1/Act 2/..." or any other tags is also possible.

The screenshot below shows the feature. (I am not an expert in beautifying user interfaces so it is only a working example. Fully configurable through ini files.)

img1 img2 img3

The modders define tags for missions in battle.ini and customize the selector window in CampaignTagSelector.ini using the new INItializableWindow ini format.

I use TSC v6 client as an example. The corresponding files are attached here.

TSC.v6.example.zip

the custom mission support

Apart from the campaign tag selector feature brought by #370, this PR also include a custom mission support for YR and Ares/Phobos.

Users can drop third-party fan-made singleplayer missions in Maps\CustomMissions folder, like this:

CustomMissions
├── vnsepa.csf # optional
├── vnsepa.map
├── vnsepa.pal # optional
└── vnsepa.shp # optional

This installs a custom mission named vnsepa.

vnsepa.map file is basically a .map file containing campaigns, with the following new-added sectiones:

[CNCNET:MISSION:BATTLE.INI]
CD=2
BuildOffAlly=yes
Scenario=vnsepa.map ; this line will be ignored by the client
Description=vnsepa
Summary=MAP:DESCREDDAWN
Side=0
SideName=Allies
Act=1
LongDescription=Operation: The Separation - Location: Kon Tum, Central Vietnam blah blah

[CNCNET:MISSION:MISSION.INI]
Briefing=Brief:AREDDAWN
ShowBriefing=true
UIName=MAP:TITREDDAWN
LSLoadMessage=LoadMsg:AREDDAWN
LSLoadBriefing=LoadBrief:AREDDAWN
LS640BriefLocX=20
LS640BriefLocY=20
LS800BriefLocX=20
LS800BriefLocY=20
LS640BkgdName=custommission.shp ; the filename is fixed
LS800BkgdName=custommission.shp ; the filename is fixed
LS800BkgdPal=custommission.pal ; the filename is fixed
LoadScreenText.Color=LightGrey

; Map created with FinalAlert 2(tm) Mission Editor
; Get it at http://www.westwood.com
; note that all comments were truncated

The two sections define mission info for the client as well as YR spawner.

To show custom missions, modders need to define a button ButtonTag_CUSTOM in file CampaignTagSelector.ini.

SadPencil avatar Mar 10 '24 11:03 SadPencil

Nightly build for this pull request:

github-actions[bot] avatar Mar 10 '24 11:03 github-actions[bot]