Quantcast

Jump to content

» «
Photo

Generic GTA 4 documentation

38 replies to this topic
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]

#1

Posted 26 December 2008 - 05:42 PM

As scripting in GTA 4 is more or less available (thanks to Alexander and his Alice), I propose to begin collecting information about how things work. We were doing similar in that topic.

So post your findings there.

I begin.

List of all native functions of GTA 4

List of statistics IDs

P.S. Please, also consider adding your findings to the GTAModding Wiki! Its really easy and you will much help to the community.
  • Alexander Blade and Sweet Bellic like this

ceedj
  • ceedj

    PEDS Creator

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

#2

Posted 27 December 2008 - 01:30 AM Edited by ceedj, 27 December 2008 - 01:34 AM.

Gawd I hate to muck up this topic with stupid questions, but I can't reconcile this.

In the "example" script main.sc, we have this:

CREATE_CAR CAR_CHEETAH -1138.406f -661.471f -100.0f TEST_CAR (5 params)

CREATE_CHAR PEDTYPE_CIVMALE male01 1500.0 -1660.0 13.0f test_char (6 params)

Looks like our friendly standard GTA III through SA scripting. But in Alexanders used_natives_parameters file, we have this:

CREATE_CAR=6, False

CREATE_CHAR=7, False

In each, an extra parameter. I REALLY want to help figure some of this out, but I can't figure out those extra two params. I thought maybe it was a boolean function in there (true/false), but then you've got this. GET_CAR_MODEL=2, False, which probably follows the old way of Var Car, Var Model.

Am I missing something blindingly obvious? cry.gif

ALSO, can we load/check model loading with Alice yet?

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#3

Posted 27 December 2008 - 02:36 AM

Don't look at main.sc... its the same file that was in SA and hasn't changed! smile.gif

If you would like to see some of the natives as they are used in GTAIV to better understand the parameters/etc, the latest version of SparkIV supports decompiling the .sco files into a C-like format. The info from there will certainly help to fill in the Wiki pages smile.gif

ceedj
  • ceedj

    PEDS Creator

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

#4

Posted 27 December 2008 - 02:41 AM Edited by ceedj, 27 December 2008 - 03:16 AM.

Oh sure, make me look all stupid and stuff. lol.gif

Thanks aru, appreciated. smile.gif

EDIT: Ok.

CREATE_CHAR(26, 0xd55caac, -247.282f, 951.638f, 2.7161f, &L[1123], 1);

PedType, Model, X, Y, Z, LocalHandle, Bool(?)

Found a 1 at the end of every entry I've seen so far. Maybe it IS a bool? Same with create_car and create_object as well....

Interesting. wink.gif

EDIT2: Either a defined local (L[1023] packie2) or a hex (0x7eed7363) is used as the model name in most instances. Or this is the decompilation at work.

EDIT3: Pedtypes most common are 26 and 25 with a few 4, 5, and 7's sprinkled in. If we follow the old games' tendancies, 4 would be CivMale, 5 is CivFemale, 7 is a gang (I think) and 25 and 26 would be specials. Special Female and Special Male? I'M SPECIAL DARN IT! tounge.gif

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#5

Posted 27 December 2008 - 03:24 AM

L[1123] is where the created Char object will be stored... Essentially thats just storage index in the Script Local Variables (only used for that script). When its a G[xxx], thats the Global Variables shared by all scripts.

So passing in &L[1123] is just passing a pointer to that. After the function is called L[1122] would return the Char object. And yeah, the last param always seems to be 1. Unfortunately, the script engine doesn't differentiate between ints or bools.

Edit: Oh yeah, the models are all hashes. No real names are used... we have a make a mapping of the hash -> names.

ceedj
  • ceedj

    PEDS Creator

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

#6

Posted 27 December 2008 - 03:35 AM Edited by ceedj, 27 December 2008 - 03:43 AM.

QUOTE (aru @ Dec 26 2008, 23:24)
L[1123] is where the created Char object will be stored... Essentially thats just storage index in the Script Local Variables (only used for that script). When its a G[xxx], thats the Global Variables shared by all scripts.

