A STATS.ids fix to handle more stats.
Here is the description of a working implementation of expanded stats. What exactly do you want to do with new stats? At the moment, new stats are generic without any hard-code.
-----Expanded Stats [M]
Allows modders to extend STATS.IDS to use opcodes 202-SHRT_MAX (32767)
Features of new stats:
-New stats can be set using effect opcode 318 (0x13E) with description below
-New stats can be checked correctly using CheckStat(), CheckStatLT(), and CheckStatGT() script triggers
-New stats are not permanent, they require an ongoing effect opcode 318 in order to keep their values
-In order to make a new stat semi-permanent, you can set an extremely long duration for the effect, or use timing mode 10 and set duration to INT_MAX (2147483647)
-New stats will only be saved in saved games if stored as an effect opcode 318
-Actions cannot directly set the value of new stats (they will not keep); use an action to trigger effect opcode 318 if actions are required
-New stats have no effect on the game unless you specifically script in; for example, use scripts to CheckStat() and apply appropriate actions
Description
#318 (0x13E) Stat: Set stat [318]
Parameter #1: Statistic Modifier
Parameter #2 low: Stat Opcode
Parameter #2 high: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field to the opcode specified by the 'Stat Opcode' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Value = Value + 'Statistic Modifier' value
1 Flat Value Modifier -> Value = 'Statistic Modifier' value
2 Percentage Modifier -> Value = (Value * 'Statistic Modifier' value) / 100
3 Multiplicative Modifier -> Value = Value * 'Statistic Modifier' value
4 Divisive Modifier -> Value = Value / 'Statistic Modifier' value
5 Modulus Modifier -> Value = Value % 'Statistic Modifier' value
6 Logical AND Modifier -> Value = Value && 'Statistic Modifier' value
7 Logical OR Modifier -> Value = Value || 'Statistic Modifier' value
8 Bitwise AND Modifier -> Value = Value & 'Statistic Modifier' value
9 Bitwise OR Modifier -> Value = Value | 'Statistic Modifier' value
10 Inverse Modifier -> Value = !Value
Note: You cannot set any stats with opcode < 301 with this effect. New stats 202-300 are reserved for new hard-coded stats.
Options:
-0: disabled
-1: enabled
Edited by Ascension64, 15 January 2011 - 02:21 PM.