GTA Modification Forums
[REL|SA] Spooky-style SCM Hook
 |
|
 |
| |
JGuntherS@NL  |
Posted: Wednesday, Nov 14 2007, 17:58
|
Being a being

Group: Members
Joined: Nov 15, 2005


|
I have created an SCM hook for GTA: San Andreas that works like Spooky's SCM hook for VC, with script classes and such. However, it runs next to the original SCM so the original missions will still be available. It is based on my SA Injector, so it has full CRT functionality. It also has an GXT hook for custom text entries. A lot of code is just robbed from either op9080's SA SCM hook, spooky's VC SCM Hook and my own injector, credits to them! I think it is quite self-explanatory, just look at CustomScript.cpp and CustomGXT.h If you're having trouble with hash_map, change #define USE_HASH_MAP in commonincs.h into #define USE_HASH_MAP_IN_STDEXT, or if that doesn't work, just delete that line. Performance will drop sligthly in that case. Download link (current version: v3): http://www.pawfectfilms.com/mods/SA_Injector3.zipChangelog: v1: initial version v2: added an op9080-hook-like script classv3: added support for using -1 instead of actor variable, fixed some issues in opcodes.h This post has been edited by Dutchy3010 on Wednesday, Aug 26 2009, 09:05
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
aad  |
Posted: Thursday, Nov 15 2007, 19:01
|
3d artist

Group: Members
Joined: Mar 15, 2004



|
| QUOTE (JGuntherS@NL @ Nov 14 2007, 17:58) | I have created an SCM hook for GTA: San Andreas that works like Spooky's SCM hook for VC, with script classes and such. However, it runs next to the original SCM so the original missions will still be available. It is based on my SA Injector, so it has full CRT functionality. It also has an GXT hook for custom text entries. A lot of code is just robbed from either op9080's SA SCM hook, spooky's VC SCM Hook and my own injector, credits to them!
I think it is quite self-explanatory, just look at CustomScript.cpp and CustomGXT.h
If you're having trouble with hash_map, change #define USE_HASH_MAP in commonincs.h into #define USE_HASH_MAP_IN_STDEXT, or if that doesn't work, just delete that line. Performance will drop sligthly in that case.
Download link: http://jesse.thorbit.nl/sainject/scmhook.zip | Hope it works with Visual Studio 6, if not then i really need to get an other version right away.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
JGuntherS@NL  |
Posted: Thursday, Nov 15 2007, 19:42
|
Being a being

Group: Members
Joined: Nov 15, 2005


|
| QUOTE (aad @ Nov 15 2007, 19:01) | | QUOTE (JGuntherS@NL @ Nov 14 2007, 17:58) | I have created an SCM hook for GTA: San Andreas that works like Spooky's SCM hook for VC, with script classes and such. However, it runs next to the original SCM so the original missions will still be available. It is based on my SA Injector, so it has full CRT functionality. It also has an GXT hook for custom text entries. A lot of code is just robbed from either op9080's SA SCM hook, spooky's VC SCM Hook and my own injector, credits to them!
I think it is quite self-explanatory, just look at CustomScript.cpp and CustomGXT.h
If you're having trouble with hash_map, change #define USE_HASH_MAP in commonincs.h into #define USE_HASH_MAP_IN_STDEXT, or if that doesn't work, just delete that line. Performance will drop sligthly in that case.
Download link: http://jesse.thorbit.nl/sainject/scmhook.zip |
Hope it works with Visual Studio 6, if not then i really need to get an other version right away. |
Everything should work, except MSVC++ 6 doesn't have the hash_map by default. You could implement it yourself, find the correct files somewhere or just update to MSVC2003, which is what I'd advise you to do  . If you want to use it with MSVC6 without hash_map, comment out or delete the line #define USE_HASH_MAP in commonincs.h. This post has been edited by JGuntherS@NL on Thursday, Nov 15 2007, 19:46
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ceedj  |
|
PEDS Creator

Group: Members
Joined: May 21, 2005