So passing in &L[1123] is just passing a pointer to that. After the function is called L[1122] would return the Char object. And yeah, the last param always seems to be 1. Unfortunately, the script engine doesn't differentiate between ints or bools.

Edit: Oh yeah, the models are all hashes. No real names are used... we have a make a mapping of the hash -> names.

Ok, I think that's the technical/C way of saying L[1122] = @ACTOR_PACKIE, since it does essentailly what you just described. I think most of us are used to Barton's/Sanny way of describing things, hence the sort of confusion.

I suck at pointers BTW. Can't you tell? lol.gif

Shame I have to work early tomorrow; I could mess with this stuff all night. Thanks again for putting the work into this. smile.gif.

EDIT: Oh, I see what you are saying, you were referring to the local in the model slot. Yeah, same thing, I think.

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#7

Posted 27 December 2008 - 03:47 AM

Yup.. I saw the Barton/Sanny way of doing things and I found it too confusing for myself, so I went with a C like approach. Besides, that was dealing with opcodes, however this is more like real code when decompiled.

Simon.
  • Simon.

    Gangsta

  • The Connection
  • Joined: 01 Feb 2005

#8

Posted 27 December 2008 - 07:33 AM

I was looking at the sixaxis tutorial script (sixaxistutorial.sco in script.img) and these stood out:

LOAD_TXD( szTextureLibrary[ ] ); // Returns iTextureLibraryHandle (szTextureLibrary is a *.wtd file)
GET_TEXTURE( iTextureLibraryHandle, szTextureName[ ] ); // Returns iTextureHandle (szTextureName is a *.dds file within the TextureLibrary)

RELEASE_TEXTURE( iTextureHandle ); // Released before REMOVE_TXD
REMOVE_TXD( iTextureLibraryHandle ); // Released after releasing the textures

The textures must be drawn with DRAW_SPRITE for them actually to show up, there's work with things named "widgets" so it gets very confusing here. I'll note down what I think for reference:

DRAW_SPRITE( iTextureHandle, fXPosition(?), fYPosition(?), iWidgetFloatSliderReference(?), iWidgetFloatSliderReference(?), fA, iB, iC, iD, iE);

iB, iC, iD, iE commonly had the values of "255, 255, 255, 255". I'm assuming that they're "Alpha, Red, Green, Blue" or "Red, Green, Blue, Alpha" values.

fA commonly had the value of 0.0f, I have no clue what it stands for but rotation on screen or size scale are hunches.

fXPosition and fYPosition were assumed because I see no other place where the X, Y position of the sprite is determined. Unless of course they're determined in the "ADD_WIDGET_FLOAT_SLIDER" function, if they're not position then they I'd assume they're XScale and YScale. The y-value was associated with the second reference value in "GET_HELP_MESSAGE_BOX_SIZE" (this function has 2 parameters, which are both reference values (X and Y scale?)).

Anyways, I think I'm blabbering now blush.gif ...

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]

#9

Posted 27 December 2008 - 11:17 AM

List of models hashes

ceedj
  • ceedj

    PEDS Creator

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

#10

Posted 27 December 2008 - 10:15 PM Edited by ceedj, 28 December 2008 - 10:02 AM.

How...wha...whe...did...

ARGH!!!!

I hate that ya'll are so much smarter than I. lol.gif

Oh, nice job too Seemann. And thanks for fixing my Wiki entries; I'll do my best to use your format in the future. wink.gif

EDIT: Added a few more to the Wiki (CREATE OBJECT, CREATE CAM, some others).

klanly
  • klanly

    Player Hater

  • Members
  • Joined: 11 Dec 2008

#11

Posted 28 December 2008 - 08:50 AM Edited by klanly, 28 December 2008 - 08:53 AM.

QUOTE (Seemann @ Dec 27 2008, 11:17)
List of models hashes

My question: How to use these hashes in the lua script? Is it PushInt(Dec.), or Pushxxx(Hex.)?

I've found something like this in network_main.sco (which in script_network.img):

CHANGE_PLAYER_MODEL(sub_bb(), GET_PLAYERSETTINGS_MODEL_CHOICE())

