Jump to content

[V] Script/Native Documentation and Research


Recommended Posts

Some of the new b1103 natives (haven't had much time so only 4):

// STREAMING// I'm 99% sure it's the correct namestatic BOOL _IS_MODEL_A_PED(Hash modelHash) { return invoke<BOOL>(0x75816577FEA6DAD5, modelHash); } // 0x75816577FEA6DAD5// WEAPONstatic Hash _GET_PED_AMMO_TYPE_FROM_WEAPON_2(Ped ped, Hash weaponHash) { return invoke<Hash>(0xF489B44DD5AF4BD9, ped, weaponHash); } // 0xF489B44DD5AF4BD9// VEHICLE// 0.0f - 1.0fstatic void _SET_VEHICLE_ROCKET_BOOST_PERCENTAGE(Vehicle vehicle, float percentage) { invoke<Void>(0xFEB2DDED3509562E, vehicle, percentage); } // 0xFEB2DDED3509562Estatic int _GET_ALL_VEHICLES(int* vehsStruct) { return invoke<int>(0x9B8E1BF04B51F2E8, vehsStruct); } // 0x9B8E1BF04B51F2E8// purely based on a quick disassembly, not sure if it's correctstruct vehsStruct{    int maxSize;    int padding;    Vehicle vehs[300];};
  • 2 weeks later...
mockba.the.borg

 

Some of the new b1103 natives (haven't had much time so only 4):

// STREAMING// I'm 99% sure it's the correct namestatic BOOL _IS_MODEL_A_PED(Hash modelHash) { return invoke<BOOL>(0x75816577FEA6DAD5, modelHash); } // 0x75816577FEA6DAD5// WEAPONstatic Hash _GET_PED_AMMO_TYPE_FROM_WEAPON_2(Ped ped, Hash weaponHash) { return invoke<Hash>(0xF489B44DD5AF4BD9, ped, weaponHash); } // 0xF489B44DD5AF4BD9// VEHICLE// 0.0f - 1.0fstatic void _SET_VEHICLE_ROCKET_BOOST_PERCENTAGE(Vehicle vehicle, float percentage) { invoke<Void>(0xFEB2DDED3509562E, vehicle, percentage); } // 0xFEB2DDED3509562Estatic int _GET_ALL_VEHICLES(int* vehsStruct) { return invoke<int>(0x9B8E1BF04B51F2E8, vehsStruct); } // 0x9B8E1BF04B51F2E8// purely based on a quick disassembly, not sure if it's correctstruct vehsStruct{    int maxSize;    int padding;    Vehicle vehs[300];};

This is cool ... I wonder if there's a _GET_ALL_PEDS still to be discovered.

Edited by mockba.the.borg
  • 3 weeks later...
  • 2 weeks later...

Long story - There is currently a bug with the race creator that has been ruining races for over a year now that I'm looking to find the cause of I have tracked it down to Global_1638223.f_17 in fm_race_creator being 536870912 which is the 29th bit.

 

I have found 2 references to the bit being set

GAMEPLAY::SET_BIT(&(Global_1638223.f_17), 29); 

but I am lost trying to find what is causing it to be set.

 

Any help is appreciated. Thanks

Edited by aaron25th
  • 3 weeks later...

 

@AB, Are you not posting the Native Tables anymore?

Just extract the table from SHV. Here: https://pastebin.com/n1ypT0xf

 

Did you try it? Because when I did I am getting this Error "Failed to Initialize NativeHooks"... Idk if this is the Good Hash Table...Any Ideas how to fix it?

mockba.the.borg

AB has changed the way ScriptHookV works.

Instead of having multiple translation tables in there, and search each one vertically, he made it all one big table, and searches the natives horizontally.

So extracting the table from ScriptHookV now requires some extra work.

Not saying that the table above it wrong, I didn't test it.

Just saying that ScriptHookV table content has changed.

unknown modder

 

 

@AB, Are you not posting the Native Tables anymore?

Just extract the table from SHV. Here: https://pastebin.com/n1ypT0xf

 

Did you try it? Because when I did I am getting this Error "Failed to Initialize NativeHooks"... Idk if this is the Good Hash Table...Any Ideas how to fix it?

 

Hooking natives, If I didnt know better I'd say you were using this for a GTA:Online modification which is not supported here

 

 

@AB, Are you not posting the Native Tables anymore?

Just extract the table from SHV. Here: https://pastebin.com/n1ypT0xf

 

Did you try it? Because when I did I am getting this Error "Failed to Initialize NativeHooks"... Idk if this is the Good Hash Table...Any Ideas how to fix it?

 

 

Yup they work, You can't just put them into a hook and expect them to work you will probably need to-do some work yourself.

They are the translation tables of b1103 to b1180. So to speed things up you will need to write a small console application to update your existing table with the new addresses from the new table.

That's as much as I can help you with, If your unsure on how to-do any of that then I'd recommend learning the basics of Programming.

 

@unknown modder, Yeah I would have done that but I'm a little new to that whole thing and hadn't the clue were to start, Appreciate you posting the table, thanks ^^.

mockba.the.borg

 

 

 

@AB, Are you not posting the Native Tables anymore?

Just extract the table from SHV. Here: https://pastebin.com/n1ypT0xf

 

Did you try it? Because when I did I am getting this Error "Failed to Initialize NativeHooks"... Idk if this is the Good Hash Table...Any Ideas how to fix it?

 

Hooking natives, If I didnt know better I'd say you were using this for a GTA:Online modification which is not supported here

 

 

Well ... not really ... I have bypassed all the natives and am going directly to their internal offsets, on my >>>OFFLINE<<<, >>non-online-capable<<< GTALua2 ... because I was tired of having to wait for AB to release a new ScriptHookV when a new version of the game comes out.

 

To be honest I am already modding the new v1180 without having ever played it online since the release.

 

GTA:O sucks, you are a hamster in a cage doing repetitive grinding for money ... offline modded GTA has much better vehicles and stuff, end everything is free ... :)

unknown modder

 

Hooking natives, If I didnt know better I'd say you were using this for a GTA:Online modification which is not supported here

Well ... not really ... I have bypassed all the natives and am going directly to their internal offsets, on my >>>OFFLINE<<<, >>non-online-capable<<< GTALua2 ... because I was tired of having to wait for AB to release a new ScriptHookV when a new version of the game comes out.

 

To be honest I am already modding the new v1180 without having ever played it online since the release.

 

GTA:O sucks, you are a hamster in a cage doing repetitive grinding for money ... offline modded GTA has much better vehicles and stuff, end everything is free ... :)

 

