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

Difference between revisions of "Making The YR Singleplayer Campaign Work With Your Mod"

From ModEnc
Jump to: navigation, search
m (Some corrections)
Line 6: Line 6:
 
----
 
----
  
 +
=== The Problem ===
  
 
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.
 
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.
Line 26: Line 27:
 
First, you'll want to add all the buildings that Campaign mode creates to your Rules file. To save you the trouble of looking up all the mission maps that are defined, DCoder has saved us the trouble and done it for us. Now, we'll have to add them into a part of the [[BuildingTypes]] array that never changes - simply adding them after your mod's new buildings won't work. We need to re-organise the list. The current structure will most likely be the default list, then your mod's ones. You have a choice here - the default list is actually a little broken. You ''could'' stick with the current list and add on the Campaign buildings and your mod's ones, in that order. But I highly suggest you replace the default [[BuildingTypes]] list with the fixed one. I will explain this process basedon the fixed list, I suggest you do too, otherwise editing some triggers later on will differ slightly.
 
First, you'll want to add all the buildings that Campaign mode creates to your Rules file. To save you the trouble of looking up all the mission maps that are defined, DCoder has saved us the trouble and done it for us. Now, we'll have to add them into a part of the [[BuildingTypes]] array that never changes - simply adding them after your mod's new buildings won't work. We need to re-organise the list. The current structure will most likely be the default list, then your mod's ones. You have a choice here - the default list is actually a little broken. You ''could'' stick with the current list and add on the Campaign buildings and your mod's ones, in that order. But I highly suggest you replace the default [[BuildingTypes]] list with the fixed one. I will explain this process basedon the fixed list, I suggest you do too, otherwise editing some triggers later on will differ slightly.
  
You'll also find this fixed list, and more, on the [[BuildingTypes]] page. Simply remove all of the default building entries in the list in the rules file and replace it with this one:
+
You'll also find this fixed list, and more, on the [[BuildingTypes]] page. Simply remove all of the default building entries in the list in the rules file and replace it with [[BuildingTypes#For_Yuri's_Revenge|this one]]. The next stage is to add the Campaign buildings. They will go right after the entries above - this way they always stay in the same place in the array during a Campaign no matter how many new buildings you may create for your mod. Add these entries to the list above, keeping the comments or not:
 
 
 
 
=== Yuri's Revenge Fixed BuildingTypes List ===
 
 
 
[BuildingTypes]
 
0=GAPOWR
 
1=GAREFN
 
2=GACNST
 
3=GAPILE
 
4=GASAND
 
5=GADEPT
 
6=GATECH
 
7=GAWEAP
 
8=CALAB
 
9=NAPOWR
 
10=NATECH
 
11=NAHAND
 
12=GAWALL
 
13=NARADR
 
14=NAWEAP
 
15=NAREFN
 
16=NAWALL
 
17=CAHSE07
 
18=NAPSIS
 
19=CASYDN01
 
20=NALASR
 
21=NASAM
 
22=CASYDN02
 
23=GAYARD
 
24=NAIRON
 
25=NACNST
 
26=NADEPT
 
27=GACSPH
 
28=GADUMY
 
29=GAWEAT
 
30=CABHUT
 
31=GALITE
 
32=REDLAMP
 
33=GRENLAMP
 
34=BLUELAMP
 
35=YELWLAMP
 
36=PURPLAMP
 
37=INORANLAMP
 
38=INGRNLMP
 
39=INREDLMP
 
40=INBLULMP
 
41=CITY01
 
42=CITY02
 
43=CITY03
 
44=CITY04
 
45=CITY05
 
46=CITY06
 
47=CAHOSP
 
48=INGALITE
 
49=INYELWLAMP
 
50=INPURPLAMP
 
51=NEGLAMP
 
52=NEGRED
 
53=TESLA
 
54=NAMISL
 
55=ATESLA
 
56=CAMACH
 
57=TSTLAMP
 
58=CASYDN03
 
59=AMMOCRAT
 
60=GAGREEN
 
61=NAYARD
 
62=GASPYSAT
 
63=GAGAP
 
64=GTGCAN
 