the "sub_bb" is playerindex; the "GET_PLAYERSETTINGS_MODEL_CHOICE()" may be the hash, for there is REQUEST_MODEL(GET_PLAYERSETTINGS_MODEL_CHOICE()) in this script.

BTW, the native CHANGE_PLAYER_MODEL do change the model (or props) of the player, here's a video of "transformation" below..

http://www.youtube.c...h?v=WP_vYksdPJE
(I didn't know anything about hashs when i made this video. Maybe some program exception caused this result biggrin.gif )

Thanks for reply.

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]

#12

Posted 28 December 2008 - 11:30 AM

QUOTE (klanly @ Dec 28 2008, 16:50)
My question: How to use these hashes in the lua script? Is it PushInt(Dec.), or Pushxxx(Hex.)?

Hash decimal and hash hexadimal are same numbers they are just in different representation. You may use any of them. According to the Lua manual it supports both types.

QUOTE
Lua also accepts integer hexadecimal constants, by prefixing them with 0x.


And both these numbers are integer so use PushInt.

@aru, Simon, ceedj: thanks for your articles smile.gif

mystra007
  • mystra007

    Wannabe Game Developer

  • Members
  • Joined: 11 May 2002

#13

Posted 29 December 2008 - 04:52 AM

I just wanted to know where we were about the .sco file format. I'm trying to decipher the format myself, but I think its a bit useless since I assume it's already "readable" and full of opcodes? What about the WHM? They all seem to start with the same script command:

unsigned char rawData[16] =
{
0x52, 0x53, 0x43, 0x05, 0x01, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1A, 0xD4, 0x78, 0xDA, 0xEC, 0x7D,
} ;

0x78 to 0x7D seems to be common to all WHM files. (Except for the header which I assume to be 0x52 to the double 0x18s)

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#14

Posted 02 January 2009 - 08:55 PM

QUOTE (mystra007 @ Dec 28 2008, 23:52)
I just wanted to know where we were about the .sco file format. I'm trying to decipher the format myself, but I think its a bit useless since I assume it's already "readable" and full of opcodes? What about the WHM? They all seem to start with the same script command:

unsigned char rawData[16] =
{
0x52, 0x53, 0x43, 0x05, 0x01, 0x00, 0x00, 0x00, 0x18, 0x18, 0x1A, 0xD4, 0x78, 0xDA, 0xEC, 0x7D,
} ;

0x78 to 0x7D seems to be common to all WHM files. (Except for the header which I assume to be 0x52 to the double 0x18s)

You could look at the SparkIV source code to figure out most of the sco format... perhaps someone can write it up neatly on the wiki... since the source is somewhat crude.

http://code.google.c...cripting/Script

Key files of interest:
File.cs
Header.cs
OpCode.cs (Note that I mostly named the OpCode by myself, and they're not "real" R* names... perhaps we need to standardize on something for the OpCode definitions)

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]

#15

Posted 08 January 2009 - 11:48 AM

List of radar blips

use these IDs in the native function CHANGE_BLIP_SPRITE.

Sacky
  • Sacky

    IV's Limit Adjuster

  • Members
  • Joined: 10 Nov 2006

#16

Posted 12 January 2009 - 12:28 PM

Does anyone know what the parameters of ACTIVATE_SCRIPTED_CAMS are? I know there are 2 bools and no return, but I can't decide what each represents.

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]

#17

Posted 21 August 2009 - 03:15 AM

Move this topic please in
http://www.gtaforums...p?showforum=251

spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#18

Posted 31 August 2009 - 12:40 PM Edited by spaceeinstein, 15 September 2009 - 01:47 AM.

Is there anyway to get the names of the garages? I'm using the Placement Tool and it views the garage names as hash. This is what I have from the SCO files

bs3MG - Garage used in "Clean Getaway"
BxGRG1 - Stevie's garage
PaulMH3 - Garage used in "Harboring a Grudge"
QW2MG1 - Garage used in "Crime and Punishment"

EDIT AGAIN: Interesting functions
SET_PHONE_HUD_ITEM
Shows the little message above the radar when you receive a text or contact, this shows a list of available IDs for each event.

START_CUSTOM_MOBILE_PHONE_RINGING
A COMPLETE list of all available ringtones in the game. It even includes audio clips for most of the ringtones!

