Just make sure to check the INI flags for each civilian unit. All of them have TechLevel=11 or -1, ThreatPosed=0, AmbientSound=xxx, and so on. Keep in mind that fixing it this way also causes some cameos to not show the thing you declared in Image=xxx, due to the engine reading certain units from Art.ini instead.
Just make sure to check the INI flags for each civilian unit. All of them have TechLevel=11 or -1, ThreatPosed=0, AmbientSound=xxx, and so on. Keep in mind that fixing it this way also causes some cameos to not show the thing you declared in Image=xxx, due to the engine reading certain units from Art.ini instead.
==Note==
*Since the method I suggested was removed, because I didn't tell you how to do it all (AI doesn't have enough production cost, why don't you create a money source that players can't create (really stupid)<br>
And later I found a better method, but I didn't tell you for personal reasons, but today I'm going to reveal it<br>
1. You add the tag<br>
{{f|RequiresStolenAlliedTech|yes|link}}<br>
{{f|RequiresStolenSovietTech|yes|link}}<br>
{{f|RequiresStolenThirdTech|yes|link}}<br>
to the unit you want to create alone, but don't want AI to create with it<br>
2. Add the [[PrerequisiteOverride]] tag to that unit, and specify only buildings that human players can build (I won't tell you what tags are used to define this method, but you wouldn't be more stupid than I thought).<br>
Even though the spy didn't enter the lab of all 3 factions, it definitely works<br>
<div><ul>
<li style="display: inline-block;">[[File:PrerequisiteOverride+RequiresStolenAlliedTech+RequiresStolenSovietTech+RequiresStolenThirdTech.gif|frame|I didn't expect you to be dumber than I thought. This gif doesn't make you any smarter. [[Askhati]]]]</li>
</ul></div>
[[Category:Bugs_and_Errors]]
[[Category:Bugs_and_Errors]]
Revision as of 17:40, 31 March 2025
TS, FS, RA2 and YR are coded in a way that limits the number of total buildable VehicleTypes, InfantryTypes, and 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. It will continue building until there is no money left or you stop it. This bug is fixed in RockPatch and Ares for Yuri's Revenge. For Tiberian Sun, TS-Patches fixes it which is used in TS Client. For another solution that partly avoids the bug 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 101 buildable units (those without TechLevel=-1) and they're not all in the first 101 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:
Note the allied stuff is first, next soviet and yuri, then there's a gap between 41 and 101 before civilian units are listed. The numbers don't really matter, only the order of the list does. Now I see that I have 41 buildable units, and can still make 60 extra ones without screwing up. If rules(md).ini has more than 100 units and new units are added in a map, the new units from map are appended to the rules list, in such cases this method fails to avoid the bug.
Note about the list enumeration
Note, the numbers on the left can really be anything. The engine doesn't pay any attention to it, it discards everything to the left of the = sign, and uses its own enumeration, starting at 1 (or possibly zero, but the numeration doesn't make the slightest difference in this case). You can even use stuff like
ALLIEDMCV=AMCV
H4RV3S73R=HARV
7^3-4^2=CMIN
and similar if you want, it makes no difference. But, obviously, using a proper 1-based ordinal enumeration gives you ideas of how many "slots" you stil have available for buildable units.
100 Unit Bug and Online Play: The 100 Units Bug causes Reconnection Errors! (DoctorEvil)
After playtesting an early prototype of a heavily modded survival map of mine (DoctorEvil's Second Pacific Survival to be exact) I have noticed that having a map with the 100 unit bug causes reconnection errors to occur after a while (during an online match via cncnet). I'm not sure on what exactly causes the recon error, but fixing the 100 unit bug also prevents random errors from happening.
The way I fixed the 100 unit bug on my second pacific survival is by overwriting the existing civilian units instead of creating entirely new units.
For example instead of...
Just make sure to check the INI flags for each civilian unit. All of them have TechLevel=11 or -1, ThreatPosed=0, AmbientSound=xxx, and so on. Keep in mind that fixing it this way also causes some cameos to not show the thing you declared in Image=xxx, due to the engine reading certain units from Art.ini instead.
Note
Since the method I suggested was removed, because I didn't tell you how to do it all (AI doesn't have enough production cost, why don't you create a money source that players can't create (really stupid)
And later I found a better method, but I didn't tell you for personal reasons, but today I'm going to reveal it
1. You add the tag RequiresStolenAlliedTech=yes RequiresStolenSovietTech=yes RequiresStolenThirdTech=yes
to the unit you want to create alone, but don't want AI to create with it
2. Add the PrerequisiteOverride tag to that unit, and specify only buildings that human players can build (I won't tell you what tags are used to define this method, but you wouldn't be more stupid than I thought).
Even though the spy didn't enter the lab of all 3 factions, it definitely works