Quantcast

Jump to content

» «
Photo

[V] Script/Native Documentation and Research

1,113 replies to this topic
Alexander Blade
  • Alexander Blade

    Come As You Are

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

#1

Posted 20 June 2014 - 11:32 PM Edited by Alexander Blade, 20 March 2016 - 04:03 PM.

NATIVE DB

Script/Native Documentation and Research

 

Describing and researching what actually GTA V scripts do as well as describing native (i.e. script api functions) names, parameters and giving them a description.

 

This topic is related to the NATIVE DB project, which is aimed to gather every piece of information about script native functions that we have, think of it as of native wiki where anyone who wants to contribute can do so and everyone who needs the latest script documentation or the header with natives for ScriptHook can get it in one click!

 

#SCRIPTS

Spoiler

 

#NATIVES

Spoiler

 

#NAMING NATIVES

Spoiler
  • gamerzworld, alienstyles_, Deji and 38 others like this

Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#2

Posted 22 June 2014 - 03:09 PM Edited by Maro Hannover, 22 June 2014 - 03:11 PM.

YOU ARE THE MOST Genius Guy in this FORUMS!

 

Will it be possible to write missions like the SCM engine in GTA SA? GTA IV Opcodes were useless and difficult


Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#3

Posted 22 June 2014 - 03:13 PM

Will it be possible to write missions like the SCM engine in GTA SA? GTA IV Opcodes were useless and difficult


Obviously not. SCM is over.

Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#4

Posted 22 June 2014 - 03:16 PM

The most important thing will i be able to create missions (I am not talking about DYOM I am talking about coding) ?


Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#5

Posted 22 June 2014 - 03:33 PM

will i be able to create missions (I am not talking about DYOM I am talking about coding) ?


YOU won't. The others might be.
  • LINK/2012, Xyn, stef538 and 3 others like this

Delta India Echo
  • Delta India Echo

    f*ck crate drops

  • BUSTED!
  • Joined: 08 Jun 2014
  • Somalia

#6

Posted 22 June 2014 - 03:37 PM

Console modding allowed now?


Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#7

Posted 22 June 2014 - 03:38 PM

Console modding allowed now?


It's more of a preparation for a PC release.
  • Delta India Echo likes this

Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#8

Posted 22 June 2014 - 03:38 PM

What are you saying! i am a coder! the last 3 days i was practicing and thinking about c# i swear! So stop making fun or will ban you because there will be 1 billion views in this threads as our text is in the Top.


TJGM
  • TJGM

    Boss

  • Members
  • Joined: 14 Jun 2011
  • Ireland
  • Helpfulness Award
    Contribution Award [Mods]

#9

Posted 22 June 2014 - 03:44 PM

What are you saying! i am a coder! the last 3 days i was practicing and thinking about c# i swear! So stop making fun or will ban you because there will be 1 billion views in this threads as our text is in the Top.


I see why you're in the 'special members' group.
  • Davo the Assassin, s-paco, Skorpro and 15 others like this

Alexander Blade
  • Alexander Blade

    Come As You Are

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

#10

Posted 22 June 2014 - 07:55 PM

Most useful links added , enjoy the research and use it smart ;)

  • Silent, TJGM, Harsh IV and 1 other like this

Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#11

Posted 22 June 2014 - 08:21 PM

Thanks!


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#12

Posted 22 June 2014 - 08:35 PM

too bad the first thread is being bombarded by Maro's wackiness... lol

 

Keep up the good work Alexander

  • Skorpro and leftas like this

Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#13

Posted 22 June 2014 - 09:22 PM

I don't know if this is the right place to ask but any clues on why they are using these weird function names (not hashes) such as sub_27F();?

  • Element-43 likes this

Alexander Blade
  • Alexander Blade

    Come As You Are

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

#14

Posted 22 June 2014 - 09:28 PM

this is the functions that are in script , not the natives , the one who generates such names is me , such functions have no names so I need to name them somehow , so I'm doing it in a classic way as sub_ (which stands for subroutine) with function address in script :)


Noox
  • Noox

    changeScriptAbility(&myScriptAbility, "improve");

  • Members
  • Joined: 20 Jun 2014
  • None

#15

Posted 22 June 2014 - 09:30 PM Edited by Noox, 22 June 2014 - 09:32 PM.

Ah alright, sorry but it's a little bit confusing.

So once you you get the hash list should it be easier to understand the code?

Also thanks for all the effort into this :)

  • Element-43 likes this

bread
  • bread

    The Boss

  • The Connection
  • Joined: 27 Jul 2011
  • United-States

#16

Posted 22 June 2014 - 09:40 PM