TRIGGER_POLICE_REPORT
The police scanner reporting a major incident, this lists all available audio that can be played.

ceedj
  • ceedj

    PEDS Creator

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

#19

Posted 31 August 2009 - 02:53 PM Edited by ceedj, 08 September 2009 - 04:10 PM.

GIVE_WEAPON_TO_CHAR

Param 4 is 0 (hidden) or 1 (showing). Wiki page updated.

Also, weapon models (and the cell phone) are automatically loaded with the native, unlike III era games where you must request the model first.

EDIT:
CODE
(1)TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME (script name (no extension))

Very handy. This:
CODE
TerminateAllScriptsWithThisName("spcellphone");
TerminateAllScriptsWithThisName("spcellphonecalling");
TerminateAllScriptsWithThisName("spcellphonedebug");
TerminateAllScriptsWithThisName("spcellphoneendcall");
TerminateAllScriptsWithThisName("spcellphonemain");
TerminateAllScriptsWithThisName("spcellphonenetwork");
TerminateAllScriptsWithThisName("spcellphonetutorial");

Turns off that damn cell phone. lol.gif
CODE
(2)DISABLE_CAR_GENERATORS (bool - on off, unknown)
(0)SET_ALL_CAR_GENERATORS_BACK_TO_ACTIVE (none)
(1)SET_PARKED_CAR_DENSITY_MULTIPLIER (float)
(1)SET_PED_DENSITY_MULTIPLIER (float)
(1)SET_CAR_DENSITY_MULTIPLIER (float)
(1)SET_RANDOM_CAR_DENSITY_MULTIPLIER (float)


EDIT AGAIN:

It appears that TASK_DRIVE_CAR_TO_COORD can only be done inside a Sequence Task. BOO! Create the task (Open Sequence Task), Put in the task to do, close it, then run it (Task Perform Sequence). Here's what I THINK the parameters are for Drive To Coords:
CODE

TaskCarDriveToCoord(0, AnCar, fX, fY, fZ, 15.0f, 1, 0, 2, 5.0f, -1);

p1 = Always zero? (int)
p2 = veh handle (pointer)
p3 - p5 = x,y,z coords (floats)
p6 = veh speed (float)
p7 = unk behav (int)
p8 = 0 OR model hash, typically of the veh used in p2 (int or hash)
p9 = unk behav (int)
p10 = stop range? though sometimes a -1 (float?)
p11 = unk behav, though a lot of times -1 (int)

ceedj
  • ceedj

    PEDS Creator

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

#20

Posted 16 September 2009 - 01:09 AM

GET_CHAR_DRAWABLE_VARIATION

GET_CHAR_TEXTURE_VARIATION

Ah. the two most ass-backwards natives I've seen yet in the game. Works like so:

CODE
int var = GET_CHAR_DRAWABLE_VARIATION(actor, variation(0-10))
int var = GET_CHAR_TEXTURE_VARIATION(actor, variation(0-10))


In the style of the old Barton way of doing things, the "variable" is first, with the actor and variation number set after. You can set it with

CODE
SET_CHAR_COMPONENT_VARIATION(actor, component, model variation, texture variation)


The components, found by aru, as as follows (from his C++ hook):

CODE
// This is a complete guess and needs to be properly tested and verified...
0 = PED_COMPONENT_HEAD, †// head
1 = PED_COMPONENT_UPPER, // uppr
2 = PED_COMPONENT_LOWER, // lowr
2 = PED_COMPONENT_SUSE, †// suse
4 = PED_COMPONENT_HAND, †// hand
5 = PED_COMPONENT_FEET, †// feet
6 = PED_COMPONENT_JACKET, // jack
7 = PED_COMPONENT_HAIR, †// hair
8 = PED_COMPONENT_SUS2, †// sus2
9 = PED_COMPONENT_TEEF, †// teef
10 = PED_COMPONENT_FACE, †// face


Now that my save/load routine is working, I may make a small version of the Studios mod to help us find what variations are what; for example, there's about 4 or 5 different variations of the M_Y_STREETPUNK_05 model/texture, which allows for different hairstyles, coats and other stuff.