Hooking natives is not the same as getting their entry points and invoking them directly.

 

 

 

 

@AB, Are you not posting the Native Tables anymore?

Just extract the table from SHV. Here: https://pastebin.com/n1ypT0xf

 

Did you try it? Because when I did I am getting this Error "Failed to Initialize NativeHooks"... Idk if this is the Good Hash Table...Any Ideas how to fix it?

 

Hooking natives, If I didnt know better I'd say you were using this for a GTA:Online modification which is not supported here

 

 

Well ... not really ... I have bypassed all the natives and am going directly to their internal offsets, on my >>>OFFLINE<<<, >>non-online-capable<<< GTALua2 ... because I was tired of having to wait for AB to release a new ScriptHookV when a new version of the game comes out.

 

To be honest I am already modding the new v1180 without having ever played it online since the release.

 

GTA:O sucks, you are a hamster in a cage doing repetitive grinding for money ... offline modded GTA has much better vehicles and stuff, end everything is free ... :)

 

 

In this case I'm pretty sure he is just another kid trying to get an online mod menu working. "Failed to Initialize Native Hooks" is a message from the online 'sudo mod' menu.

 

 

 

@AB, Are you not posting the Native Tables anymore?

Just extract the table from SHV. Here: https://pastebin.com/n1ypT0xf

 

