Jump to content

Stat 323 is really "Least Favorite Gang"?


gui7814

Recommended Posts

I was creating a cleo mod that creates a box of additional statistics about gangs (Contained Least Favorite Gang, Strongest Gang, 2nd Strongest Gang and 3nd Strongest Gang), I had made this mod for me to use in conjunction with the thalilmythos mod "Gangs Relationships" Because I didn't like the idea of only knowing which gang the player hates the most when I open the stats menu in the pause menu. in addition to the statistics box, I created a system to show a text box warning which gang was most hating the player, but it turns out that stat 323 does not appear to be "Least Favorite Gang" despite being documented as that in sanny builder, nor the stats ids of the Strongest Gang, 2nd Strongest Gang and 3nd Strongest Gang that were documented in the sanny builder do not seem to be these stats.

 

I went to look in the main.scm that I had decompiled and found that there are opcodes 0629: change_integer_stat [stat id] to 1 with the stat ids being these statistics spread around, and all of them in subs that say "Mission Passed", then you seeing this, you might think that the game changes these stats according to the mission (like: when passing the green saber mission, the game changes the "Strongest Gang" statistic for the Ballas, since they take all the territories of the grove street families) but its not! in a sub of a toreno mission there is "0629: change_integer_stat 320 to 1" and according to sanny builder this would be the "Playing Time" statistic which makes no sense because what would be the reason for the game to reset its "playing time" afterwards to pass this mission? then after all this I went to see if the "Gang Relationships" mod was working well and I saw that even if the Player has Hating Another Gang Besides the Ballas they will hate you and the other gangs themselves will not.

 

before finding out all that I I thought the compiler of sanny builder, cleo, the game or something else had a problem and that's why my mod didn't work, If anyone knows what the true ids of these statistics are then please tell me, before that I had searched the internet about this problem and found nothing...

Edited by gui7814
Changed "Green Mission" to "Green Saber Mission"
Link to comment
Share on other sites

It looks like Sanny's stat IDs are based on the GXT keys that display the name of the stat. For example; (ref)

STAT323  //  Least favorite gang

 

I suspect the actual stat 323 "variable" isn't used or was repurposed later in the game development. There's a good chance that these values are generated as needed for display in the stat menu. You could perform similar calculations to determine gang status.

Edited by OrionSR
Link to comment
Share on other sites

On 7/17/2023 at 3:22 AM, gui7814 said:

but it turns out that stat 323 does not appear to be "Least Favorite Gang" despite being documented as that in sanny builder, nor the stats ids of the Strongest Gang, 2nd Strongest Gang and 3nd Strongest Gang that were documented in the sanny builder do not seem to be these stats.

Back in the day me and OrionSR were trying to create a status monitor for us (He helped me to create Real Time Status Monitor and he developed SideKick for himself later) During modding we managed to test all these stats but some stats seems either broken or dead.. 🙁 i can also prove it by these screenshots below.. 

 

Spoiler

spacer.png

spacer.png

 

Stats between 302 and 342 are broken/dead..

Edited by ArmanCan
Link to comment
Share on other sites

7 hours ago, ArmanCan said:

Back in the day me and OrionSR were trying to create a status monitor for us (He helped me to create Real Time Status Monitor and he developed SideKick for himself later) During modding we managed to test all these stats but some stats seems either broken or dead.. 🙁 i can also prove it by these screenshots below.. 

 

spacer.png

spacer.png

Stats between 302 and 342 are broken/dead..

Do you know where these statistics actually are? I'm starting to think that you can't access them using the stats opcodes, but the write/read memory opcodes.

Link to comment
Share on other sites

4 minutes ago, gui7814 said:

Do you know where these statistics actually are?

i have no idea but all i know is that using them is not possible 🙁

Link to comment
Share on other sites

17 minutes ago, ArmanCan said:

i have no idea but all i know is that using them is not possible 🙁

not even using the write/read memory opcodes?

Link to comment
Share on other sites

46 minutes ago, gui7814 said:

not even using the write/read memory opcodes?

in my attempt i was seeing the stat name but it's value was empty..

Link to comment
Share on other sites

2 hours ago, gui7814 said:

Do you know where these statistics actually are? I'm starting to think that you can't access them using the stats opcodes, but the write/read memory opcodes.

If these stats did exist they'd be included in the stats section. Stats are kind of like global variables that are accessed by the game engine, and independent from the scripts. There's no other place for these values to be maintained in the saved data. 

 

More than likely, what is reported in the stats menu for gangs is generated when needed by comparing data from other stats. You should be able to calculate identical values by reading other data.

Link to comment
Share on other sites

22 hours ago, ArmanCan said:

Stats between 302 and 342 are broken/dead..

It looks like many of these stats, like stat 320, are used to flag various radio episodes.

 

Another example of stats being used as a flag variables for the game engine.

0629: change_integer_stat 337 to 1 // toggles the "territories under control" stat

 

Critical address for calculating least favorite gang info:

int *CStats::PedsKilledOfThisType = (int*)0xB78E90;

The block exists a little before the typical stats block, so you might be able to access the info with negative stat opcodes between -92 and -60.

The block has 32 int32 elements, which probably align with the standard ped types as described in Sanny's SCM documentation.

Edited by OrionSR
Link to comment
Share on other sites

11 hours ago, OrionSR said:

It looks like many of these stats, like stat 320, are used to flag various radio episodes.

 

Another example of stats being used as a flag variables for the game engine.

0629: change_integer_stat 337 to 1 // toggles the "territories under control" stat

 

Critical address for calculating least favorite gang info:

int *CStats::PedsKilledOfThisType = (int*)0xB78E90;

The block exists a little before the typical stats block, so you might be able to access the info with negative stat opcodes between -92 and -60.

The block has 32 int32 elements, which probably align with the standard ped types as described in Sanny's SCM documentation.

I had the idea of creating a cleo script that writes the values of statistics from -342 to 1 in an ini file so that I can later copy the values from the ini file after "least favorite gang" becomes los santos vagos and after "least favourite gang" becomes ballas I opened the file again but this time updated, I copied the contents of the two files and pasted it on a website to compare texts, but it happens according to the files the stats didn't change anything... I tried again and gave the same results...

 

Game stats according to ini file after "least favorite gang" became los santos vagos and before becoming ballas:

-342=0
-341=0
-340=113
-339=883
-338=1101004800
-337=992204554
-336=1159479296
-335=0
-334=1086918619
-333=1065353216
-332=1065353216
-331=1065353216
-330=1065353216
-329=-1110651699
-328=-1110651699
-327=0
-326=0
-325=0
-324=0
-323=0
-322=83
-321=830
-320=1126367232
-319=941481301
-318=1159479296
-317=0
-316=1086918619
-315=1065353216
-314=1065353216
-313=1065353216
-312=1065353216
-311=-1078774989
-310=-1078774989
-309=1
-308=0
-307=0
-306=0
-305=0
-304=83
-303=829
-302=1126367232
-301=941481301
-300=1159479296
-299=0
-298=1086918619
-297=1065353216
-296=1065353216
-295=1065353216
-294=1065353216
-293=-1082130432
-292=-1082130432
-291=1
-290=0
-289=0
-288=0
-287=0
-286=83
-285=832
-284=1126367232
-283=941481301
-282=1159479296
-281=0
-280=1086918619
-279=1065353216
-278=1065353216
-277=1065353216
-276=1065353216
-275=-1083808154
-274=-1083808154
-273=1
-272=0
-271=0
-270=0
-269=0
-268=83
-267=831
-266=1126367232
-265=941481301
-264=1159479296
-263=0
-262=1086918619
-261=1065353216
-260=1065353216
-259=1065353216
-258=1065353216
-257=-1080452710
-256=-1080452710
-255=1
-254=0
-253=0
-252=0
-251=0
-250=83
-249=833
-248=1126367232
-247=941481301
-246=1159479296
-245=0
-244=1086918619
-243=1065353216
-242=1065353216
-241=1065353216
-240=1065353216
-239=-1090519040
-238=-1090519040
-237=1
-236=0
-235=0
-234=0
-233=0
-232=83
-231=834
-230=1126367232
-229=941481301
-228=1159479296
-227=0
-226=1086918619
-225=1065353216
-224=1065353216
-223=1065353216
-222=1065353216
-221=-1077936128
-220=-1077936128
-219=1
-218=0
-217=0
-216=0
-215=0
-214=83
-213=835
-212=1126367232
-211=941481301
-210=1159479296
-209=0
-208=1086918619
-207=1065353216
-206=1065353216
-205=1065353216
-204=1065353216
-203=-1090519040
-202=-1090519040
-201=1
-200=0
-199=0
-198=0
-197=0
-196=83
-195=838
-194=1126367232
-193=941481301
-192=1159479296
-191=0
-190=1086918619
-189=1065353216
-188=1065353216
-187=1065353216
-186=1065353216
-185=-1071644672
-184=-1071644672
-183=1
-182=0
-181=0
-180=0
-179=0
-178=83
-177=820
-176=1112539136
-175=969008316
-174=1159479296
-173=0
-172=1086918619
-171=1058642330
-170=1065353216
-169=1058642330
-168=1065353216
-167=0
-166=0
-165=1
-164=0
-163=0
-162=0
-161=0
-160=83
-159=856
-158=1112539136
-157=969008316
-156=1159479296
-155=0
-154=1086918619
-153=1058642330
-152=1065353216
-151=1058642330
-150=1065353216
-149=0
-148=0
-147=1
-146=0
-145=0
-144=0
-143=0
-142=83
-141=801
-140=1112539136
-139=969008316
-138=1159479296
-137=0
-136=1086918619
-135=1058642330
-134=1065353216
-133=1058642330
-132=1065353216
-131=0
-130=0
-129=1
-128=0
-127=0
-126=0
-125=0
-124=83
-123=809
-122=1112539136
-121=969008316
-120=1159479296
-119=0
-118=1086918619
-117=1058642330
-116=1065353216
-115=1058642330
-114=1065353216
-113=0
-112=0
-111=1
-110=0
-109=0
-108=0
-107=0
-106=128
-105=856
-104=1097859072
-103=999400116
-102=1159479296
-101=0
-100=1086918619
-99=1050253722
-98=1058642330
-97=1050253722
-96=1058642330
-95=-1093874483
-94=-1093874483
-93=1
-92=0
-91=0
-90=0
-89=0
-88=128
-87=885
-86=1106247680
-85=982622900
-84=1159479296
-83=0
-82=1086918619
-81=1065353216
-80=1065353216
-79=1065353216
-78=1065353216
-77=-1110651699
-76=-1110651699
-75=0
-74=0
-73=0
-72=0
-71=0
-70=128
-69=884
-68=1106247680
-67=982622900
-66=1159479296
-65=0
-64=1086918619
-63=1065353216
-62=1065353216
-61=1065353216
-60=1065353216
-59=-1110651699
-58=-1110651699
-57=0
-56=0
-55=0
-54=0
-53=0
-52=128
-51=883
-50=1106247680
-49=982622900
-48=1159479296
-47=0
-46=1086918619
-45=1065353216
-44=1065353216
-43=1065353216
-42=1065353216
-41=-1110651699
-40=-1110651699
-39=0
-38=0
-37=0
-36=0
-35=0
-34=128
-33=881
-32=1106247680
-31=982622900
-30=1159479296
-29=0
-28=1086918619
-27=1065353216
-26=1065353216
-25=1065353216
-24=1065353216
-23=-1110651699
-22=-1110651699
-21=0
-20=0
-19=0
-18=0
-17=0
-16=128
-15=882
-14=1106247680
-13=982622900
-12=1159479296
-11=0
-10=1086918619
-9=1065353216
-8=1065353216
-7=1065353216
-6=1065353216
-5=-1110651699
-4=-1110651699
-3=0
-2=0
-1=0
0=0
1=187

Game stats according to ini file after "least favorite gang" becomes ballas:

-342=0
-341=0
-340=113
-339=883
-338=1101004800
-337=992204554
-336=1159479296
-335=0
-334=1086918619
-333=1065353216
-332=1065353216
-331=1065353216
-330=1065353216
-329=-1110651699
-328=-1110651699
-327=0
-326=0
-325=0
-324=0
-323=0
-322=83
-321=830
-320=1126367232
-319=941481301
-318=1159479296
-317=0
-316=1086918619
-315=1065353216
-314=1065353216
-313=1065353216
-312=1065353216
-311=-1078774989
-310=-1078774989
-309=1
-308=0
-307=0
-306=0
-305=0
-304=83
-303=829
-302=1126367232
-301=941481301
-300=1159479296
-299=0
-298=1086918619
-297=1065353216
-296=1065353216
-295=1065353216
-294=1065353216
-293=-1082130432
-292=-1082130432
-291=1
-290=0
-289=0
-288=0
-287=0
-286=83
-285=832
-284=1126367232
-283=941481301
-282=1159479296
-281=0
-280=1086918619
-279=1065353216
-278=1065353216
-277=1065353216
-276=1065353216
-275=-1083808154
-274=-1083808154
-273=1
-272=0
-271=0
-270=0
-269=0
-268=83
-267=831
-266=1126367232
-265=941481301
-264=1159479296
-263=0
-262=1086918619
-261=1065353216
-260=1065353216
-259=1065353216
-258=1065353216
-257=-1080452710
-256=-1080452710
-255=1
-254=0
-253=0
-252=0
-251=0
-250=83
-249=833
-248=1126367232
-247=941481301
-246=1159479296
-245=0
-244=1086918619
-243=1065353216
-242=1065353216
-241=1065353216
-240=1065353216
-239=-1090519040
-238=-1090519040
-237=1
-236=0
-235=0
-234=0
-233=0
-232=83
-231=834
-230=1126367232
-229=941481301
-228=1159479296
-227=0
-226=1086918619
-225=1065353216
-224=1065353216
-223=1065353216
-222=1065353216
-221=-1077936128
-220=-1077936128
-219=1
-218=0
-217=0
-216=0
-215=0
-214=83
-213=835
-212=1126367232
-211=941481301
-210=1159479296
-209=0
-208=1086918619
-207=1065353216
-206=1065353216
-205=1065353216
-204=1065353216
-203=-1090519040
-202=-1090519040
-201=1
-200=0
-199=0
-198=0
-197=0
-196=83
-195=838
-194=1126367232
-193=941481301
-192=1159479296
-191=0
-190=1086918619
-189=1065353216
-188=1065353216
-187=1065353216
-186=1065353216
-185=-1071644672
-184=-1071644672
-183=1
-182=0
-181=0
-180=0
-179=0
-178=83
-177=820
-176=1112539136
-175=969008316
-174=1159479296
-173=0
-172=1086918619
-171=1058642330
-170=1065353216
-169=1058642330
-168=1065353216
-167=0
-166=0
-165=1
-164=0
-163=0
-162=0
-161=0
-160=83
-159=856
-158=1112539136
-157=969008316
-156=1159479296
-155=0
-154=1086918619
-153=1058642330
-152=1065353216
-151=1058642330
-150=1065353216
-149=0
-148=0
-147=1
-146=0
-145=0
-144=0
-143=0
-142=83
-141=801
-140=1112539136
-139=969008316
-138=1159479296
-137=0
-136=1086918619
-135=1058642330
-134=1065353216
-133=1058642330
-132=1065353216
-131=0
-130=0
-129=1
-128=0
-127=0
-126=0
-125=0
-124=83
-123=809
-122=1112539136
-121=969008316
-120=1159479296
-119=0
-118=1086918619
-117=1058642330
-116=1065353216
-115=1058642330
-114=1065353216
-113=0
-112=0
-111=1
-110=0
-109=0
-108=0
-107=0
-106=128
-105=856
-104=1097859072
-103=999400116
-102=1159479296
-101=0
-100=1086918619
-99=1050253722
-98=1058642330
-97=1050253722
-96=1058642330
-95=-1093874483
-94=-1093874483
-93=1
-92=0
-91=0
-90=0
-89=0
-88=128
-87=885
-86=1106247680
-85=982622900
-84=1159479296
-83=0
-82=1086918619
-81=1065353216
-80=1065353216
-79=1065353216
-78=1065353216
-77=-1110651699
-76=-1110651699
-75=0
-74=0
-73=0
-72=0
-71=0
-70=128
-69=884
-68=1106247680
-67=982622900
-66=1159479296
-65=0
-64=1086918619
-63=1065353216
-62=1065353216
-61=1065353216
-60=1065353216
-59=-1110651699
-58=-1110651699
-57=0
-56=0
-55=0
-54=0
-53=0
-52=128
-51=883
-50=1106247680
-49=982622900
-48=1159479296
-47=0
-46=1086918619
-45=1065353216
-44=1065353216
-43=1065353216
-42=1065353216
-41=-1110651699
-40=-1110651699
-39=0
-38=0
-37=0
-36=0
-35=0
-34=128
-33=881
-32=1106247680
-31=982622900
-30=1159479296
-29=0
-28=1086918619
-27=1065353216
-26=1065353216
-25=1065353216
-24=1065353216
-23=-1110651699
-22=-1110651699
-21=0
-20=0
-19=0
-18=0
-17=0
-16=128
-15=882
-14=1106247680
-13=982622900
-12=1159479296
-11=0
-10=1086918619
-9=1065353216
-8=1065353216
-7=1065353216
-6=1065353216
-5=-1110651699
-4=-1110651699
-3=0
-2=0
-1=0
0=0
1=187

