Inventions: Difference between revisions
From sc2k-reverse
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
'''Func Location:''' <code>0042E460</code> | '''Func Location:''' <code>0042E460</code> | ||
In Simcity 2000 during game set up the invention date of each technological development is randomly generated and set in NewGameSetup. These dates are a combination of a | In Simcity 2000 during game set up the invention date of each technological development is randomly generated and set in NewGameSetup. These dates are a combination of a '''Base Year''' for the invention of that technology sourced from an array ('''Array Location:'''<code>004E99E8</code>) and a random number between 0 and 19 of years from that base year. These values are stored in the array '''wCityInventionYears[17]''' ('''pointer:'''<code>0x4CB430</code>) in the same order as the base array. If the randomly determined year is before the founding year of the current game then it's automatically unlocked, otherwise the game will check monthly if it has reached the specified year. | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
for (i=0;i<17;i++) | for (i=0;i<17;i++) | ||
{ | { | ||
InventionDates[i] = rand() % 20 + dataInventionBaseYears[i]; | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 09:36, 20 March 2025
Func Location: 0042E460
In Simcity 2000 during game set up the invention date of each technological development is randomly generated and set in NewGameSetup. These dates are a combination of a Base Year for the invention of that technology sourced from an array (Array Location:004E99E8
) and a random number between 0 and 19 of years from that base year. These values are stored in the array wCityInventionYears[17] (pointer:0x4CB430
) in the same order as the base array. If the randomly determined year is before the founding year of the current game then it's automatically unlocked, otherwise the game will check monthly if it has reached the specified year.
for (i=0;i<17;i++)
{
InventionDates[i] = rand() % 20 + dataInventionBaseYears[i];
}
Invention | Offset | Base Year |
---|---|---|
Gas Power | 0x00 | 1940 |
Nuclear Power | 0x02 | 1950 |
Solar Power | 0x04 | 1980 |
Wind power | 0x06 | 1970 |
Microwave power | 0x08 | 2020 |
Fusion power | 0x0A | 2050 |
Airport | 0x0C | 1920 |
Highways | 0x0E | 1920 |
Bus | 0x10 | 1910 |
Subway | 0x12 | 1900 |
Water treatment | 0x14 | 1925 |
Desalination plant | 0x16 | 1980 |
Plymouth Arco | 0x18 | 1990 |
Forest Arco | 0x1A | 2040 |
DARCO | 0x1C | 2090 |
Launch Arco | 0x1E | 2140 |
Highways | 0x20 | 2190 |