65=NANRCT
 
66=GAPILL
 
67=NAFLAK
 
68=CAOUTP
 
69=CATHOSP
 
70=CAAIRP
 
71=CAOILD
 
72=NACLON
 
73=GAOREP
 
74=CACITY01
 
75=CACITY02
 
76=CACITY03
 
77=CACITY04
 
78=CANEWY01
 
79=CANEWY04
 
80=CANEWY05
 
81=CASWST01
 
82=CATECH01
 
83=CATEXS01
 
84=CATEXS02
 
85=CAWASH01
 
86=CAFARM01
 
87=CAFARM02
 
88=CALIT01E
 
89=CALIT01N
 
90=CALIT01S
 
91=CALIT01W
 
92=CAMISC01
 
93=CAMISC02
 
94=CAMISC03
 
95=CAMISC04
 
96=CAPOL01E
 
97=CAPOL01N
 
98=CAPOL01S
 
99=CAPOL01W
 
100=CASIN01E
 
101=CASIN01N
 
102=CASIN01S
 
103=CASIN01W
 
104=CAPARS01
 
105=GAAIRC
 
106=CAFRMA
 
107=CAFRMB
 
108=CAWASH05
 
109=CAWASH04
 
110=CAWASH03
 
111=CAWASH07
 
112=CAWASH11
 
113=CAWSH12
 
114=CAWASH14
 
115=CAWASH09
 
116=CAWASH10
 
117=CAWASH13
 
118=CAARMY01
 
119=CAUSFGL
 
120=CAWASH08
 
121=CALIT03E
 
122=CALIT03N
 
123=CALIT03S
 
124=CALIT03W
 
125=CALIT02L
 
126=CALIT02R
 
127=CAHSE01
 
128=CAWT01
 
129=CATS01
 
130=CABARN02
 
131=CAWA2A
 
132=CAWA2B
 
133=CAWA2C
 
134=CAWA2D
 
135=AMRADR
 
136=CAPRS03
 
137=CAGARD01
 
138=CARUS01
 
139=CAMIAM01
 
140=CATRAN01
 
141=CAMIAM02
 
142=CANWY05
 
143=MAYAN
 
144=CAEUR1
 
145=CAEUR2
 
146=CAEUR04
 
147=CAMEX01
 
148=CARUS02A
 
149=CARUS02B
 
150=CARUS02C
 
151=CARUS02D
 
152=CARUS02E
 
153=CARUS02F
 
154=CANEWY06
 
155=CANEWY07
 
156=CANEWY08
 
157=CAPARS02
 
158=CAPARS08
 
159=CAPARS09
 
160=CARUS03
 
161=CANEWY10
 
162=CANEWY11
 
163=CANEWY12
 
164=CANEWY13
 
165=CANEWY14
 
166=CANEWY15
 
167=CANEWY16
 
168=CANEWY17
 
169=CANEWY18
 
170=CAPARS04
 
171=CAPARS05
 
172=CAPARS06
 
173=CAPARS07
 
174=CAWASH15
 
175=CAPARS10
 
176=CAPARS13
 
177=CAPARS14
 
178=CAGAS01
 
179=CAPARS11
 
180=CAPARS12
 
181=CAFARM06
 
182=CAMIAM04
 
183=NAPSYB
 
184=NAPSYA
 
185=CAIND01
 
186=CACOLO01
 
187=CANWY09
 
188=CANWY22
 
189=CANWY23
 
190=CANWY24
 
191=CANWY25
 
192=CANWY26
 
193=CATEXS03
 
194=CATEXS04
 
195=CATEXS05
 
196=CARUS02G
 
197=CACHIG04
 
198=CAMIAM03
 
199=CARUS07
 
200=CATEXS06
 
201=CATEXS07
 
202=CATEXS08
 
203=CACHIG01
 
204=CACHIG02
 
205=CACHIG03
 
206=CAWASH16
 
207=CAWASH17
 
208=CACHIG05
 
209=CAWASH19
 
210=CARUS08
 
211=CARUS09
 
212=CARUS10
 
213=CARUS11
 
214=CANEWY20
 
215=CANEWY21
 
