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

100 Units Bug

From ModEnc
Revision as of 15:50, 11 August 2004 by 172.183.245.199 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

RA2 and YR (and probably TS and FS as well) are coded in a way that limits the number of total buildable VehicleTypes, InfantryTypes, and probably AircraftTypes as well, to 100 units each. If you have a buildable object on a place after 100, the AI will think that is the only unit buildable and create it over and over again. Literally. It will continue building until there is no money left or you stop it. This bug can partly be avoided, see below for details.

Avoiding the 100 unit bug (by DCoder)

Look at your [InfantryTypes] and [VehicleTypes]. How many entries do they have? If there's more than 100 buildable units (those without TechLevel=-1) and the're not all in the first 100 lines of the list, the AI will go nuts - it'll build the last unit in the list non-stop, and won't attack. To avoid it, you'll need to rearrange these lists, put buildable units first and the civilian and dummy units in the very end. I personally sorted it like this:

[VehicleTypes]

1=AMCV
2=MTNK
3=CARRIER
4=DEST
5=AEGIS
6=LCRF
7=SHAD
8=DLPH
9=TNKD
10=HOWI
11=CMIN
12=SREF
13=MGTK
14=FV
15=BFRT
16=ROBO
17=HARV
18=APOC
19=HTNK
20=SAPC
21=DISK
22=V3
23=ZEP
24=DRON
25=HTK
26=SUB
27=DRED
28=SQD
29=SMCV
30=TTNK
31=HYD
32=VLAD
33=DTRUCK
34=SCHP
35=LTNK
36=YHVR
37=PCV
38=SMIN
39=YTNK
40=TELE
41=CAOS
42=BSUB
43=MIND
[notice the gap here]
101=CAR
102=BUS
103=WINI
104=PICK
105=CMON
106=TRUCKA
107=TRUCKB
108=XCOMET
109=DeathDummy
110=PROPA
111=CONA
112=COP
113=EUROC
114=LIMO
115=STANG
116=SUVB
117=SUVW
118=TAXI
119=PTRUCK
120=CRUISE
121=TUG
122=CDEST
123=SMON
124=YCAB
125=DDBX
126=BCAB
127=JEEP
128=UTNK
129=YDUM
130=SCHD
131=DOLY
132=CBLC
133=FTRK
134=AMBU
135=HORV
136=CIVP

Note the allied stuff is first, next soviet and yuri, then there's a gap between 43 and 100 before civilian units are listed. The numbers don't really matter, only the order of the list does. Now I see that I have 43 buildable units, and can still make 57 extra ones without screwing up. Note that HOWI and VLAD are in the buildable units list, because I made them buildable, it's not a mistake :)