Quantcast

Jump to content

» «
Photo

[GTAIV|REL|SRC] C++ Script Hook

1,811 replies to this topic
ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • United-States

#31

Posted 06 January 2009 - 10:43 PM

Just a heads up, but most of the GTX stuff is done with the PRINT natives and their variants now.

saracoglu
  • saracoglu

    saracoglu

  • Members
  • Joined: 02 Jun 2002

#32

Posted 06 January 2009 - 11:37 PM

Thank you very much indeed.

I was planning to convert this code to c#, but no need. It is lean and crispy.

Time to implement a communication between this dll (running in gta process) and an external vb process to include vb coders to have an easy-going UI with a solid c++ dll at back-end.
Exporting the calls will not be enough. As then, even through extern dll calls, a new instance of this dll will get loaded into vb process, and the gta4-process injected dll will not be referenced.

cheers, and happy coding

xmen
  • xmen

    Foot Soldier

  • Members
  • Joined: 02 Jun 2005
  • None

#33

Posted 07 January 2009 - 12:45 AM

Exellent work !!! icon14.gif can you make one via C# ?

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#34

Posted 07 January 2009 - 12:49 AM

Yeah, a DotNet script hook (for C# and VB.Net) would be perfect! I already tried to compile the scripthook with managed extensions (to call other dotnet assemblies from it) but it crashes the game. sad.gif nevertheless, amazing work aru!

the hubster
  • the hubster

    Sup Homies

  • Members
  • Joined: 03 May 2005

#35

Posted 07 January 2009 - 01:12 AM Edited by the hubster, 07 January 2009 - 01:36 AM.

QUOTE (asd23 @ Jan 6 2009, 21:57)
Oh well, no biggie. Dled VC2008 and messed around with it. Been meaning to learn something other than VB anyway.
But I have question: how do I display text? Displaying your own strings isn't probably possible, like in SA, but how can I display text from GXTs? I don't really know what gxtName should be.

If you want to display your own strings without using a gxt file, you could use Direct3D.

DL the DirectX SDK: http://www.microsoft...&displaylang=en

Then follow this tutorial: http://www.toymaker..../html/text.html

It's actually doable with no/little experience with C++ (i could do it, so that is proof) tounge.gif

asd23
  • asd23

    Crackhead

  • Members
  • Joined: 24 Mar 2004

#36

Posted 07 January 2009 - 01:27 AM

The function aru told me works pefectly for what I need. Making a separate DX overlay would be overkill for the simple thing I'm doing.

Deanimator
  • Deanimator

    Player Hater

  • Members
  • Joined: 07 Jan 2009

#37

Posted 07 January 2009 - 04:34 AM

great job aru! i am just having a problem with constant ingame crashes. Did you use the asi loader that came with alice or the more outdated standalone asi loader(both by Alexander Blade)?

C06alt
  • C06alt

    Street Cat

  • Members
  • Joined: 08 Aug 2005

#38

Posted 07 January 2009 - 05:34 AM

user posted image

I always wanted to go on a killing spree as Ricky Gervais sneaky2.gif
You made my dream come true , thanks a lot.

Demonith
  • Demonith

    PC game player

  • Members
  • Joined: 29 Aug 2008

#39

Posted 07 January 2009 - 06:18 AM

Where i can find Niko's face textures ? and how import new textures ?

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#40

Posted 07 January 2009 - 06:41 AM

QUOTE (Deanimator @ Jan 6 2009, 23:34)
great job aru! i am just having a problem with constant ingame crashes. Did you use the asi loader that came with alice or the more outdated standalone asi loader(both by Alexander Blade)?

I did all my testing with xliveless... avail @ http://www.gtaforums...pic=388658&st=0

You might have to copy some save games around to get it to load your existing save, but other than that, its works pretty well.

Indi
  • Indi

    Don't cross the streams.

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • None

#41

Posted 07 January 2009 - 07:11 AM

@CO6ALT: HAHAHA nice one!

kieranxp5
  • kieranxp5

    Crackhead

  • Members
  • Joined: 31 Dec 2008

#42

Posted 07 January 2009 - 08:23 AM

could someone possably make an asi to change niko into the biker models? That way I can do some cool textures, not very good at programing sad.gif

Intosia
  • Intosia

    Playa

  • Members
  • Joined: 11 Dec 2008
  • None

#43

Posted 07 January 2009 - 08:48 AM

QUOTE (HazardX @ Jan 7 2009, 00:49)
Yeah, a DotNet script hook (for C# and VB.Net) would be perfect! I already tried to compile the scripthook with managed extensions (to call other dotnet assemblies from it) but it crashes the game. sad.gif nevertheless, amazing work aru!

This is un-managed pure C++ code if im correct smile.gif I prefere unmanaged myself since i learned C++ in CBuilder 6.

Touho
  • Touho

    Player Hater

  • Members
  • Joined: 06 Dec 2008

#44

Posted 07 January 2009 - 10:13 AM

Where i put all files? I have Visual C++ 2005 Express Edition.

Intosia
  • Intosia

    Playa

  • Members
  • Joined: 11 Dec 2008
  • None

#45

Posted 07 January 2009 - 10:21 AM

QUOTE (Touho @ Jan 7 2009, 10:13)
Where i put all files? I have Visual C++ 2005 Express Edition.

Just open the SLN file? Or project file. Maybe you need 2008...

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#46

Posted 07 January 2009 - 10:33 AM

You need 2008 to open the sln file... for 2005, just create a empty Win32 DLL project and add the source files (cpp/h) to it.

And yes, this is fully unmanaged C++. I *think* it should still load up with IV if compiled with /clr, as long as you keep the CustomThread, NativeThread, NativeContext, etc classes as unmanaged since they are subclasses of game types.

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#47

Posted 07 January 2009 - 10:51 AM

QUOTE (aru @ Jan 7 2009, 10:33)
And yes, this is fully unmanaged C++. I *think* it should still load up with IV if compiled with /clr, as long as you keep the CustomThread, NativeThread, NativeContext, etc classes as unmanaged since they are subclasses of game types.

Yes, i tried that. It crashed. confused.gif I was suprised too. I converted other unmanaged projects to mixedmode/managed projects before, but yet i'm still VERY unexperienced in C++ and such a hook is a more special case too. I maybe did something wrong... i just added the /clr parameter and added "#pragma unmanaged" directives to all files, to be sure that no unwanted stuff is compiled as managed.

Touho
  • Touho

    Player Hater

  • Members
  • Joined: 06 Dec 2008

#48

Posted 07 January 2009 - 11:09 AM

QUOTE (Intosia @ Jan 7 2009, 10:21)
QUOTE (Touho @ Jan 7 2009, 10:13)
Where i put all files? I have Visual C++ 2005 Express Edition.

Just open the SLN file? Or project file. Maybe you need 2008...

Argh, 2008 version needs now activation. Can i download full version from somewhere?

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#49

Posted 07 January 2009 - 11:16 AM

QUOTE (Touho @ Jan 7 2009, 11:09)
Argh, 2008 version needs now activation. Can i download full version from somewhere?

Just get the Visual Studio 2008 Express Edition. It's free.

Touho
  • Touho

    Player Hater

  • Members
  • Joined: 06 Dec 2008

#50

Posted 07 January 2009 - 11:20 AM Edited by Touho, 07 January 2009 - 11:26 AM.

QUOTE (HazardX @ Jan 7 2009, 11:16)
QUOTE (Touho @ Jan 7 2009, 11:09)
Argh, 2008 version needs now activation. Can i download full version from somewhere?

Just get the Visual Studio 2008 Express Edition. It's free.

I have it, but it needs now activation because it is 30 days old or something.

L0uNGeR
  • L0uNGeR

    Ya, that's what I said.

  • Members
  • Joined: 03 Dec 2008

#51

Posted 07 January 2009 - 11:20 AM Edited by L0uNGeR, 07 January 2009 - 11:24 AM.

QUOTE
Register this product within 30 days. To receive your free registration key, click Register Product on the Help menu of your Express Edition. For more information, visit Registration Benefits .
tounge2.gif

DLL/ASI loader = "XLiveLess" or "ASI Loader"

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2016 [OpenIV]
    Best Tool 2013 [Sanny Builder]
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#52

Posted 07 January 2009 - 11:39 AM

XLiveLiss includes ASI loader so you can use both

saracoglu
  • saracoglu

    saracoglu

  • Members
  • Joined: 02 Jun 2002

#53

Posted 07 January 2009 - 12:08 PM

QUOTE (Touho @ Jan 7 2009, 12:20)
I have it, but it needs now activation because it is 30 days old or something.

So activate it. Activation is also free of charge

BeatFK
  • BeatFK

    Kill the Beat My man

  • Members
  • Joined: 17 Dec 2008

#54

Posted 07 January 2009 - 01:02 PM

QUOTE (C06alt @ Jan 7 2009, 05:34)
user posted image

I always wanted to go on a killing spree as Ricky Gervais sneaky2.gif
You made my dream come true , thanks a lot.

How you did that man ?

aceship
  • aceship

    Just An Indonesian Scripter

  • Members
  • Joined: 20 Dec 2008

#55

Posted 07 January 2009 - 02:15 PM

where is the compile button?

aliast
  • aliast

    Player Hater

  • Members
  • Joined: 24 Dec 2008

#56

Posted 07 January 2009 - 02:41 PM

QUOTE (aceship @ Jan 7 2009, 20:15)
where is the compile button?

Mayby F5?

xer0er
  • xer0er

    Too cool for school

  • Members
  • Joined: 29 Mar 2007

#57

Posted 07 January 2009 - 03:48 PM

Great. Time for me to get a copy of GTA IV for PC.
Looks a lot simpler than it could have been.

L0uNGeR
  • L0uNGeR

    Ya, that's what I said.

  • Members
  • Joined: 03 Dec 2008

#58

Posted 07 January 2009 - 04:15 PM

It creates
-- ScriptHook.dll
-- ScriptHook.dll.intermediate.manifest

Do I just rename ScriptHook.dll to ScriptHook.asi and that's it? Or do I need the manifest file too?

Dweirdo
  • Dweirdo

    Square Civilian

  • Members
  • Joined: 12 Dec 2008

#59

Posted 07 January 2009 - 04:30 PM

Thanks man pretty nice,I'm studying C# atm and it's kinda close.
though could you explain what to do, i tired to open it using MSOFT VISUAL STUDIO 2008, but it doesnt give me anything, maybe because i just have C#?

Intosia
  • Intosia

    Playa

  • Members
  • Joined: 11 Dec 2008
  • None

#60

Posted 07 January 2009 - 04:50 PM

QUOTE (L0uNGeR @ Jan 7 2009, 16:15)
It creates
-- ScriptHook.dll
-- ScriptHook.dll.intermediate.manifest

Do I just rename ScriptHook.dll to ScriptHook.asi and that's it? Or do I need the manifest file too?

No just the the dll, and indeed rename to asi smile.gif




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users