ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Making The YR Singleplayer Campaign Work With Your Mod

From ModEnc
Revision as of 14:28, 6 February 2006 by Whiteboy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is really an expansion and enlightenment of CannisRabidus' tutorial on the subject.




When making a mod for YR (and indeed, for RA2 as the case may be) there will come a time when the playability of singleplayer Campaign mode comes into question. Most mods simply ignore this game mode. However, it can prove to enhance a mod.

Unfortunately, due to the structure of the game, simply adding any new [BuildingTypes] to the list in the Rules(md).ini file will actually prevent players from being able to accomplish missions in Campaign mode. This is due to the fact that quite a few of the campaign maps (a single mission) define their own [BuildingTypes] and actually append them to the end of the list in your rules(md).ini file. This list will remain the same throughout Campaign mode even if you save the game and load it later - meaning that the list will never be overwritten by other [BuildingTypes]; rather, the list will simply grow larger towards the end of the Campaign saved game.

Now, the way missions are completed is through the use of triggers which detect when the player performs a certain task; e.g. has destroyed X unit, or captured all X buildings. These triggers are what lets the player actually complete a mission. Some of these triggers are based on [BuildingTypes] - the buildings that the map defines. At least that is the intention. Fact is, when a mod adds new [BuildingTypes], it effectively means that the newly defined buildigns in Campaign maps are added to the end of the list - and stupidly enough, the triggers that rely on buildings being captured/destoryed etc. are coded to only refer to the end of the default[BuildingTypes]list: entries 403 - 430. It is important to remember that the numbers next to each [BuildingType] are irellevant - only the order of the list matters.

This means that any new buildings your mod adds on will be read by the Campaign map triggers. And of course, they are not the correct buildings (the correct ones will be appended AFTER your own [BuildingTypes]). Hence, missions that rely on triggers relating to buildings cannot be completed, since the trigger conditions are never met.




The tutorial above offers solutions that work, but are are arguably limited or impractical, depending on the situation. However, there is a debatably much better way to make Campaigns work with your mod. One might assume simply adding the campaign [BuildingTypes] to your Rules(md).ini file should fix this. However, that is only half the solution.

DCoder, with testing by Whiteboy and HopalongTom within a development stage of the "Whiteboy's Rules" mod have made the process of making Campaign mode work with your mod a reality.