dayaan
  • dayaan

    coder

  • Members
  • Joined: 13 Dec 2008
  • Slovenia

#21

Posted 16 September 2009 - 04:25 PM

I've successfully littered on GTAForums some more and posted wrongly biggrin.gif

My apologies, because this belongs here:
" ATTACH_CAR_TO_CAR "

My misplaced topic

Greetz!

ceedj
  • ceedj

    PEDS Creator

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

#22

Posted 17 September 2009 - 07:49 PM Edited by ceedj, 17 September 2009 - 11:09 PM.

QUOTE (ceedj @ Aug 31 2009, 10:53)
It appears that TASK_DRIVE_CAR_TO_COORD can only be done inside a Sequence Task. BOO! Create the task (Open Sequence Task), Put in the task to do, close it, then run it (Task Perform Sequence). Here's what I THINK the parameters are for Drive To Coords:
CODE

TaskCarDriveToCoord(0, AnCar, fX, fY, fZ, 15.0f, 1, 0, 2, 5.0f, -1);

p1 = Always zero? (int)
p2 = veh handle (pointer)
p3 - p5 = x,y,z coords (floats)
p6 = veh speed (float)
p7 = unk behav (int)
p8 = 0 OR model hash, typically of the veh used in p2 (int or hash)
p9 = unk behav (int)
p10 = stop range? though sometimes a -1 (float?)
p11 = unk behav, though a lot of times -1 (int)

Ok, I seem to have worked out a couple of the 'driving style' in param 7 for the above, which appears to hold true for param 7 in TASK_CAR_MISSION as well:

0 - Normal driving, stop for traffic lights
1 - Ignore traffic lights, drive around traffic
2 - Ignore streets, try to drive directly to point
3 - Ignore traffic lights, stay in lane

Just for kicks, here's TASK_CAR_MISSION:

CODE
"TASK_CAR_MISSION", ped, vehicle, targetEntity, missionType, speed, drivingStyle, unknown, unknown


So far, only mission types 5(wait), 12(follow) and 21(drive to player) are known. I believe you'd need to set MARK_CAR_AS_CONVOY_CAR to true for each car as well for the follow to work properly (as done in bell3.sco). I will try to test out some more in the near future, to help make it more complete.

spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#23

Posted 03 October 2009 - 06:14 PM

To detail the ped component, "suse" seems to be bags and vests and "sus2" seems to be the balaclava. What does "suse" means?

Hypertenzion
  • Hypertenzion

    Prankster

  • Members
  • Joined: 10 Oct 2009
  • Denmark

#24

Posted 16 October 2009 - 05:44 PM

Hey all!
I would be very happy if you guys could help me with something smile.gif
I am searching for hashes for the cars.
I have already found the existing hashes here: http://www.gtamoddin...f_models_hashes

But how do I get NEWLY ADDED cars' hash?
Let me just be clear: It is not replaced cars, but totally NEW cars that has a name like "audia8" and "audir8" (but the name of the car ingame, when you enter the car is like the existing cars)

How do I get these hashes from new cars?
I have no idea dontgetit.gif

spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#25

Posted 14 January 2010 - 11:04 AM Edited by spaceeinstein, 17 January 2010 - 01:30 AM.

Is "IS_CONTROL_PRESSED" documented anywhere? I have a way of testing most of the values by checking each key one at a time, which is tedious and keyboard-breaking but I don't know how to find a faster way.

This is different from the key-check opcode from previous games. One number doesn't check two keys anymore, it'll only check one. I don't know what the first parameter is. The second parameter checks which key with the assigned control is pressed. Most keys depends on the control configuration but some that don't are denoted with an asterisk. Here are what I found so far:
0 - General - Change Camera
1 - On Foot - Sprint
2 - On Foot - Jump
3 - On Foot - Enter/Exit Vehicle
4 - On Foot - Attack
7 - General - Look Behind
8 - On Foot - Next Weapon
9 - On Foot - Previous Weapon
*10 - mouse wheel up
*11 - mouse wheel down
23 - On Foot - Action
*38 - left mouse button
*39 - right ctrl
40 - In Vehicle - Accelerate
41 - In Vehicle - Brake
42 - In Vehicle - Headlight
43 - On Foot - Enter/Exit Vehicle
46 - In Vehicle - Hotwire 1
47 - In Vehicle - Hotwire 2
50 - In Vehicle - Look Behind
51 - In Vehicle - Cinematic Camera
52 - In Vehicle - Next Radio Station
53 - In Vehicle - Previous Radio Station
54 - In Vehicle - Horn
55 - Helicopter - Throttle Up
56 - Helicopter - Throttle Down
58 - Helicopter - Rotate Right
59 - Combat - Punch 1
60 - Combat - Punch 2
*61 - esc (supposedly melee with weapon based on pattern but it's not configurable)
62 - Combat - Kicked (while locked on)
63 - Combat - Block (while locked on)
*64 - down arrow
*65 - up arrow
*66 - left arrow
*67 - right arrow
*77 - both enter keys
*78 - backspace
*79 - space
*80 - f
*81 - e
*82 - q
*83 - mouse wheel down
*84 - mouse wheel up
*98 - space
*137 - left mouse button

I have made a complete list of AWARD_ACHIEVEMENT by comparing the list on Rockstar's site and the ones in the game. I don't want to test it right now but is it possible to cheat the achievements?

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#26

Posted 15 January 2010 - 07:12 PM

QUOTE (spaceeinstein @ Jan 14 2010, 11:04)
Is "IS_CONTROL_PRESSED" documented anywhere? I have a way of testing most of the values by checking each key one at a time, which is tedious and keyboard-breaking but I don't know how to find a faster way.

This is different from the key-check opcode from previous games. One number doesn't check two keys anymore, it'll only check one. I don't know what the first parameter is. The second parameter checks which key with the assigned control is pressed. Most keys depends on the control configuration but some that don't are denoted with an asterisk. Here are what I found so far:
0 - General - Change Camera
1 - On Foot - Sprint
2 - On Foot - Jump
3 - On Foot - Enter/Exit Vehicle
4 - On Foot - Attack
7 - General - Look Behind
8 - On Foot - Next Weapon
9 - On Foot - Previous Weapon
*10 - mouse wheel up
*11 - mouse wheel down
23 - On Foot - Action
*38 - left mouse button
*39 - right ctrl
40 - In Vehicle - Accelerate
41 - In Vehicle - Brake
42 - In Vehicle - Headlight
43 - On Foot - Enter/Exit Vehicle
46 - In Vehicle - Hotwire 1
47 - In Vehicle - Hotwire 2
50 - In Vehicle - Look Behind
51 - In Vehicle - Cinematic Camera
52 - In Vehicle - Next Radio Station
53 - In Vehicle - Previous Radio Station
54 - In Vehicle - Horn
55 - Helicopter - Throttle Up
56 - Helicopter - Throttle Down
58 - Helicopter - Rotate Right
59 - Combat - Punch 1
60 - Combat - Punch 2
*61 - esc (supposedly melee with weapon based on pattern but it's not configurable)
62 - Combat - Kicked (while locked on)
63 - Combat - Block (while locked on)
*64 - down arrow
*65 - up arrow
*66 - left arrow
*67 - right arrow
*77 - both enter keys
*78 - backspace
*79 - space
*80 - f
*81 - e
*82 - q
*83 - mouse wheel down
*84 - mouse wheel up

I have made a complete list of AWARD_ACHIEVEMENT by comparing the list on Rockstar's site and the ones in the game. I don't want to test it right now but is it possible to cheat the achievements?

Thx spaceeinstein, this will be very useful cookie.gif

In addition I found a method to use GET_MOUSE_INPUT to change player z angle
GET_MOUSE_INPUT returns a astronomical integer, subtract 4294967300 to get the ciro position
A snippet from my alice script:
CODE
local zangle = {}
GET_CHAR_HEADING(PLAYER_CHAR, zangle)
local Xxs = {} local Yps = {}  local znon = {} local znone = {}
GET_MOUSE_INPUT(Xxs, Yps, znon, znone)
if (Xxs.a >= 200) then
Xxs.a = Xxs.a - 4294967300
end
Xxs.a = Xxs.a / itof(5.0)
Xxs.a = Xxs.a * -1
zangle.b = zangle.b + Xxs.a
SET_CHAR_HEADING(PLAYER_CHAR, zangle.b)

It's possible to caculate the returned integer with floats

nomo
  • nomo

    Player Hater

  • Members
  • Joined: 02 Mar 2010

#27

Posted 04 March 2010 - 07:34 PM

QUOTE (ZAZ @ Jan 15 2010, 19:12)
In addition I found a method to use GET_MOUSE_INPUT to change player z angle
GET_MOUSE_INPUT returns a astronomical integer, subtract 4294967300 to get the ciro position
A snippet from my alice script:
CODE
local zangle = {}
GET_CHAR_HEADING(PLAYER_CHAR, zangle)
local Xxs = {} local Yps = {} †local znon = {} local znone = {}
GET_MOUSE_INPUT(Xxs, Yps, znon, znone)
if (Xxs.a >= 200) then
Xxs.a = Xxs.a - 4294967300
end
Xxs.a = Xxs.a / itof(5.0)
Xxs.a = Xxs.a * -1
zangle.b = zangle.b + Xxs.a
SET_CHAR_HEADING(PLAYER_CHAR, zangle.b)

It's possible to caculate the returned integer with floats

You were probably getting the Mouse coordinates with an unsigned variable, but mouse coordinates can be negative. Use int instead of u32.

Erem
  • Erem

  • Members
  • Joined: 17 Mar 2010

#28

Posted 18 March 2010 - 12:12 AM Edited by Erem, 18 March 2010 - 12:55 AM.

Whilst playing around with CHANGE_BLIP_COLOUR(blipHandle, colour), I wasn't able to find any information on what blip colours it could take, so I'll post what I've discovered so far.

As my colour vocabulary is limited pretty much to the colours of the balls on a snooker table, I won't attempt to name the colours but will just list their RGB values instead. (I'll update this post with a more helpful image of the colours just as soon as I remember the password to my Photobucket account.)

user posted image

0: 248, 252, 248
1: 200, 153, 151
2: 85, 122, 85
3: 147, 198, 200
4: 219, 222, 219
5: 209, 194, 118
6: 224, 109, 0
7: 125, 0, 204
8: 9, 172, 0
9: 175, 29, 0
10: 180, 98, 96
11: 140, 78, 20
12: 40, 149, 135
13: 146, 252, 248
14: 210, 204, 126
15: 3, 99, 70
16: 65, 55, 160
17: 184, 151, 227
18: 191, 109, 66
19: 167, 188, 24
20: 109, 101, 45
21: 133, 28, 100
22: 137, 133, 235
23: 248, 185, 68
24: 79, 0, 236
25: 151, 231, 100
26: 248, 252, 73
27: 59, 164, 229
28: 248, 0, 248
29: 197, 157, 111
30: 1, 74, 0
31 onwards not yet tested

Note that the one known colour listed on the wiki (4 = Teal) is incorrect. The value 4 actually gives a light grey blip. SET_BLIP_AS_FRIENDLY(blipHandle, 1) does however change the blip colour to teal so if you want a blip to be a different colour, SET_BLIP_AS_FRIENDLY should precede CHANGE_BLIP_COLOUR but not follow it, otherwise your colour choice will be overridden. Similarly, if you use SET_CHAR_AS_ENEMY(pedHandle, 1) and want the character's blip to be a colour other than red, call SET_CHAR_AS_ENEMY before CHANGE_BLIP_COLOUR.

Shaunr
  • Shaunr

    Cooljunk Productions

  • Members
  • Joined: 04 Apr 2008
  • None

#29

Posted 18 March 2010 - 06:26 AM

use cheats on phone in multiplayer? how?

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]

#30

Posted 18 March 2010 - 08:11 AM

QUOTE (Erem @ Mar 18 2010, 01:12)
Whilst playing around with CHANGE_BLIP_COLOUR(blipHandle, colour), I wasn't able to find any information on what blip colours it could take, so I'll post what I've discovered so far.

Does passing a random RGBA (in a single DWORD) value still work as it did in San Andreas?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users