216=CARUS04
 
217=CARUS05
 
218=CARUS06
 
219=CAMSC01
 
220=CAMSC02
 
221=CAMSC03
 
222=CAMSC04
 
223=CAMSC05
 
224=CAMSC06
 
225=CAMSC07
 
226=CAWASH18
 
227=CAEURO05
 
228=CAPARK01
 
229=CAPARK02
 
230=CAPARK03
 
231=CAHSE02
 
232=CAHSE03
 
233=CAHSE04
 
234=CASTRT01
 
235=CASTRT02
 
236=CASTL01
 
237=CASTL02
 
238=CASTL03
 
239=CASTL04
 
240=CAHSE05
 
241=CAHSE06
 
242=CAMIAM05
 
243=CAMIAM06
 
244=CAMIAM07
 
245=CAFNCB
 
246=CAFNCW
 
247=CAMEX02
 
248=CAMEX03
 
249=CAMEX04
 
250=CAMEX05
 
251=CACHIG06
 
252=CAMSC08
 
253=CAMSC09
 
254=CAARMY02
 
255=CAARMY03
 
256=CAARMY04
 
257=TEMMORLAMP
 
258=TEMDAYLAMP
 
259=TEMDUSLAMP
 
260=TEMNITLAMP
 
261=SNOMORLAMP
 
262=SNODAYLAMP
 
263=SNODUSLAMP
 
264=SNONITLAMP
 
265=CAKRMW
 
266=CARUFGL
 
267=CAFRFGL
 
268=CATRAN02
 
269=CACUFGL
 
270=CASKFGL
 
271=CALBFGL
 
272=CAMIAM08
 
273=CAMISC05
 
274=CAMISC06
 
275=CASTL05A
 
276=CASTL05B
 
277=CASTL05C
 
278=CASTL05D
 
279=CASTL05E
 
280=CASTL05F
 
281=CASTL05G
 
282=CASTL05H
 
283=CAMSC10
 
284=CAGEFGL
 
285=CAUKFGL
 
286=CAWASH06
 
287=CAMSC11
 
288=CAMSC12
 
289=CAMSC13
 
290=CAPOFGL
 
291=CAMSC12A
 
292=CAMOV01
 
293=CAMOV02
 
294=CABUNK01
 
295=CABUNK02
 
296=CAFNCP
 
297=CASTRT03
 
298=CASTRT04
 
299=CASTRT05
 
300=YACNST
 
301=YAPOWR
 
302=YABRCK
 
303=YAWEAP
 
304=YAYARD
 
305=YADEPT
 
306=YATECH
 
307=GAFWLL
 
308=YAGGUN
 
309=YAPSYT
 
310=NAINDP
 
311=YAGRND
 
312=YAGNTC
 
313=CASLAB
 
314=CATIME
 
315=YAPPET
 
316=CALOND04
 
317=CALOND05
 
318=CALOND06
 
319=CAMOON01
 
320=CATRAN03
 
321=CAEAST01
 
322=CAEGYP01
 
323=CAEGYP02
 
324=CAEGYP03
 
325=CALA01
 
326=CALA02
 
327=CALA03
 
328=CALA04
 
329=CALA05
 
330=CALOND01
 
331=CALOND02
 
332=CALOND03
 
333=CAMORR01
 
334=CAMORR02
 
335=CAMORR03
 
336=CASANF01
 
337=CASANF02
 
338=CASANF03
 
339=CASANF04
 
340=CASANF05
 
341=CASEAT01
 
342=NATBNK
 
343=GAGATE_A
 
344=CASANF09
 
345=CASANF10
 
346=CASANF11
 
347=CASANF12
 
348=CASANF13
 
349=CASANF14
 
350=CASANF06
 
351=CASANF07
 
352=CASANF08
 
353=CASEAT02
 
354=YACOMD
 
355=YAPPPT
 
356=GAROBO
 
357=YAREFN
 
358=YAROCK
 
359=NABNKR
 
360=CASANF15
 
361=CASANF16
 
362=CASANF17
 
363=CASANF18
 
364=CASIN03E
 
365=CASIN03S
 
366=CAURB01
 