What are you saying! i am a coder! the last 3 days i was practicing and thinking about c# i swear! So stop making fun or will ban you because there will be 1 billion views in this threads as our text is in the Top.

Get a life.

XBLToothPik
  • XBLToothPik

    c0de

  • Feroci
  • Joined: 21 Nov 2012
  • None

#17

Posted 22 June 2014 - 10:27 PM Edited by XBLToothPik, 23 June 2014 - 01:51 AM.

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
  • Alexander Blade, Frank.s and Colata 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]

#18

Posted 22 June 2014 - 11:11 PM

NETWORK::NETWORK_IS_HOST_OF_THIS_SCRIPT //0x6970BA94

AH YES THAT'S EXACTLY THE THING WITH RAGE NETWORKING, RESPONSIBILITY MIGRATION

AND EXACTLY THE ONE THING NEEDED FOR LARGE SCALE WORLDS WITH MULTIPLE COMMON SCRIPTS AS OPPOSED TO IV'S SPECIFIC GAMEMODES
  • Deji likes this

unknown modder
  • unknown modder

    Bon Jon Bovi

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

#19

Posted 22 June 2014 - 11:12 PM

Are the native name groups the different functions in the executable that list all the natives, because there are about 40 functions in there that list native hashes

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]

#20

Posted 22 June 2014 - 11:16 PM

Are the native name groups the different functions in the executable that list all the natives, because there are about 40 functions in there that list native hashes

going by past research by these people, yes.


Alexander Blade
  • Alexander Blade

    Come As You Are

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

#21

Posted 22 June 2014 - 11:17 PM

Are the native name groups the different functions in the executable that list all the natives, because there are about 40 functions in there that list native hashes

This groups are that functions , 1 function is 1 group , just the order of groups we have here is different from the order that functions are being called


Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#22

Posted 23 June 2014 - 02:41 AM

OFF: I'm in vacation and I have partied... so I still drunk (since 3 days... ;)) POLISH PARTY rulez :) <- beautiful girls and cheap high proof ALC :beerhat:

Anyway...
I know why I mention Alexander Blade in all my mods!!! He's the most important guy in this scene!!!!
NO - I'M NOT A ASSHAMSTER ;) But  this guy is great -> thanx for your great work, Alex!

 

stupid code...

using namespace ENTITY, VEHICLE, AI;

// Global vars
Vehicle car;
Ped ped;
Vector3 vec;
eModel model = 0x?????????;

// In functions...
GET_ENTITY_COORDS(ped, &vec);
car = CREATE_VEHICLE(model , vec.X, vec.Y, vec.Z, 0.0f, true, true);
SET_VEHICLE_ON_GROUND_PROPERLY(car);
//CREATE_PED_INSIDE_VEHICLE(Any p0, Any p1, Any p2, Any p3, Any p4, Any p5);
TASK_WARP_PED_INTO_VEHICLE(ped, car, -1); // -1 = immediately

lol... first lame try ;)

  • Frank.s likes this

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#23

Posted 23 June 2014 - 03:10 AM

let the games begin

  • Skorpro, Aleph-Zero, Wiebrendh and 1 other like this

TheVideoVolcano
  • TheVideoVolcano

    *bleep*

  • Members
  • Joined: 05 May 2014
  • United-Kingdom

#24

Posted 23 June 2014 - 03:28 AM

Blade, you're smartest guy I've ever met, and your too stupid to see... Aru made up his mind 10 minutes ago. Do what you were gonna do....

 

I kidd.

 

Well done, thanks for all your skills, continued commitment and reverse engineering!

 

and they called him... "BLADE".

 

...I'll go.

  • Silent likes this

keyflamer
  • keyflamer

    Player Hater

  • Members
  • Joined: 13 Jul 2012

#25

Posted 23 June 2014 - 04:48 AM

OFF: I'm in vacation and I have partied... so I still drunk (since 3 days... ;)) POLISH PARTY rulez :) <- beautiful girls and cheap high proof ALC :beerhat:

Anyway...
I know why I mention Alexander Blade in all my mods!!! He's the most important guy in this scene!!!!
NO - I'M NOT A ASSHAMSTER ;) But  this guy is great -> thanx for your great work, Alex!

 

stupid code...

using namespace ENTITY, VEHICLE, AI;

// Global vars
Vehicle car;
Ped ped;
Vector3 vec;
eModel model = 0x?????????;

// In functions...
GET_ENTITY_COORDS(ped, &vec);
car = CREATE_VEHICLE(model , vec.X, vec.Y, vec.Z, 0.0f, true, true);
SET_VEHICLE_ON_GROUND_PROPERLY(car);
//CREATE_PED_INSIDE_VEHICLE(Any p0, Any p1, Any p2, Any p3, Any p4, Any p5);
TASK_WARP_PED_INTO_VEHICLE(ped, car, -1); // -1 = immediately

