Jump to content

Recommended Posts

Why are so many people expecting current Mods to still work after the new patch. Quite a lot has been changed and I am sure many of the hooks / functions may have also been changed too.

 

Thanks for the update to Scripthook, it is really appreciated and I am going to test out all of my Mods along with Realizm IV 6.2 on patch 6!

 

Edit: Maybe I was wrong because all of my Script Mods still work after patch 6.

Edited by Lodis
Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059880624
Share on other sites

When I patched my game my mod started crashing.

I am using Win 7 64 Bit and the Steam version of GTAIV.

I am using the r1_alt2 version of ScriptHook Luc 12345678 posted (before it wouldn't detect version and stopped logging)

 

The log says

 

 

Log start: Sat Apr 17 11:13:43 2010-----------------------------------------------[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x1390000[iNFO] Auto detecting game version[iNFO] Using game version 1.0.6[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.

 

 

When I look that up in ScriptingNatives.h I see

NATIVE_GET_GAME_TIMER = 0xa4ea0691,

 

 

Is this something that needs to be implemented in ScriptHook.dll or is access to this native lost with the current patch ?

Seems to find the native just fine for me on 1.0.6.

Is this for GTAIV or EFLC?

 

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059880749
Share on other sites

When I patched my game my mod started crashing.

I am using Win 7 64 Bit and the Steam version of GTAIV.

I am using the r1_alt2 version of ScriptHook Luc 12345678 posted (before it wouldn't detect version and stopped logging)

 

The log says

 

 

Log start: Sat Apr 17 11:13:43 2010-----------------------------------------------[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x1390000[iNFO] Auto detecting game version[iNFO] Using game version 1.0.6[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.[ERROR] Native function with hash 0xa4ea0691 is not available.

 

 

When I look that up in ScriptingNatives.h  I see

NATIVE_GET_GAME_TIMER = 0xa4ea0691,

 

 

Is this something that needs to be implemented in ScriptHook.dll or is access to this native lost with the current patch ?

Seems to find the native just fine for me on 1.0.6.

Is this for GTAIV or EFLC?

GTAIV (Steam version)

 

I was using GetgameClock to implement a simple Timer class.

I changed it so I am now using QueryPerformanceCounter.

I hope this solution is portable.

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059880783
Share on other sites

thaCURSEDpie

Hey folks smile.gif.

 

It's been a loooong time since I've used the C++ hook, and sadly I've lost some old sourcecodes =/ ....

 

So I can't for the life of me remember how one can use settings files with the C++ hook... What are the functions for loading a file and getting say an integer value?

 

Thanks in advance smile.gif

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059880870
Share on other sites

 

Hey folks smile.gif.

 

It's been a loooong time since I've used the C++ hook, and sadly I've lost some old sourcecodes =/ ....

 

So I can't for the life of me remember how one can use settings files with the C++ hook... What are the functions for loading a file and getting say an integer value?

 

Thanks in advance smile.gif

 

Say this is what your File.ini looks like:

 

 

[MY SECTION]Value1 = 6Value2 = 7

 

 

 

Here is how you can read some integers from it:

 

 

u32 value1;u32 value2;u32 answer;char file_Name[MAX_PATH] = ".//File.ini";u32 value1 = GetPrivateProfileInt("MY SECTION", "Value1", 0 /* This is the default value to return if it doesn't find the correct one*/, file_Name);u32 value2 = GetPrivateProfileInt("MY SECTION", "Value2", 0 /* This is the default value to return if it doesn't find the correct one*/, file_Name);

 

 

Hope that helps.

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059881614
Share on other sites

Quick question, using the R1_Alt2 version of the Script Hook in standalone EFLC (not sure if its supported but hey, gave it a shot) along with Alexander Blades asi loader, and i cop:

 

 

[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x1330000[iNFO] Auto detecting game version[iNFO] Using game version EFLC 1.1.1[iNFO] Script Hook - Shutdown

 

 

although the front page says EFLC 1.1.1.0. What gives? seems to be killing it straight away, though all i'm trying to test is Simple Native Trainer 5.3 heh.

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059881667
Share on other sites

thaCURSEDpie

@Lt. Caine

Thanks! I'll give that a try smile.gif

 

@X-Bone

 

CreateCar(u32 nameHash, f32 x, f32 y, f32 z, Vehicle *pVehicle, b8 unknownTrue)

 

 

Example:

 

Vehicle tempVeh;CreateCar(MODEL_NRG900, 0.0f, 0.0f, 0.0f, &tempVeh, true);

 

 

If I remember correctly tounge.gif

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059881848
Share on other sites

thaCURSEDpie

Yes it is in C++.

 

But I'm afraid that if you don't understand the code I just wrote, you've got some more learning to do, since it was the basics. Could you please read up a little on C++? Otherwise I would be the one making your mods... And we wouldn't want that, would we? wink.gif

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059881914
Share on other sites

I tried joining and starting a Free Mode game with my mod and it crashed both times.

Do you have to do anything special to get multiplayer to work ?

I am using GTAIV 1.0.6.0 (Steam).

I tested this with GTA IV Script Hook 0.5.0 and Alexander Blade's ASI LOADER 1.0.2.0b

 

Here is the output from joinang an MP game

 

 

Log start: Mon Apr 19 00:55:57 2010-----------------------------------------------[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x12c0000[iNFO] Auto detecting game version[iNFO] Using game version 1.0.6[iNFO] [DAHThread] Thread started[iNFO] [DAHThread] Thread killed[iNFO] [DAHThread] Thread started[FATAL] [DAHThread] Reset() called from non-primary fiber[iNFO] [DAHThread] Thread started[WARN] [DAHThread] Thread instance is being deleted while still hooked[iNFO] [DAHThread] Thread killed[iNFO] Script Hook - Shutdown

 

 

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059883467
Share on other sites

I tried joining and starting a Free Mode game with my mod and it crashed both times.

Do you have to do anything special to get multiplayer to work ?

I am using GTAIV 1.0.6.0 (Steam).

I tested this with GTA IV Script Hook 0.5.0 and Alexander Blade's ASI LOADER 1.0.2.0b

 

Here is the output from joinang an MP game

 

 

Log start: Mon Apr 19 00:55:57 2010-----------------------------------------------[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x12c0000[iNFO] Auto detecting game version[iNFO] Using game version 1.0.6[iNFO] [DAHThread] Thread started[iNFO] [DAHThread] Thread killed[iNFO] [DAHThread] Thread started[FATAL] [DAHThread] Reset() called from non-primary fiber[iNFO] [DAHThread] Thread started[WARN] [DAHThread] Thread instance is being deleted while still hooked[iNFO] [DAHThread] Thread killed[iNFO] Script Hook - Shutdown

 

happened for me too.

 

and devloader made my game not start at all. no logs.

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059886162
Share on other sites

 

I tried joining and starting a Free Mode game with my mod and it crashed both times.

Do you have to do anything special to get multiplayer to work ?

I am using GTAIV 1.0.6.0 (Steam).

I tested this with GTA IV Script Hook 0.5.0 and Alexander Blade's ASI LOADER 1.0.2.0b

 

Here is the output from joinang an MP game

 

 

Log start: Mon Apr 19 00:55:57 2010-----------------------------------------------[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x12c0000[iNFO] Auto detecting game version[iNFO] Using game version 1.0.6[iNFO] [DAHThread] Thread started[iNFO] [DAHThread] Thread killed[iNFO] [DAHThread] Thread started[FATAL] [DAHThread] Reset() called from non-primary fiber[iNFO] [DAHThread] Thread started[WARN] [DAHThread] Thread instance is being deleted while still hooked[iNFO] [DAHThread] Thread killed[iNFO] Script Hook - Shutdown

 

I should mention that I am using a Direct X Hook (like in Speedo example) to display menus with AntTweakbar.

To me it looks like the log is complaining about something in the Direct X hook.

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059886175
Share on other sites

I tried joining and starting a Free Mode game with my mod and it crashed both times.

Do you have to do anything special to get multiplayer to work ?

I am using GTAIV 1.0.6.0 (Steam).

I tested this with GTA IV Script Hook 0.5.0 and Alexander Blade's ASI LOADER 1.0.2.0b

 

Here is the output from joinang an MP game

 

 

Log start: Mon Apr 19 00:55:57 2010-----------------------------------------------[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x12c0000[iNFO] Auto detecting game version[iNFO] Using game version 1.0.6[iNFO] [DAHThread] Thread started[iNFO] [DAHThread] Thread killed[iNFO] [DAHThread] Thread started[FATAL] [DAHThread] Reset() called from non-primary fiber[iNFO] [DAHThread] Thread started[WARN] [DAHThread] Thread instance is being deleted while still hooked[iNFO] [DAHThread] Thread killed[iNFO] Script Hook - Shutdown

 

happened for me too.

 

and devloader made my game not start at all. no logs.

same here confused.gif devloader is broken or not updated?

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059887294
Share on other sites

I tried Multiplayer again after removing the Direct X hooking stuff entirely.

Once again it crashed here is the log from that attempt.

 

 

Log start: Wed Apr 21 19:23:17 2010-----------------------------------------------[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized[iNFO] Process base address: 0x370000[iNFO] Auto detecting game version[iNFO] Using game version 1.0.6[iNFO] [DAHThread] Thread started[iNFO] [DAHThread] Thread killed[iNFO] [DAHThread] Thread started[WARN] [DAHThread] Thread instance is being deleted while still hooked[iNFO] [DAHThread] Thread killed[iNFO] Script Hook - Shutdown

 

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059888946
Share on other sites

plsease add 1.0.5.1 support (ru 6 patch)

i cant load trainer(

 

Log start: Fri Apr 23 14:39:22 2010

-----------------------------------------------

[iNFO] GTA IV Script Hook 0.5.0 - © 2009, Aru - Initialized

[iNFO] Process base address: 0x400000

[iNFO] Auto detecting game version

[FATAL] Failed to detect game version

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059891442
Share on other sites

With this scripthook is it now possible to use mods like LCPDFR with the latest patch 1.0.6.0, or is that still not possible?

 

What advantage could people possibly have over others on MP when using this scripthook - does it make all trainers useable online?

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059894795
Share on other sites

Does anybody have an updated version of any of the header files i.e A better version of Scripting.h with more cleaned up natives, especially looking for SetMobileRadioEnabledDuringGameplay and AttachCarToCar, Thx

to be honest, especially the first one is dead easy to clean up yourself, as it has only one (1) parm !

 

 

static void SetMobileRadioEnabledDuringGameplay(b8 enable) { NativeInvoke::Invoke<NATIVE_SET_MOBILE_RADIO_ENABLED_DURING_GAMEPLAY,ScriptVoid>(enable); }

 

 

and a bit harder, but still not impossible:

 

 

    static void AttachCarToCar(Vehicle veh1, Vehicle veh2, u32 unknow0_0, f32 x, f32 y, f32 z, f32 rx, f32 ry, f32 rz) { NativeInvoke::Invoke<NATIVE_ATTACH_CAR_TO_CAR,ScriptVoid>(veh1, veh2, unknow0_0, x, y, z, rx, ry, rz); }

 

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059897209
Share on other sites

opium_addict

Suppose i should ask here, if anyone has any experience with the decisionmakers?

 

I am nearly done with a riot mode, but, my peds are acting like wimps! turn.gif

 

mainly

 

SetDecisionMakerAttributeCaution

SetDecisionMakerAttributeRetreatingBehaviour

Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059897229
Share on other sites

opium_addict

 

^use setrelationship, works for me, they will attack in packs smile.gif

Well right now what i have done is set them to a group,

 

 Scripting::SetPedDensityMultiplier( 80.f ); Scripting::AllowGangRelationshipsToBeChangedByNextCommand( true ); Scripting::SetRelationship( 5, 23, 23 );	// Rioters hate themselves//  Scripting::SetRelationship( 5, 23, 0 );  // Rioters hate player (you) Scripting::SetRelationship( 5, 23, 3 );  // Rioters hate cops//  Scripting::SetRelationship( 5, 3, 23 );  // Cops hate rioters

 

 

but some are cowardly and simply run away from fighting, ive tried setting their decisionmaker to dwanyes bodyguards (from another topic),

but that of course would usually mean they are on the defensive most of the time. (or sometimes, they will just run away anyway.)

 

 

  Scripting::LoadCharDecisionMaker( 2, &CharDecisionMaker ); Scripting::LoadCombatDecisionMaker( 9, &CombatDecisionMaker );

 

 

 

      	Scripting::SetCharDecisionMaker( Index, CharDecisionMaker );     	Scripting::SetCombatDecisionMaker( Index, CombatDecisionMaker );     	Scripting::AllowTargetWhenInjured( Index, 1 );     	Scripting::SetCharWillDoDrivebys( Index, true );     	Scripting::SetCharWillUseCarsInCombat( Index, true );     	Scripting::SetCharCanBeShotInVehicle( Index, true );     	Scripting::SetCharCanBeKnockedOffBike( Index, true );     	Scripting::SetPedWontAttackPlayerWithoutWantedLevel( Index, 0 );     	Scripting::GiveWeaponToChar( Index, GetRandomWeapon(), 9999, 0 );     	Scripting::SetCharRelationshipGroup( Index, 23 );     	Scripting::SetSenseRange( Index, 100.f );     	     	Scripting::SetCharAccuracy( Index, 90 );     	Scripting::TaskCombatHatedTargetsAroundChar( Index, 100.f );

 

 

 

I've also tried going through the decision makers (increment/decrement, brute forcing basically), there is preloaded "pacifist" flags, coward, etc, i suspect mostly from /common/data/decision/

Edited by opium_addict
Link to comment
https://gtaforums.com/topic/390582-c-script-hook/page/46/#findComment-1059897467
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.