367=CAURB02
 
368=CAURB03
 
369=CAPOWR
 
370=CALA07
 
371=CAEGYP06
 
372=CALA08
 
373=CAEAST02
 
374=CABARR01
 
375=CABARR02
 
376=CAMORR04
 
377=CAMORR05
 
378=CALA09
 
379=CAEGYP04
 
380=CAEGYP05
 
381=CALA06
 
382=CAMORR06
 
383=CAMORR07
 
384=CAMORR08
 
385=CAMORR09
 
386=CAMORR10
 
387=CATIME01
 
388=CATIME02
 
389=CALA10
 
390=CALA11
 
391=CALA12
 
392=CALA13
 
393=CAPARK04
 
394=CAPARK05
 
395=CAPARK06
 
396=CALA14
 
397=CALA15
 
398=CABUNK03
 
399=CABUNK04
 
400=CALUNR01
 
401=CALUNR02
 
 
 
 
 
You'll now have a fixed list. The next stage is to add the Campaign buildings. They will go right after the entries above - this way they always stay in the same place in the array during a Campaign no matter how many new buildings you may create for your mod. Add these entries to the list above, keeping the comments or not:
 
  
 
=== Campaign Buildings ===
 
=== Campaign Buildings ===
Line 1,157: Line 748:
 
Right, now you have added all the Campaign buildings to your rules file, and your new buildings should be on the end of the [[BuildingTypes]] list. We are halfway there.
 
Right, now you have added all the Campaign buildings to your rules file, and your new buildings should be on the end of the [[BuildingTypes]] list. We are halfway there.
  
The next and final step is to edit the Campaign maps. This is where this method truly shines: you only have to do a small edit to ''one'' map. That map is the first Soviet mission. The partial reason for this is because several mission triggers refer to the same [[BuildingTypes]] that were created in earlier missions. The triggers for other maps can be left as they are because in many cases they refer to not exactly ''all'' of the correct buildings in our list, but ''some'' of them - enough to make the mission still completeable, if harder (e.g. you may have to capture more Power Plants than usual in the first missions). This is because of the fact that many buildings are similar - e.g. the Power Plants seen in the first missions. While the triggers may be "offset" in their referrals thanks to us editing only one mission, they are not "offset" enough to stop us from completing a mission successfully. This is unfortunately not particularly easy to grasp - unless you are confident in your knowledge of how Campaigns, the [[BuildingTypes]] array, and mission triggers all work together. So I'll cut to the important part: what to edit.
+
The next and final step is to edit the Campaign maps. This is where this method truly shines: you only have to do a small edit to ''one'' map. That map is the first Soviet mission. The partial reason for this is because several mission triggers refer to the same [[BuildingTypes]] that were created in earlier missions. The triggers for other maps can be left as they are. Now, I'll cut to the important part: what to edit.
  
 
Let's edit the first Soviet Mission. This is the sole mission that needs editing. You'll find it on your Yuri's Revenge disc. Use the XCC Mixer to open mapsmd03.mix and extract sov01umd.map. Open this with Notepad or whatever your favourite text editor is... and use the "Find" function to find the lines:
 
Let's edit the first Soviet Mission. This is the sole mission that needs editing. You'll find it on your Yuri's Revenge disc. Use the XCC Mixer to open mapsmd03.mix and extract sov01umd.map. Open this with Notepad or whatever your favourite text editor is... and use the "Find" function to find the lines:

Revision as of 17:09, 10 February 2006

This page is really an expansion and enlightenment of CannisRabidus' tutorial on the subject. There is a summary at the bottom of this page for those who do not wish to read the whole document.

See also Campaign Progression



The Problem

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 (unmodded) BuildingTypes list: entries 402 - 429 (assuming that you are modding YR and you have replaced the default BuildingTypes list with the fixed one, found on that very page). It is important to remember that the numbers next to each of the BuildingTypes are irrelevant - only the order of the list matters. For more information, take a look at How Object Arrays Work.

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 this process a reality - this is the easy way of making your mod compatible with Campaign mode.