|
| CODE | DEFINE_OPCODE(put_player, 0x0055, "vfff"); DEFINE_OPCODE(create_coordinate, 0x0400, "vfffvvv"); |
No longer supported in SA. There are a few others; I'll weed 'em out as I go.  EDIT: Just a reminder: with multiple threads now, make sure your "waits" are distributed properly; this impacts which threads get higher priority. Not new info by any stretch, but after using one thread with the C++ hooks for so long, you tend to forget.  EDIT 2: | CODE | | DEFINE_OPCODE(get_car_color, 0x03F3, "vii"); // var_car col1 col2 |
Change the "vii" to "vvv", or your game will crash if you try to get colors from cars. This post has been edited by ceedj on Saturday, Nov 17 2007, 02:02
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ceedj  |
Posted: Tuesday, Nov 27 2007, 01:45
|
PEDS Creator

Group: Members
Joined: May 21, 2005



|
| QUOTE (JGuntherS@NL @ Nov 24 2007, 08:43) | I've uploaded a new version that supports the substitution of an actor variable with -1, which is used in defining actor animation sequences. Things like | CODE | | CallOpcode(&AT_look_around, -1); | should work now .
I also used ceedj's suggestions to modify opcodes.h, thanks for that |
Just to clarify, it's not just for actors; this fix works with any opcode that takes either a handle or -1 as a parameter.  When setting up opcodes in Opcodes.h, just make the parameter in question a v. Hey JGS, how can we add NOT to opcodes? Doing CallOpcode(!&blapcode); throws a compilation error. I'm just creating a second opcode for now: (blahpcode, "0x0684", "") (nblahpcode, "0x8684", "") Any ideas? This post has been edited by ceedj on Tuesday, Nov 27 2007, 01:48
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
JGuntherS@NL  |
|
Being a being

Group: Members
Joined: Nov 15, 2005


|
| QUOTE (ceedj @ Nov 27 2007, 01:45) | | QUOTE (JGuntherS@NL @ Nov 24 2007, 08:43) | I've uploaded a new version that supports the substitution of an actor variable with -1, which is used in defining actor animation sequences. Things like | CODE | | CallOpcode(&AT_look_around, -1); | should work now .
I also used ceedj's suggestions to modify opcodes.h, thanks for that |
Just to clarify, it's not just for actors; this fix works with any opcode that takes either a handle or -1 as a parameter. When setting up opcodes in Opcodes.h, just make the parameter in question a v.
Hey JGS, how can we add NOT to opcodes? Doing CallOpcode(!&blapcode); throws a compilation error. I'm just creating a second opcode for now:
(blahpcode, "0x0684", "")
(nblahpcode, "0x8684", "")
Any ideas? |
You could use | CODE | | if (!CallOpcode(&..., ...)) |
That'll work, as it's just a C not This post has been edited by JGuntherS@NL on Friday, Nov 30 2007, 17:34
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
JGuntherS@NL  |
Posted: Saturday, Dec 1 2007, 14:00
|
Being a being

Group: Members
Joined: Nov 15, 2005


|
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ceedj  |
|
PEDS Creator

Group: Members
Joined: May 21, 2005



|
I had a feeling, but wasn't sure how to do it with floats. I'll look into it some more. Thanks very much for the help.  EDIT: Ok, I got it to work. A bit inelegant though. Sacky gave me this for my custom loading screens: | CODE | void Patch_DEF ( DWORD dwAddress, BYTE *bRawData, int iSize ) { DWORD dw[2]; VirtualProtect ( (PVOID) dwAddress, iSize, PAGE_EXECUTE_READWRITE, &dw[0] ); memcpy ( (PVOID) dwAddress, bRawData, iSize ); VirtualProtect ( (PVOID) dwAddress, iSize, dw[0], &dw[1] ); } |
My code for gravity: | CODE | BYTE bGravity[] = { 0x6F, 0x12, 0x83, 0x3B }; Patch_DEF(0x863984, bGravity, 4); |
That translates to 0.004, (3B83126F) or half-gravity. My question: can anyone suggest a way to use the float value instead? Not a huge deal, but I want to add gravity values to my config file; I think 1 float is easier to deal with than hex combos. Thanks. This post has been edited by ceedj on Tuesday, Dec 4 2007, 20:21
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
UZI-I  |
|
WPL Manager...

Group: Members
Joined: Aug 23, 2006



|
| CODE | DWORD dw[2]; VirtualProtect ( (PVOID) 0x863984 , 4, PAGE_EXECUTE_READWRITE, &dw[0] ); *(float*)0x863984 = 0.004f; VirtualProtect ( (PVOID) 0x863984 , 4, dw[0], &dw[1] ); |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Pages:
(3) [1] 2 3
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|