Did you try it? Because when I did I am getting this Error "Failed to Initialize NativeHooks"... Idk if this is the Good Hash Table...Any Ideas how to fix it?

 

 

Yup they work, You can't just put them into a hook and expect them to work you will probably need to-do some work yourself.

They are the translation tables of b1103 to b1180. So to speed things up you will need to write a small console application to update your existing table with the new addresses from the new table.

That's as much as I can help you with, If your unsure on how to-do any of that then I'd recommend learning the basics of Programming.

 

@unknown modder, Yeah I would have done that but I'm a little new to that whole thing and hadn't the clue were to start, Appreciate you posting the table, thanks ^^.

 

 

If someone just can give the other Modification i would need to do that will be nice too... Im still a newbie and dont have a lot of knowlege tho but im doing my best...

unknown modder

Does zorg93's decompiler works with latest ysc's?

Can someone share 1180 decompiled scripts?

kinda. the natives would need updating. Im just trying to fix some annoying bug atm but once that is out the way I'll upload them

 

Does zorg93's decompiler works with latest ysc's?

Can someone share 1180 decompiled scripts?

kinda. the natives would need updating. Im just trying to fix some annoying bug atm but once that is out the way I'll upload them

 

 

I've extracted one .ysc from update.rpf and it looks like this (first bytes):