First, you'll want to add all the buildings that Campaign mode creates to your Rules file. To save you the trouble of looking up all the mission maps that are defined, DCoder has saved us the trouble and done it for us. Now, we'll have to add them into a part of the BuildingTypes array that never changes - simply adding them after your mod's new buildings won't work. We need to re-organise the list. The current structure will most likely be the default list, then your mod's ones. You have a choice here - the default list is actually a little broken. You could stick with the current list and add on the Campaign buildings and your mod's ones, in that order. But I highly suggest you replace the default BuildingTypes list with the fixed one. I will explain this process basedon the fixed list, I suggest you do too, otherwise editing some triggers later on will differ slightly.

You'll also find this fixed list, and more, on the BuildingTypes page. Simply remove all of the default building entries in the list in the rules file and replace it with this one. The next stage is to add the Campaign buildings. They will go right after the entries above - this way they always stay in the same place in the array during a Campaign no matter how many new buildings you may create for your mod. Add these entries to the list above, keeping the comments or not:

Campaign Buildings

402=CAPOWR01 ;From all01umd (Allied Mission 1)
403=CAPOWR02
404=CAPOWR03
405=CAPOWR04
406=CAPOWR05
407=CAPOWR06
408=CAPOWR07
409=CAPOWR08
410=CAPOWRAA ;From all03umd (Allied Mission 3)
411=CAPOWRAB
412=CAPOWRAC
413=CAPOWRAD
414=CAPOWRTA
415=CAPOWRTB
416=CAPOWRTC
417=CAPOWRTD
418=CAPOWRTE
419=CAPOWRTF
420=CARUS08A ;From all06umd (Allied Mission 6)
421=CARUS09A
422=CARUS10A
423=CARUS11A
424=GAPOWRA ;From sov01umd  (Soviet Mission 1)
425=GAPOWRB
426=GAPOWRC
427=GAPOWRD
428=GAPOWRE
429=GAPOWRF ;End of default/Campaign BuildingTypes


You'll also have to add the sections for each of these, but first, the new BuildingTypes that your mod brings to the game will need to be appended to the end of the list - starting from 430=. After you have done that, it's time for more code - place this anywhere in your rules file and edit at your own risk (with comments or otherwise):


Campaign Building Sections

