CnCNet / xna-cncnet-client

XNA / MonoGame based client for playing classic Command & Conquer games both online and offline with a CnCNet game spawner.
Other
223 stars 86 forks source link

Implement custom mission support with CampaignTagSelector #518

Open SadPencil opened 3 months ago

SadPencil commented 3 months ago

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

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

Apart from the campaign tag selector feature brought by #370, this PR also include a custom mission support.

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.

github-actions[bot] commented 3 months ago

Nightly build for this pull request: