You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I investigated how constants are assigned by 04AF: in San Andreas and used this information to add about 170 entries to constants.txt. I've grouped the constants under the following headings as an example of how the constants might be organized. Of these categories, 3 have potential for decompiling to specific opcodes, bool, sprites and bodyparts.
[GENERAL] - just the timers
[BOOL]=b - added yes and no, enabled and disabled
[SPRITE]=i - radar icons tend to get modded a lot
[BODYPART]=y - where to hang your hat
[TOWN] - town numbers
[RACE] - Race Index
[TOURNAMENT] where the races start
[CARMODS] bodyparts for cars
[PROPERTY] Buy Property Index
[SOUND] easy audio events that play without loading
I was considering adding a set of interior constants but there isn't really a common reference for their names. Historically, Heaven A and Heaven B, etc, I ended up using the name of the first or most dominant interior name associated with that particular heaven in my 010 templates. Either way, reference remains necessary, and is already included with Sanny Help.
Added: Better plan. Enumerate each interior with the appropriate heaven number. These don't need to be resolved so there won't be any conflicts.
I added constants for Interiors, Weather, ZoneType and PedType to the spreadsheet linked above but decided to stick with constants as defined by 04AF: in the current example.
The use of constants would benefit from features like autocomplete, conversions and syntax highlighting.
Syntax Highlighting: I keep running into missing parameter errors as I update my constants. Perhaps, blue like a variable, and bold like a keyword, would help distinguish constants from descriptors.
I like this idea. My constants Sheet can easily be adapted to this format except... currently the period is an illegal character, so I can't switch yet. I think most of the enums from the 010 save template have already been converted.
If enums can be decompiled then I love this idea.
A related issue, do the descriptors, the words in a command that provide context for the data, need to be updated? My impression is that the descriptors haven't really changed much since they were initially used and may not be specific enough in a modern context. For example, 087B uses "body_part" where similar commands use "bodypart."
Also, I've been trying to match my constants with the descriptor in a way that the descriptor can be converted directly into a constant or enum, hopefully with a little help from auto-complete. For example,
087B: set_player $PLAYER_CHAR texture "VEST" model "VEST" Bodypart 0 // updated descriptor
087B: set_player $PLAYER_CHAR texture "VEST" model "VEST" Bodypart.Torso // as suggested
087B: set_player $PLAYER_CHAR texture "VEST" model "VEST" Bodypart Bodypart.Torso // decompiled
Not sure how to resolve the consistent use of caps, but that's the general idea.
this is where typed parameters in the INI file would shine sannybuilder/data#1
If I can add a proper support for custom letters/words in the INI, we could go through the list and tag parameters with the enum name. The decompiler would then be able to display the enum instead of a number.
A related issue, do the descriptors, the words in a command that provide context for the data, need to be updated? My impression is that the descriptors haven't really changed much since they were initially used and may not be specific enough in a modern context. For example, 087B uses "body_part" where similar commands use "bodypart."
feel free to update as needed. I'm all for consistent naming across all games/platforms. As long as parameters order remains unchanged I'm good.
I frequently use this source for enums and other info, and have adapted the naming conventions extensively in my save templates and other references. Since this is a very common reference for GTA in general it would add clarity to the information if the the same general conventions were used.
enums.txt (as defined with the new <enums> entry in the classes.db) now holds the list of enumerated types that are being used for classes parameter types. in the future it 's planned to add the enum support for raw opcodes (see #75).
Activity
OrionSR commentedon Feb 13, 2020
I was considering adding a set of interior constants but there isn't really a common reference for their names. Historically, Heaven A and Heaven B, etc, I ended up using the name of the first or most dominant interior name associated with that particular heaven in my 010 templates. Either way, reference remains necessary, and is already included with Sanny Help.
Added: Better plan. Enumerate each interior with the appropriate heaven number. These don't need to be resolved so there won't be any conflicts.
OrionSR commentedon Feb 14, 2020
I added constants for Interiors, Weather, ZoneType and PedType to the spreadsheet linked above but decided to stick with constants as defined by 04AF: in the current example.
The use of constants would benefit from features like autocomplete, conversions and syntax highlighting.
Syntax Highlighting: I keep running into missing parameter errors as I update my constants. Perhaps, blue like a variable, and bold like a keyword, would help distinguish constants from descriptors.
x87 commentedon Jul 15, 2020
Syntax highlighting for constants had been proposed in #28
x87 commentedon Jul 15, 2020
I'm thinking about adding a proper support for enums: https://en.wikipedia.org/wiki/Enumerated_type In this case it will be a group of constants logically grouped around a single domain.
Possible syntax:
usage:
OrionSR commentedon Jul 15, 2020
I like this idea. My constants Sheet can easily be adapted to this format except... currently the period is an illegal character, so I can't switch yet. I think most of the enums from the 010 save template have already been converted.
If enums can be decompiled then I love this idea.
A related issue, do the descriptors, the words in a command that provide context for the data, need to be updated? My impression is that the descriptors haven't really changed much since they were initially used and may not be specific enough in a modern context. For example, 087B uses "body_part" where similar commands use "bodypart."
Also, I've been trying to match my constants with the descriptor in a way that the descriptor can be converted directly into a constant or enum, hopefully with a little help from auto-complete. For example,
Not sure how to resolve the consistent use of caps, but that's the general idea.
x87 commentedon Jul 15, 2020
this is where typed parameters in the INI file would shine sannybuilder/data#1
If I can add a proper support for custom letters/words in the INI, we could go through the list and tag parameters with the enum name. The decompiler would then be able to display the enum instead of a number.
x87 commentedon Jul 15, 2020
feel free to update as needed. I'm all for consistent naming across all games/platforms. As long as parameters order remains unchanged I'm good.
x87 commentedon Jul 17, 2020
Excellent reference for Rockstar's constants/enums: https://gtamods.com/wiki/SCM_language_III/VC_definitions#Constants
OrionSR commentedon Jul 17, 2020
An excellent source for mining enums is DK22Packs Plug-in SDK, like this example from Radar:
https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CRadar.h
I frequently use this source for enums and other info, and have adapted the naming conventions extensively in my save templates and other references. Since this is a very common reference for GTA in general it would add clarity to the information if the the same general conventions were used.
x87 commentedon Oct 30, 2020
this syntax has been implemented in v3.6
sannybuilder/data@ba3a4ed
enums.txt (as defined with the new
<enums>entry in the classes.db) now holds the list of enumerated types that are being used for classes parameter types. in the future it 's planned to add the enum support for raw opcodes (see #75).x87 commentedon Nov 11, 2020
Added as enums.txt
https://docs.sannybuilder.com/edit-modes/enums.txt