;******* ALLIED CAMPAIGN *******
; From all01umd
; 402=CAPOWR01 start
[CAPOWR01]
UIName=Name:GAPOWR
Name=Tech01
Image=CAPOWR
TechLevel=-1
Strength=800
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 402=CAPOWR01 end
; 403=CAPOWR02 start
[CAPOWR02]
UIName=Name:GAPOWR
Name=Tech02
Image=CAPOWR
TechLevel=-1
Strength=800
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 403=CAPOWR02 end
; 404=CAPOWR03 start
[CAPOWR03]
UIName=Name:GAPOWR
Name=Tech03
Image=CAPOWR
TechLevel=-1
Strength=800
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 404=CAPOWR03 end
; 405=CAPOWR04 start
[CAPOWR04]
UIName=Name:GAPOWR
Name=Tech04
Image=CAPOWR
TechLevel=-1
Strength=800
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 405=CAPOWR04 end
; 406=CAPOWR05 start
[CAPOWR05]
UIName=Name:GAPOWR
Name=Tech05
Image=CAPOWR
TechLevel=-1
Strength=800
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 406=CAPOWR05 end
; 407=CAPOWR06 start
[CAPOWR06]
UIName=Name:GAPOWR
Name=Tech06
Image=CAPOWR
TechLevel=-1
Strength=800
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 407=CAPOWR06 end
; 408=CAPOWR07 start
[CAPOWR07]
UIName=Name:GAPOWR
Name=Tech07
Image=CAPOWR
TechLevel=-1
Strength=800
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 408=CAPOWR07 end
; 409=CAPOWR08 start
[CAPOWR08]
UIName=Name:GAPOWR
Name=Tech08
Image=CAPOWR
TechLevel=-1
Strength=800
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 409=CAPOWR08 end
; From all03umd
; 410=CAPOWRAA start
[CAPOWRAA]
UIName=Name:GAPOWR
Name=TechAA
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 410=CAPOWRAA end
; 411=CAPOWRAB start
[CAPOWRAB]
UIName=Name:GAPOWR
Name=TechAB
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 411=CAPOWRAB end
; 412=CAPOWRAC start
[CAPOWRAC]
UIName=Name:GAPOWR
Name=TechAC
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 412=CAPOWRAC end
; 413=CAPOWRAD start
[CAPOWRAD]
UIName=Name:GAPOWR
Name=TechAD
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 413=CAPOWRAD end
; 414=CAPOWRTA start
[CAPOWRTA]
UIName=Name:GAPOWR
Name=TechTA
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 414=CAPOWRTA end
; 415=CAPOWRTB start
[CAPOWRTB]
UIName=Name:GAPOWR
Name=TechTB
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 415=CAPOWRTB end
; 416=CAPOWRTC start
[CAPOWRTC]
UIName=Name:GAPOWR
Name=TechTC
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 416=CAPOWRTC end
; 417=CAPOWRTD start
[CAPOWRTD]
UIName=Name:GAPOWR
Name=TechTD
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 417=CAPOWRTD end
; 418=CAPOWRTE start
[CAPOWRTE]
UIName=Name:GAPOWR
Name=TechTE
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 418=CAPOWRTE end
; 419=CAPOWRTF start
[CAPOWRTF]
UIName=Name:GAPOWR
Name=TechTF
Image=CAPOWR
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 419=CAPOWRTF end
; From all06umd
; 420=CARUS08A start
[CARUS08A]
Name=Russian Gum CornerA
UIName=Name:Globe
Image=CARUS08
Strength=1000
TechLevel=-1
Insignificant=yes
Nominal=yes
RadarInvisible=yes
Points=5
Armor=steel
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=10
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris3sm,Dbris9lg,Dbris2lg,Dbris8sm,Dbris3lg
BaseNormal=no
Sight=6
ClickRepairable=no
CanBeOccupied=yes
MaxNumberOccupants=5
CanOccupyFire=yes
LeaveRubble=Yes
; 420=CARUS08A end
; 421=CARUS09A start
[CARUS09A]
Name=Russian Gum MiddleA
UIName=Name:Globe
Image=CARUS09
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
RadarInvisible=yes
Points=5
Armor=steel
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=10
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris3sm,Dbris9lg,Dbris2lg,Dbris8sm,Dbris3lg
BaseNormal=no
Sight=6
ClickRepairable=no
CanBeOccupied=yes
MaxNumberOccupants=5
CanOccupyFire=yes
LeaveRubble=Yes
; 421=CARUS09A end
; 422=CARUS10A start
[CARUS10A]
Name=Russian Gum Wall N_SA
UIName=Name:Globe
Image=CARUS10
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
RadarInvisible=yes
Points=5
Armor=steel
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=10
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris3sm,Dbris9lg,Dbris2lg,Dbris8sm,Dbris3lg
BaseNormal=no
Sight=6
ClickRepairable=no
CanBeOccupied=yes
MaxNumberOccupants=5
CanOccupyFire=yes
LeaveRubble=Yes
; 422=CARUS10A end
; 423=CARUS11A start
[CARUS11A]
Name=Russian Gum Wall E_WA
UIName=Name:Globe
Image=CARUS11
TechLevel=-1
Strength=1000
Insignificant=yes
Nominal=yes
RadarInvisible=yes
Points=5
Armor=steel
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=10
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris3sm,Dbris9lg,Dbris2lg,Dbris8sm,Dbris3lg
BaseNormal=no
Sight=6
ClickRepairable=no
CanBeOccupied=yes
MaxNumberOccupants=5
CanOccupyFire=yes
LeaveRubble=Yes
; 423=CARUS11A end
;========== SOVIET CAMPAIGN ============
; From sov01umd
; 424=GAPOWRA start
[GAPOWRA]
UIName=Name:GAPOWR
Name=Tech Power A
Image=CAPOWR
TechLevel=-1
Strength=5000
Insignificant=no
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 424=GAPOWRA end
; 425=GAPOWRB start
[GAPOWRB]
UIName=Name:GAPOWR
Name=Tech Power B
Image=CAPOWR
TechLevel=-1
Strength=5000
Insignificant=no
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 425=GAPOWRB end
; 426=GAPOWRC start
[GAPOWRC]
UIName=Name:GAPOWR
Name=Tech Power C
Image=CAPOWR
TechLevel=-1
Strength=5000
Insignificant=no
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 426=GAPOWRC end
; 427=GAPOWRD start
[GAPOWRD]
UIName=Name:GAPOWR
Name=Tech Power D
Image=CAPOWR
TechLevel=-1
Strength=5000
Insignificant=no
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 427=GAPOWRD end
; 428=GAPOWRE start
[GAPOWRE]
UIName=Name:GAPOWR
Name=Tech Power E
Image=CAPOWR
TechLevel=-1
Strength=5000
Insignificant=no
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 428=GAPOWRE end
; 429=GAPOWRF start
[GAPOWRF]
UIName=Name:GAPOWR
Name=Tech Power F
Image=CAPOWR
TechLevel=-1
Strength=5000
Insignificant=no
Nominal=yes
Sight=6
Points=5
Armor=concrete
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
MaxDebris=15
MinDebris=5
DebrisAnim=Dbris1sm,Dbris1lg,Dbris4sm,Dbris5sm,Dbris4lg,Dbris7sm,Dbris8sm,Dbris5lg,Dbris4lg
DamageParticleSystems=SmallGreySSys,BigGreySmokeSys
Capturable=yes
NeedsEngineer=yes
Unsellable=yes
Ammo=5
LeaveRubble=yes
Power=200
; 429=GAPOWRF end