Edited by gui7814
Link to comment
Share on other sites

1 hour ago, gui7814 said:

I had the idea of creating a cleo script that writes the values of statistics from -342 to 1 in an ini file

Sorry, it looks like the stats can't handle negative ID values. Better to work with memory addresses. The snippet below is working as expected.

1@ = 7          // pedType Ballas
1@ *= 4         // size of element 
1@ += 0xB78E90  // offset to PedsKilledOfThisType
0A8D: 0@ = read_memory 1@ size 4 virtual_protect 0
0ace: "Ballas Killed %d" 0@

 

Link to comment
Share on other sites

1 hour ago, OrionSR said:
1@ += 0xB78E90  // offset to PedsKilledOfThisType

Will it work with all possible pedtypes ? 

Link to comment
Share on other sites

15 minutes ago, vladvo said:

Will it work with all possible pedtypes ? 

I think so. The data in a mid-game save seems reasonable for the defined pedTypes. It would be best to verify this conclusion before coding but I'm not expecting any problems.

 

Spoiler
DWORD PedsKilledOfThisType[0]	0	0h	
DWORD PedsKilledOfThisType[1]	0	4h	
DWORD PedsKilledOfThisType[2]	0	8h	
DWORD PedsKilledOfThisType[3]	0	Ch	
DWORD PedsKilledOfThisType[4]	25	10h	
DWORD PedsKilledOfThisType[5]	8	14h	
DWORD PedsKilledOfThisType[6]	104	18h	
DWORD PedsKilledOfThisType[7]	32	1Ch	
DWORD PedsKilledOfThisType[8]	5	20h	
DWORD PedsKilledOfThisType[9]	6	24h	
DWORD PedsKilledOfThisType[10]	8	28h	
DWORD PedsKilledOfThisType[11]	0	2Ch	
DWORD PedsKilledOfThisType[12]	3	30h	
DWORD PedsKilledOfThisType[13]	0	34h	
DWORD PedsKilledOfThisType[14]	7	38h	
DWORD PedsKilledOfThisType[15]	0	3Ch	
DWORD PedsKilledOfThisType[16]	0	40h	
DWORD PedsKilledOfThisType[17]	22	44h	
DWORD PedsKilledOfThisType[18]	0	48h	
DWORD PedsKilledOfThisType[19]	0	4Ch	
DWORD PedsKilledOfThisType[20]	18	50h	
DWORD PedsKilledOfThisType[21]	0	54h	
DWORD PedsKilledOfThisType[22]	1	58h	
DWORD PedsKilledOfThisType[23]	1	5Ch	
DWORD PedsKilledOfThisType[24]	190	60h	
DWORD PedsKilledOfThisType[25]	36	64h	
DWORD PedsKilledOfThisType[26]	9	68h	
DWORD PedsKilledOfThisType[27]	13	6Ch	
DWORD PedsKilledOfThisType[28]	0	70h	
DWORD PedsKilledOfThisType[29]	0	74h	
DWORD PedsKilledOfThisType[30]	0	78h	
DWORD PedsKilledOfThisType[31]	0	7Ch	

 

 

Edited by OrionSR
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.