lol... first lame try ;)

Don't forget to declare X, Y, and Z as a float.


Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#26

Posted 23 June 2014 - 05:03 AM Edited by Skorpro, 23 June 2014 - 05:05 AM.

Don't forget to declare X, Y, and Z as a float.

 

Normally you're right but normally 'Vector3' must be declared previously (in ScriptHook) like this:

struct Vector3
{
    float x, y, z;
};

Anyway... the 'script' above -> I didn't mean it ;)


XBLToothPik
  • XBLToothPik

    c0de

  • Feroci
  • Joined: 21 Nov 2012
  • None

#27

Posted 23 June 2014 - 05:49 AM Edited by XBLToothPik, 23 June 2014 - 06:04 AM.

 

Don't forget to declare X, Y, and Z as a float.

 

Normally you're right but normally 'Vector3' must be declared previously (in ScriptHook) like this:

struct Vector3
{
    float x, y, z;
};

Anyway... the 'script' above -> I didn't mean it ;)

 

:p

 

 

 

Actually, in V, the native GET_ENTITY_COORDS returns the vector so you don't have to add it in as a parameter.  Code would look something like this. (Using V's natives, very similar to an IV method)

void main()
{
Ped myPed = PLAYER_PED_ID();//Get My Ped
Vector3 myCoords = GET_ENTITY_COORDS(myPed, 0);
myCoords.Z += 10.0f;
SET_ENTITY_COORDS(myPed, myCoords.X, myCoords.Y, myCoords.Z, 1, 0, 0, 1);
}

void main()
{
Vector3 myPos = GET_ENTITY_COORDS(PLAYER_PED_ID(), 0);
Vehicle veh = CREATE_VEHICLE(GET_HASH_KEY("ADDER"), myPos.X, myPos.Y, myPos.Z, GET_ENTITY_HEADING(PLAYER_PED_ID()), 0, 0);
SET_PED_INTO_VEHICLE(PLAYER_PED_ID(), veh, -1); //-1 = seat index
}

 The second param in GET_ENTITY_COORDS is unknown, and the last 4 params in SET_ENTITY_COORDS are unknown.

Displaying text (frame at a time)

void main()
{
     While (true)
     {
          WAIT(0);
          DisplayText("Alexander Blade is Awesome", 0.5f, 0.5f);
     }
}
 
void DisplayText(char *text, float 2dX, float 2dY)
{
     SetUpWhiteDraw();
     _0x3E35563E("STRING") //text display type
     _0x27A244D8(text); // add the text component
     _0x6F8350CE(2dX, 2dY);//actually draw the text
}
 
void SetUpWhiteDraw()
{
     SET_TEXT_FONT(0);
     SET_TEXT_SCALE(0.40f, 0.40f);
     SET_TEXT_COLOUR(255, 255, 255, 255);
     SET_TEXT_WRAP(0.0f, 1.0f);
     SET_TEXT_CENTRE(0);
     SET_TEXT_DROPSHADOW(0, 0, 0, 0, 0);
     SET_TEXT_EDGE(0, 0, 0, 0, 0);
}

Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#28

Posted 23 June 2014 - 06:43 AM

Ermm, could it be that GTA V using the same hashes?!? If yes...

enum eModel
{
	MODEL_ADDER = 0xB779A091,
	MODEL_ENTITYXF = 0xB2FE5CF9,
	MODEL_CHEETAH = 0xB1D95DA0,
	MODEL_ZTYPE = 0x2D3BD401,
	MODEL_MONROE = 0xE62B361B,
	MODEL_JB700 = 0x3EAB5555,
	MODEL_STINGERGT = 0x82E499FA
}

HashGen

 

...else sorry for posting scrap :)


Maryo_Nicle7
  • Maryo_Nicle7

    Formerly known as Rizqan7

  • Members
  • Joined: 25 Jul 2013
  • Indonesia

#29

Posted 23 June 2014 - 11:13 AM

Wow first GTA V modding topic there! :D
I just can say good luck for searching those code guys! ;)

Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#30

Posted 23 June 2014 - 11:58 AM

Will the Natives Parameters will be solved because in GTA IV most of the natives have no documentation for paramaters. and is c++ and c are the same?

I know c# i 've studied it very well. Will it be easy for c# users to code c++. i 've heard alot that c# is very similar to c++ and javascript lua.

VECTOR3

this was from Scripthookdotnet. it is wierd for a 5 years game development to use the same param and functions as gta iv but Both are the same era as well as Alexander said that all Rage Games uses the Same Byte Code but i still feel it may be had been changed to be

VECTOR6




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users