Right, now you have added all the Campaign buildings to your rules file, and your new buildings should be on the end of the BuildingTypes list. We are halfway there.

The next and final step is to edit the Campaign maps. This is where this method truly shines: you only have to do a small edit to one map. That map is the first Soviet mission. The partial reason for this is because several mission triggers refer to the same BuildingTypes that were created in earlier missions. The triggers for other maps can be left as they are. Now, I'll cut to the important part: what to edit.

Let's edit the first Soviet Mission. This is the sole mission that needs editing. You'll find it on your Yuri's Revenge disc. Use the XCC Mixer to open mapsmd03.mix and extract sov01umd.map. Open this with Notepad or whatever your favourite text editor is... and use the "Find" function to find the lines:

Default Triggers

0442A5EC=1,32,0,402
0442A4FC=1,32,0,403
0442A40C=1,32,0,404
0442A31C=1,32,0,405
0442A22C=1,32,0,406
0442A13C=1,32,0,407

Those numbers on the end are referring to the physical BuildingTypes array, not the numbers that the buildings = in your list. Indeed, in my own mod my list starts at 1 rather than 0 - yet this will not matter, the same edit is required.

Change that code to:

Edited Triggers

0442A5EC=1,32,0,424
0442A4FC=1,32,0,425
0442A40C=1,32,0,426
0442A31C=1,32,0,427
0442A22C=1,32,0,428
0442A13C=1,32,0,429

And save the map. Place it in your Red Alert 2 folder along with the rest of your mod... or place it in the [Video] section of XCC Mod Creator. You may notice that these six triggers refer to the six Power Plants buildings in the first Soviet Mission in your new BuildingTypes list: from 424=GAPOWRA to 429=GAPOWRF

That is all that needs to be done. Edits to two files. Now you'll find that both campaigns work, albeit very slightly differently. You can add as many new BuildingTypes to your mod as you like - as long as you add them to the end of your list then you will have no problems.



To summarise:

How to get the campaigns working with your mod - the easy way - open your rules file and replace the default [BuildingTypes]] list with the one on that page (or found in the code above). Add the campaign buildings and their sections as in the code above. Add all your mod buildings to the end of the list, and keep in mind any new ones you create in the future will also go on the end. use the XCC Mixer to extract sov01umd.map from mapsmd03.mix. open this file with Notepad and search for the code in the above code ("Default Triggers"). Replace that code with the code in "Edited Triggers". Save the map and add it to your mod...

Much easier than the solutions mentioned on that tutorial page, eh?