00000000h: 52 53 43 07 0A 00 00 00 82 00 EA 01 00 00 00 A0 ; RSC.....‚.к.... 00000010h: FB 7E 4A 04 C7 29 12 9B 8A 2A 47 B2 51 C2 0E AD ; ы~J.З).›Љ*GІQВ.­00000020h: 51 86 A6 03 BC 2C 6E E2 55 76 E8 21 DB 30 DA 14 ; Q†¦.ј,nвUvи!Ы0Ъ.00000030h: 4D 07 CE 78 C5 30 66 DB CD 08 5E 1D 76 39 B5 39 ; M.ОxЕ0fЫН.^.v9µ900000040h: 65 1F 93 A9 C0 42 4C DD 77 B3 0D DD DA 34 BD 18 ; e.“©АBLЭwі.ЭЪ4Ѕ.00000050h: E3 79 BF 98 12 52 C5 CA 4C 2A DB 43 EA C8 B4 6F ; гyї.RЕКL*ЫCкИґo00000060h: 8E 8B AB 07 B3 6E 77 EA 9C D4 85 BB D2 31 BA 20 ; Ћ‹«.іnwкњФ…»Т1є 00000070h: F4 EB 7E 19 46 6B 3B 6A 12 CA 9D 8B 9C B1 9E E3 ; фл~.Fk;j.Кќ‹њ±ћг00000080h: E1 18 F4 26 F6 96 AD BF 08 A3 E7 AE 1F D1 E1 D8 ; б.ф&ц–­ї.Јз®.СбШ00000090h: 54 BB DA D6 41 8A 5F 45 CF BD EE BF DB BE 1A 89 ; T»ЪЦAЉ_EПЅоїЫѕ.‰000000a0h: 0B 38 6E C8 60 70 94 BC 04 9D 7D EA 53 22 D7 AE ; .8nИ`p”ј.ќ}кS"Ч®000000b0h: B0 00 C6 AD 26 80 F2 45 00 0E 49 F4 56 A8 86 DF ; °.Ж­&ЂтE..IфVЁ†Я

Decompiler crashes when Im trying feed him with this. Header mismatach. Is it encrypted? I would be appreciated for advice.

Flying Scotsman

I didn't find these by myself, but these should be responsible for Plane Bombs and Countermeasures (names might need double checked. I was in a rush):

/* Sets Airplane Bomb Count. Someone tested it by setting it to 500 bombs and it worked. No idea if there's a ceiling. */static void _SET_VEHICLE_BOMB_COUNT(Vehicle vehicle, int number) { invoke<Void>(0xF4B2ED59DEB5D774, vehicle, number); } // 0xF4B2ED59DEB5D774/* Sets Airplane Countermeasure Count. Same as above. */static void _SET_VEHICLE_COUNTERMEASURE_COUNT(Vehicle vehicle, int number) { invoke<Void>(0x9BDA23BF666F0855, vehicle, number); } // 0x9BDA23BF666F0855
Edited by Zemanez

I didn't find these by myself, but these should be responsible for Plane Bombs and Countermeasures (names might need double checked. I was in a rush):

/* Sets Airplane Bomb Count. Someone tested it by setting it to 500 bombs and it worked. No idea if there's a ceiling. */static void _SET_VEHICLE_BOMB_COUNT(Vehicle vehicle, int number) { invoke<Void>(0xF4B2ED59DEB5D774, vehicle, number); } // 0xF4B2ED59DEB5D774/* Sets Airplane Countermeasure Count. Same as above. */static void _SET_VEHICLE_COUNTERMEASURE_COUNT(Vehicle vehicle, int number) { invoke<Void>(0x9BDA23BF666F0855, vehicle, number); } // 0x9BDA23BF666F0855

There's no limit, you can set it as high as you want (See replies below). Also, after looking into what the new natives do I could only guess. But at that time (one week ago) zorg had figured it out already so he told me the names for the ones that he had figured out.

(I changed plane to aircraft for the first four since they work for some helis as well).

int _GET_AIRCRAFT_COUNTERMEASURE_COUNT(Vehicle aircraft); // 0xF846AA63DF56B804void _SET_AIRCRAFT_COUNTERMEASURE_COUNT(Vehicle aircraft, int countermeasureCount); // 0x9BDA23BF666F0855int _GET_AIRCRAFT_BOMB_COUNT(Vehicle aircraft); // 0xEA12BD130D7569A1void _SET_AIRCRAFT_BOMB_COUNT(Vehicle aircraft, int bombCount); // 0xF4B2ED59DEB5D774BOOL _ARE_BOMB_BAY_DOORS_OPEN(Vehicle aircraft); // 0xD0917A423314BBA8float _GET_PLANE_HOVER_MODE_PERCENTAGE(Vehicle plane); // 0xDA62027C8BDB326E
Edited by Unknown_Modder
unknown modder

 

I didn't find these by myself, but these should be responsible for Plane Bombs and Countermeasures (names might need double checked. I was in a rush):

/* Sets Airplane Bomb Count. Someone tested it by setting it to 500 bombs and it worked. No idea if there's a ceiling. */static void _SET_VEHICLE_BOMB_COUNT(Vehicle vehicle, int number) { invoke<Void>(0xF4B2ED59DEB5D774, vehicle, number); } // 0xF4B2ED59DEB5D774/* Sets Airplane Countermeasure Count. Same as above. */static void _SET_VEHICLE_COUNTERMEASURE_COUNT(Vehicle vehicle, int number) { invoke<Void>(0x9BDA23BF666F0855, vehicle, number); } // 0x9BDA23BF666F0855

I'll put it out here what I told Unknown_Modder(the other one :D). Those natives do have a limit of 1000u, if you pass a value greater than that, nothing will happen. However the natives are used exclusively by the scripts and the bombs and countermeasures are entirely script controlled. This is why the bombs and countermeasures do nothing offline(like with the proxy mines from gun running). I made a mod for that which replicated what happened in freemode in single player, but haven't gotten around to doing it for smugglers run.

 

I didn't find these by myself, but these should be responsible for Plane Bombs and Countermeasures (names might need double checked. I was in a rush):

/* Sets Airplane Bomb Count. Someone tested it by setting it to 500 bombs and it worked. No idea if there's a ceiling. */static void _SET_VEHICLE_BOMB_COUNT(Vehicle vehicle, int number) { invoke<Void>(0xF4B2ED59DEB5D774, vehicle, number); } // 0xF4B2ED59DEB5D774/* Sets Airplane Countermeasure Count. Same as above. */static void _SET_VEHICLE_COUNTERMEASURE_COUNT(Vehicle vehicle, int number) { invoke<Void>(0x9BDA23BF666F0855, vehicle, number); } // 0x9BDA23BF666F0855
I'll put it out here what I told Unknown_Modder(the other one :D). Those natives do have a limit of 1000u, if you pass a value greater than that, nothing will happen. However the natives are used exclusively by the scripts and the bombs and countermeasures are entirely script controlled. This is why the bombs and countermeasures do nothing offline(like with the proxy mines from gun running). I made a mod for that which replicated what happened in freemode in single player, but haven't gotten around to doing it for smugglers run.

 

Oh, right, they do. Sorry for that, I accidentally looked at the getters, not the setters :facedesk:

.text:0000000140A61424    cmp    ebx, 3E8h

But that can be easily bypassed :) (although, like you mentioned, everything is script controlled so it wouldn't make any difference. And directly setting the value in CVehicle would be better anyway.)

Edited by Unknown_Modder
unknown modder

 

 

I didn't find these by myself, but these should be responsible for Plane Bombs and Countermeasures (names might need double checked. I was in a rush):

/* Sets Airplane Bomb Count. Someone tested it by setting it to 500 bombs and it worked. No idea if there's a ceiling. */static void _SET_VEHICLE_BOMB_COUNT(Vehicle vehicle, int number) { invoke<Void>(0xF4B2ED59DEB5D774, vehicle, number); } // 0xF4B2ED59DEB5D774/* Sets Airplane Countermeasure Count. Same as above. */static void _SET_VEHICLE_COUNTERMEASURE_COUNT(Vehicle vehicle, int number) { invoke<Void>(0x9BDA23BF666F0855, vehicle, number); } // 0x9BDA23BF666F0855
I'll put it out here what I told Unknown_Modder(the other one :D). Those natives do have a limit of 1000u, if you pass a value greater than that, nothing will happen. However the natives are used exclusively by the scripts and the bombs and countermeasures are entirely script controlled. This is why the bombs and countermeasures do nothing offline(like with the proxy mines from gun running). I made a mod for that which replicated what happened in freemode in single player, but haven't gotten around to doing it for smugglers run.

 

Oh, right, they do. Sorry for that, I accidentally looked at the getters, not the setters :facedesk:

.text:0000000140A61424    cmp    ebx, 3E8h

But that can be easily bypassed :) (although, like you mentioned, everything is script controlled so it wouldn't make any difference. And directly setting the value in CVehicle would be better anyway.)

 

I feel like we are missing the important part. The bombs/cm are only scripted for gta:online. The only possible use this has is if someone makes a version offline and decides these natives need including

[...]

I feel like we are missing the important part. The bombs/cm are only scripted for gta:online. The only possible use this has is if someone makes a version offline and decides these natives need including

That's what I meant by "although, like you mentioned, everything is script controlled so it wouldn't make any difference" (gotta admit it probably wasn't clear enough).
int _GET_AIRCRAFT_COUNTERMEASURE_COUNT(Vehicle aircraft); // 0xF846AA63DF56B804void _SET_AIRCRAFT_COUNTERMEASURE_COUNT(Vehicle aircraft, int countermeasureCount); // 0x9BDA23BF666F0855int _GET_AIRCRAFT_BOMB_COUNT(Vehicle aircraft); // 0xEA12BD130D7569A1void _SET_AIRCRAFT_BOMB_COUNT(Vehicle aircraft, int bombCount); // 0xF4B2ED59DEB5D774BOOL _ARE_BOMB_BAY_DOORS_OPEN(Vehicle aircraft); // 0xD0917A423314BBA8float _GET_PLANE_HOVER_MODE_PERCENTAGE(Vehicle plane); // 0xDA62027C8BDB326E

You dont happen to know if there is one that checks if bomb bay doors are FULLY open?

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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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