Quantcast

Jump to content

» «
Photo

[V] Script/Native Documentation and Research

1,020 replies to this topic
sjaak327
  • sjaak327

    Big Homie

  • Feroci
  • Joined: 01 Dec 2008
  • None
  • Modding Contribution Award

#61

Posted 07 July 2014 - 05:31 AM Edited by sjaak327, 07 July 2014 - 05:32 AM.

nicer does not mean better  :lol:

I'm talking specifically about interacting with GTAIV engine using the c++ hook only or interacting through the .net scripthook.
 
The .Net hook DOES in fact make the scripters job easier and to me that is better. I'm not talking which language is better as we all know c++ has it's advantages and .Net has its advantages. Just talking about working with the 2 hooks available.
 
Not to mention the .Net hook allows me to reload scripts I'm working on in game. I love being able to Alt-Tab to VS, change code... compile with a post build event to install the dll and alt-Tab back into game within a few seconds. This is all a matter of how things were designed and the .Net hook is so much nicer.

Aru's hook also has the ability to reload on the fly. I prefer the c++ hook over a.net precisely because it allows for more freedom, including the ability to call natives by hash. And it doesn't add another dependency just because it is easier to use, easy doesn't mean it is better.

what freedom do u gain i wonder? how do u reload asi scripts then?
 
plus i like c#... it really depends on what u like to code in


The .net hook didn't call game natives directly (even though you could call them directly) and had many things preconfigured. Yes that is indeed easier to use but makes customization harder to achieve.

The scripthook came with a development loader in which any asi/dll that was loaded could be unloaded and reloaded. Including the .net scripthook by the way. Which is another downside I mentioned before, it is another layer.
  • PacketOverload likes this

Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#62

Posted 07 July 2014 - 06:43 AM

I like c++ because in c++ we can recreate original game scripts and ingame there were many amazing things and also connected animations like the man stealing bicycle from the women in bus assasination mission etc. i was looking at the scripts and i began to understand. THe big problem is there are thousands of useless lines in the file all are + - +  0xc bit and strange things

These are not useless lines... 0x means you're writing a hex code.


byteMe420
  • byteMe420

    allah akbar!

  • BUSTED!
  • Joined: 02 Jul 2014
  • United-States

#63

Posted 07 July 2014 - 05:02 PM Edited by byteMe420, 09 July 2014 - 04:12 AM.

 

 

 

 

nicer does not mean better  :lol:

I'm talking specifically about interacting with GTAIV engine using the c++ hook only or interacting through the .net scripthook.
 
The .Net hook DOES in fact make the scripters job easier and to me that is better. I'm not talking which language is better as we all know c++ has it's advantages and .Net has its advantages. Just talking about working with the 2 hooks available.
 
Not to mention the .Net hook allows me to reload scripts I'm working on in game. I love being able to Alt-Tab to VS, change code... compile with a post build event to install the dll and alt-Tab back into game within a few seconds. This is all a matter of how things were designed and the .Net hook is so much nicer.

 

Aru's hook also has the ability to reload on the fly. I prefer the c++ hook over a.net precisely because it allows for more freedom, including the ability to call natives by hash. And it doesn't add another dependency just because it is easier to use, easy doesn't mean it is better.

 

what freedom do u gain i wonder? how do u reload asi scripts then?
 
plus i like c#... it really depends on what u like to code in

 


The .net hook didn't call game natives directly (even though you could call them directly) and had many things preconfigured. Yes that is indeed easier to use but makes customization harder to achieve.

The scripthook came with a development loader in which any asi/dll that was loaded could be unloaded and reloaded. Including the .net scripthook by the way. Which is another downside I mentioned before, it is another layer.

 

i see your point but i dont see the issue with another layer or an extra dependency with modding this game. Everything in the pc uses some api or dependency. I dont think we can notice the extra calls unless u run some tests but i believe it isnt significant so u go with what is easier to write instead of what may loop faster. I do get your point of customization but you can still do that in .net as u dont have to use the wrapped code. I actually check the source to see how the wrapped code works and i use or change when appropriate. I don't mean to get into a which hook is better debate because in the end it depends on which hook will allow u to accomplish your goal in a simple way. The .net hook wrapped code does have some nice helper code.

 

Also didnt realize u could unload.load asi scripts :O

 

edit: i also forgot to mention about yeah .net has to use JIT compiling but is this really a performance killer for gta? i have written asi scripts and then made the exact same script in .net and they behave the same

  • PacketOverload likes this

GooD-NTS
  • GooD-NTS

    OpenIV lead developer

  • Members
  • Joined: 03 May 2008
  • Russia
  • Best Tool 2016 [OpenIV]
    Best Tool 2012 [OpenIV]
    Major Contribution Award [Mods]

#64

Posted 08 July 2014 - 06:43 AM

I'd prefer to have native scripting through #sc editing than any of external hooks.
  • Frank.s, Silent, LINK/2012 and 1 other like this

NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Best Script or Plugin 2016 [SkyGfx] [Contribution]
    Best Conversion 2014 [ViIV for GTANY]
    Most Knowledgeable [Tech] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Contribution Award [Mods]

#65

Posted 08 July 2014 - 11:31 AM

I'd prefer to have native scripting through #sc editing than any of external hooks.

Native scripts lack debugger support and any development assistance whatsoever without completely changing the interpreter.

unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#66

Posted 08 July 2014 - 02:47 PM

I'd prefer to have native scripting through #sc editing than any of external hooks.

 

Agreed, much simpler and dont have to worry about any issues from those external hooks. I know people trying to get RPC working for ps3 are having trouble calling certain natives due to the function they are hooking into. 


Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#67

Posted 08 July 2014 - 03:39 PM Edited by Deji, 08 July 2014 - 03:39 PM.

Well, I'd prefer to, this time, completely skip all the documenting, researching and pain of most of this "native" stuff and just dive straight into my current idea of doing everything in a more custom/new way which is actually made to be modded instead of hacking something which isn't until we can use it. To me, our weakness has always been how long and tiring the fight to understand Norths custom formats, instead of doing the harder (at first) job of diving straight into the executable and hooking our own formats into it instead, which we'll have full control over, and actually understand.

unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#68

Posted 08 July 2014 - 05:45 PM

Well, I'd prefer to, this time, completely skip all the documenting, researching and pain of most of this "native" stuff and just dive straight into my current idea of doing everything in a more custom/new way which is actually made to be modded instead of hacking something which isn't until we can use it. To me, our weakness has always been how long and tiring the fight to understand Norths custom formats, instead of doing the harder (at first) job of diving straight into the executable and hooking our own formats into it instead, which we'll have full control over, and actually understand.

the executable tells us pretty much everything we need to know about the games file formats, its just the case of finding it. the only unknowns about the script files are really all native documentation and global variable documentation.

Things like knowing Global_2097152 is the array(of only 1 item for some reason) that stores all info relating to things like your garage cars and mp property


Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#69

Posted 08 July 2014 - 06:21 PM

Well, I'd prefer to, this time, completely skip all the documenting, researching and pain of most of this "native" stuff and just dive straight into my current idea of doing everything in a more custom/new way which is actually made to be modded instead of hacking something which isn't until we can use it. To me, our weakness has always been how long and tiring the fight to understand Norths custom formats, instead of doing the harder (at first) job of diving straight into the executable and hooking our own formats into it instead, which we'll have full control over, and actually understand.

the executable tells us pretty much everything we need to know about the games file formats, its just the case of finding it. the only unknowns about the script files are really all native documentation and global variable documentation.
Things like knowing Global_2097152 is the array(of only 1 item for some reason) that stores all info relating to things like your garage cars and mp property


Meh, not looked into that side of things yet. I'm still fully focused on working on completely separate things, which CAN be implemented on V when the proper time comes, or any other game for that matter. With the games file formats, we can only do the things they're made for. With a good enough understanding of the executable, we can do anything. All we have to do is work on our own formats and tools, then find a way to implement them.

Cracking formats is the easier, and possibly quicker of the two options at first, but to have our own open-source tools and formats which can be adapted to all the GTA games is my current stance. I'm all for cracking North's formats, mostly just because I'm interested in their development processes, but I reckon infinite power can only be gained by doing something a lot more independent.
  • Alexander likes this

NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Best Script or Plugin 2016 [SkyGfx] [Contribution]
    Best Conversion 2014 [ViIV for GTANY]
    Most Knowledgeable [Tech] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Contribution Award [Mods]

#70

Posted 08 July 2014 - 08:17 PM

 

I'd prefer to have native scripting through #sc editing than any of external hooks.

 

Agreed, much simpler and dont have to worry about any issues from those external hooks. I know people trying to get RPC working for ps3 are having trouble calling certain natives due to the function they are hooking into. 

 

... that's just a case of the 'current thread' variable being unset, at least assuming 'certain natives' include model requesting and whatnot.


sjaak327
  • sjaak327

    Big Homie

  • Feroci
  • Joined: 01 Dec 2008
  • None
  • Modding Contribution Award

#71

Posted 08 July 2014 - 09:17 PM

I'd prefer to have native scripting through #sc editing than any of external hooks.


The problem with that is that it requires users to edit the scripts.rpf. At the time the hooks for IV were released, there wasn't even an option to edit game scripts directly.

I personally use win32 API calls for some of my stuff (apart from the game natives, and using VS and compile is preferred over editing the scripts directly imho.

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#72

Posted 08 July 2014 - 09:54 PM

By the way, does anyone have any plans for inevitable .exe patches? There's obviously gonna be loads of them and they will screw our progress up with each update.

NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Best Script or Plugin 2016 [SkyGfx] [Contribution]
    Best Conversion 2014 [ViIV for GTANY]
    Most Knowledgeable [Tech] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Contribution Award [Mods]

#73

Posted 09 July 2014 - 02:49 AM

By the way, does anyone have any plans for inevitable .exe patches? There's obviously gonna be loads of them and they will screw our progress up with each update.

pattern-based matching of code

Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None
  • Best Tool 2016 [OpenIV]
    Major Contribution Award [Mods]

#74

Posted 09 July 2014 - 12:40 PM Edited by Alexander Blade, 09 July 2014 - 01:07 PM.

Quite a discussion you have here , I guess you guys forgot that script editing usually means 

1. Decompiler -> Compiler (a lot of stuff to do in order to make code compilable) , not talking about tools which force user to deal with low level

2. Rpf editing each time you change the script - this is not user friendly at all

3. Possibility to break game saves (it's harder than it was for IV but still)

4. As was mentioned above - requires custom debugger writing

5. You will definitely need to write custom natives in order to extend functionality

6. ?????

7. PROFIT

 

It is 7 : 1 :D

 

unknown modder

Everything works fine when you are doing it the way game does 

 

Deji

The simplest way is actually the one with editing resources as they are (like it is in openFormats) , resource is a game class memory dump , which is being directly mapped into the game's class instance , it's not possible to change internal stuff like this without rewriting rage from scratch :) Unification is definitely good but only when it's not being overcomed by per-resource unique features .


unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#75

Posted 09 July 2014 - 04:24 PM

Quite a discussion you have here , I guess you guys forgot that script editing usually means 

1. Decompiler -> Compiler (a lot of stuff to do in order to make code compilable) , not talking about tools which force user to deal with low level

2. Rpf editing each time you change the script - this is not user friendly at all

3. Possibility to break game saves (it's harder than it was for IV but still)

4. As was mentioned above - requires custom debugger writing

5. You will definitely need to write custom natives in order to extend functionality

6. ?????

7. PROFIT

 

It is 7 : 1 :D

 

unknown modder

Everything works fine when you are doing it the way game does 

If you know how to use the low level its still pretty easy to write fairly advanced scripts with it. You have seen the things me and toothpik(and a few others) have made just creating scripts in low level. 


Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None
  • Best Tool 2016 [OpenIV]
    Major Contribution Award [Mods]

#76

Posted 12 July 2014 - 05:20 AM Edited by Alexander Blade, 12 July 2014 - 05:21 AM.

Well low level is a low level , no more no less , thats why Write in C

 

  • ThirteenAG, Silent, TJGM and 5 others like this

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#77

Posted 12 July 2014 - 06:42 PM

/\ lol


TemporaryAccount7
  • TemporaryAccount7

    Needs help

  • BUSTED!
  • Joined: 22 Jul 2014
  • None

#78

Posted 22 July 2014 - 09:11 PM Edited by TemporaryAccount7, 22 July 2014 - 09:12 PM.

Write in C not VB.

If Julio Writes in C he will make scripts better than the ones of rockstar.

Julio is the best gta coder. even better than Aaron Garbut, Adam Fowler, Adam Cochrane, The Benz and everyone


Anas12
  • Anas12

    Player Hater

  • Members
  • Joined: 04 May 2013

#79

Posted 23 July 2014 - 05:32 AM

guys I new here, can you plz tell which software language should I use to code GTA V


Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None
  • Best Tool 2016 [OpenIV]
    Major Contribution Award [Mods]

#80

Posted 23 July 2014 - 05:35 AM

guys I new here, can you plz tell which software language should I use to code GTA V

You can't code for GTA V til PC release 

  • pogo_01 likes this

byteMe420
  • byteMe420

    allah akbar!

  • BUSTED!
  • Joined: 02 Jul 2014
  • United-States

#81

Posted 28 July 2014 - 06:35 PM Edited by byteMe420, 28 July 2014 - 06:36 PM.

 

guys I new here, can you plz tell which software language should I use to code GTA V

You can't code for GTA V til PC release 

 

Well when released, I imagine it will be setup for C++ like the previous scripthook. I know a V .net hook is planned as well.


Alvarez
  • Alvarez

    Boss

  • Members
  • Joined: 03 Oct 2013

#82

Posted 28 July 2014 - 10:03 PM

So, learn C++ to start understanding the code and later change to easier script languages is the key, huh?

Angel Script, Lua and C++ novice here.

XeClutch
  • XeClutch

    Founder of Phantomware

  • Feroci
  • Joined: 30 Jan 2013
  • Israel

#83

Posted 29 July 2014 - 03:56 PM

I knew you guys had something good in store for everyone, nice topic and research!

 

Fixes on your list:

Spoiler

 

 

My edits to the list (parameters, returns..ect..)

 

Namespace Vehicle:

Spoiler

 

Namespace Player

Spoiler

 

Namespace Entity

Spoiler

 

Namespace Ped

Spoiler

 

Namespace Gameplay

Spoiler

I meant to reply earlier but SET_TIME_SCALE is wrong. If you look at the function it edits a float.

e230cdcdb381da653aea1cd88de3067e.png

 

Here you see it being called with a float.

1779ea1c7aef0641c0eef0bbcc681cf3.png

 

I use this and it works fine:

void SET_TIME_SCALE(float timeScale);
  • Skorpro likes this

Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None
  • Best Tool 2016 [OpenIV]
    Major Contribution Award [Mods]

#84

Posted 30 July 2014 - 07:09 AM Edited by Alexander Blade, 30 July 2014 - 07:09 AM.

When gtamodding wiki will work I'll add my current c++ header with native declarations , so before every change you post here you will make it in the wiki , currently login doesn't work there

  • XBLToothPik, XeClutch and Aleph-Zero like this

casscode
  • casscode

    Player Hater

  • New Members
  • Joined: 18 May 2014
  • None

#85

Posted 31 July 2014 - 08:53 AM Edited by casscode, 31 July 2014 - 08:55 AM.

i firstly would like to thank all the devs that make scripting for gta possible. then a question. instead of creating a wrapper for the .net framework. why not use the more accessible languages(by accessible, i mean that one does not have to install a large framework for the runtime) like d or rust, or even use luajit this time around.

 

plus eventually the game will be playable on *nix through wine, and using the scripthook.net bindings on wine is not easy


Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None
  • Best Tool 2016 [OpenIV]
    Major Contribution Award [Mods]

#86

Posted 31 July 2014 - 09:58 AM

 

plus eventually the game will be playable on *nix through wine

SLvPl7a.png Yeeeees , wiiiiiiiine , GTA V probably won't support dx9 at all

  • Sergiu likes this

casscode
  • casscode

    Player Hater

  • New Members
  • Joined: 18 May 2014
  • None

#87

Posted 31 July 2014 - 10:07 AM

 

 

plus eventually the game will be playable on *nix through wine

SLvPl7a.png Yeeeees , wiiiiiiiine , GTA V probably won't support dx9 at all

 

yes, but wine may eventually support dx10/11


Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None
  • Best Tool 2016 [OpenIV]
    Major Contribution Award [Mods]

#88

Posted 31 July 2014 - 11:07 AM

gta iv under wine still runs on 5fps using good hardware , the only way to play it on wine was to use gallium-nine drivers with patched wine

 

the only reason ppl used .net scripthook is cuz it was easy to use classes with msvs ide integration


WhiteHulk
  • WhiteHulk

    Player Hater

  • New Members
  • Joined: 31 Jul 2014
  • American-Samoa

#89

Posted 31 July 2014 - 11:59 PM

My mind is basicle blown

Aleph-Zero
  • Aleph-Zero

    ...

  • Members
  • Joined: 11 Jan 2014
  • None

#90

Posted 01 August 2014 - 09:41 PM

i firstly would like to thank all the devs that make scripting for gta possible. then a question. instead of creating a wrapper for the .net framework. why not use the more accessible languages(by accessible, i mean that one does not have to install a large framework for the runtime) like d or rust, or even use luajit this time around.

 

plus eventually the game will be playable on *nix through wine, and using the scripthook.net bindings on wine is not easy

 

"why not use the more accessible languages(by accessible, i mean that one does not have to install a large framework for the runtime)"

 

Every windows machine capable of running GTA V comes with .net framework installed.

 

Also .Net just blows everything else out of the water imo (in ease of use and libraries).

So much stuff you don't have to worry about, you just need to worry about what your script will actually do.

 

"plus eventually the game will be playable on *nix through wine, and using the scripthook.net bindings on wine is not easy"

Even if they manage to run GTA V on linux, there's a big chance scripthook won't work. And if it does, there's mono which comes with the most popular distros.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users