Coding

 Reply to this postStart new topic

GTAG Opcode Database

Deji
post Aug 17 2010, 07:53 PM
Post #21


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



OMG... Like... Opcode most people can't experience...

CODE
015B: unknown_shake_player_controller %1h% time %2d% unknown_intensity %3d%


smile.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Aug 17 2010, 11:46 PM
Post #22


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



For teh discoveries of this one, I created a small CLEO Script.

Use it with a stripped .scm (or any one where you spawn in grove). Watch the Cheetah as it slowly drives off, but stay within Grove Street.

When it gets to the end of the road (the crossroad bit), start pressing TAB.

SANNY
{$CLEO}
hex
00 00
end

wait 1000
0247: load_model #CHEETAH
while 8248:   not model #CHEETAH available
    wait 0
end
00A5: 0@ = create_car #CHEETAH at 2501.1951 -1661.1289 13.0496
009A: 1@ = create_actor_pedtype 4 model #MALE01 at 0.0 0.0 0.0
0175: set_car 0@ Z_angle_to 90.0
036A: put_actor 1@ in_car 0@
05D1: AS_actor 1@ drive_car 0@ to 2263.7698 -1659.3094 14.9 speed 5.0 1 model #NULL 2

while true
    wait 0
    if
        00E1:   player 0 pressed_key 4
    then
        if   0039: 2@ == 1
        then 0006: 2@ = 0
        else 0006: 2@ = 1
        end
        0594: unknown_car 0@ flag 2@
    end
    0AD0: show_formatted_text_lowpriority "%d" time 1 2@
end


In my experience.. Every time you press TAB (no matter whether you're setting the opcode to 1 or 0) the whole model appears to reload. Not too sure why... but at least were getting something!

The IDB indicates it has something to do with rendering the distant model clump.. but I know little about modelling... So I'm not sure what that is about. Holding TAB will make the car look invisible when viewing from far away smile.gif


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Aug 19 2010, 03:55 PM
Post #23


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



In the gta3's SCM.ini (yours variant) I saw opcodes that work with textures, like
CODE
038F: load_texture "texture" as 1

But do they work in gta III???
Go to the top of the page
 
+Quote Post
Deji
post Aug 19 2010, 04:01 PM
Post #24


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Yes, most texture opcodes work in GTA III (all the ones in opcode range, I think).


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Aug 19 2010, 04:05 PM
Post #25


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



But why you miss this in your SCM.ini
CODE
0390: load_txd_dictionary 'LOADSC0'

?
Or there is another way in III?
Also, what path of the txds it use? GTA_3/txd?
Go to the top of the page
 
+Quote Post
Deji
post Aug 19 2010, 04:17 PM
Post #26


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



There is still a lot of adding to be done for some opcodes.

I don't do a lot of modding for III/VC, so I don't encounter missing opcodes much. A lot of opcodes were missing from the original scm.ini, so I've gotta try adding them one by one.

It's uncertain for me which ones work in III and which don't. If you post an opcode/ini line that you think needs to be added I'll try and get to it ASAP wink.gif


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Aug 19 2010, 06:02 PM
Post #27


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



It works! Thank you Deji, really big thanks!
It works same as SA, just a path is GTA_3/models/
All that I did - added 0390 opcode to .ini
So, please add this opcode
CODE
0390=1,load_txd_dictionary %1h%

And change 038F to this
CODE
038F=2,load_texture %2h% as %1d%


Simple example
SANNY
0390: load_txd_dictionary 'MYTXD'
038F: load_texture 'MYLOGO' as 1
while true
    wait 0
    03F0: enable_text_draw 1
    038D: draw_texture 1 position 320.0 224.0 size 512.0 512.0 RGBA 255 255 255 100
end

mytxd.txd must be in models folder, and mylogo is an image in mytxd.txd=)
Go to the top of the page
 
+Quote Post
Deji
post Aug 19 2010, 06:18 PM
Post #28


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Added, Fixed, Thanks smile.gif


--------------------
Go to the top of the page
 
+Quote Post
Silent
post Aug 20 2010, 07:16 PM
Post #29


The master of cut retort

Group Icon

Posts: 239
From: Warsaw, PL
Joined: 21-July 10



[fanfare]
Another 'versionA' 'versionB' opcodes discovered!!!!!11111111111!!!1!!!111!oneoneone

SANNY
020B: explode_car 57@ // versionA
070C: explode_car 41@ // versionB


->

SANNY
020B: explode_car 57@
070C: explode_car_without_radius_damage 41@


I doubt that we need any description - 070C explosion is 'safe' to everything that is near exploding car.



SANNY
0730: car 280@ damage_component 1 // versionA
073C: car 280@ damage_component 0 // versionB


->

SANNY
0730: car 280@ damage_componentA 1
073C: car 280@ damage_componentB 0


This post has been edited by Silent: Aug 20 2010, 07:35 PM
Go to the top of the page
 
+Quote Post
Deji
post Aug 21 2010, 08:34 PM
Post #30


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



This one is tough to call, but I'm pretty sure it's along the right lines...

SANNY
078F: unknown_actor_task -1 flag 1

>>>
SANNY
078F: AS_actor -1 climb 1


This is pretty much the same as:
SANNY
05BC: AS_actor $PLAYER_ACTOR jump 1


Except 078F is used for climbing... so may have different usage in the main.scm.


--------------------
Go to the top of the page
 
+Quote Post
Silent
post Sep 18 2010, 12:04 PM
Post #31


The master of cut retort

Group Icon

Posts: 239
From: Warsaw, PL
Joined: 21-July 10



Found on Sannybuilder forums:

SANNY
03AB: unknown_car 0@ flag 1


->

SANNY
03AB: set_car 0@ stability_on_turning_movements 1


Found by Alien.

SANNY
07AB:   trailer 334@ attached_to_cab 327@


->

SANNY
07AB:   cab 334@ has_attached_trailer 327@


Found by Den_spb.
Go to the top of the page
 
+Quote Post
Deji
post Sep 18 2010, 02:56 PM
Post #32


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



03AB == SET_CAR_TRACTION

Maybe? It sounds like the definition of traction...


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Sep 27 2010, 05:50 PM
Post #33


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Database News

GTAG v2 Opcode Database is fully complete.. although I will be working on more features later on when I get all these Natives documented wink.gif

classes.db generation, maybe?


Opcode Finds

SANNY
03C0: $2197 = actor $PLAYER_ACTOR car


Nothing to say, really. This is as it seems.

SANNY
0811: $TEMPVAR_ACTOR_CAR = actor $PLAYER_ACTOR car // versionC


But this one could refer to the GTA IV Native:

STORE_CAR_CHAR_IS_IN_NO_SAVE


Seems appropriate to the var name $TEMPVAR_ACTOR_CAR - The handle is only temporary. So you could apply stuff to the vehicle, but will dissapear as normal if it goes out of range.

This goes by what I've stated before about cars not necessarily having references they hadn't been created by the script. What's more..


SANNY
01C3: remove_references_to_car $IMPORT_CAR // Like turning a car into any random car


Refers to Native:

MARK_CAR_AS_NO_LONGER_NEEDED


So essentially, you are just allowing the car to be destroyed when it is out of range (like a normal car). I think this is an important definition of the two.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Sep 27 2010, 05:51 PM
Post #34


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



098A

Seems to have something to do with gunshots? Its value is reset by mission cleanup to -1.0 and is only used in the "Los Desperados" mission where you help Cesar reclaim his turf.

From what I can gather in IDA it seems somewhat related to 06BD. I'm not sure how close the connection is, though.


Edit

Woohoo! I searched "GUNSHOT" and guess what..

"SET_GUNSHOT_SENSE_RANGE_FOR_RIOT2"

It even says "RIOT2" tongue.gif This opcode has very specific usage, I guess.

Wooohooooo! Opcode! Yummy!


I believe this takes unknown opcode count from 129 to 128.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Sep 28 2010, 03:23 PM
Post #35


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



SANNY
0904: get_interface 6 color_RGBA_to $COLOR_RED $COLOR_GREEN $GAMBLES_CASHWIN $3400


I'd be willing to assume that this opcode gets the RGBA from the same ID's as I've posted in the "HUD Colours" (or w/e) topic.

Edit: Yes, it does smile.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Sep 30 2010, 03:14 PM
Post #36


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Well.. this one I only had to test once!

SANNY
{$CLEO}

repeat wait 0
until 0ADC:   test_cheat "PHYSICS"

0247: load_model 3065
while 8248:   not model 3065 available
    wait 0
end
0107: 5@ = create_object 3065 at -2314.6792 101.242 35.3984
//0392: make_object 5@ moveable 1
if
    095B:  unknown_object_check 5@
then
    0ACA: show_text_box "True!!!"
else
    0ACA: show_text_box "False :("
end


Try this script once, then uncomment 0392 and try again.


This thing returns true whenever the object has been made moveable. Note, however, that as long as 0392 was used.. it will return true. It doesn't depend on a line existing in object.dat


I figured an opcode like this would exist after seeing the GTA IV Function "DOES_OBJECT_HAVE_PHYSICS". Found the only unknown conditional object thing and it worked.

Dontcha love it when these things come easily? :')


SANNY
095B:  is_object_moveable 5@


One more, Jack.. we're getting closer to the high score.

(Don't ask me about the origin of that random quote.)


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Oct 2 2010, 03:45 PM
Post #37


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Updated 0811 in the database.

SANNY
0811: $TEMPVAR_ACTOR_CAR = actor $PLAYER_ACTOR car_nosave


Anyone unsure of this meaning should refer to the opcode page for a simple explanation of what this means smile.gif


There are many opcodes that claim to be just a "different version". The differences in the actions these opcodes perform need to be defined:

SANNY
00BA: show_text_styled GXT 'BEEFY' time 1000 style 2  // versionA
0217: show_text_styled GXT 'MYTEXT' time 3000 style 1  // versionB

// These ones probably differ in what kind of model checks they perform. Some kinds of models could be excluded (maybe one is specifically for cars or actors?)
0488:   model #TAXI exists  // versionA
07DE:   model 43@ exists  // versionB

// One of these could mean "TASK_GO_TO_COORD_ANY_MEANS", for example.
05D3: AS_actor $PLAYER_ACTOR goto_point 681.8004 -474.1063 15.5363 mode 4 time 3000 // versionA
05F5: AS_actor 43@ goto_point 2516.686 -1675.861 13.1227 mode 4 time 5500 // versionB
0603: AS_actor 65@(48@,3i) goto 2493.82 -1669.91 12.8 mode 7 time -1 // versionC

etc...

Hopefully we can find the differences, because a lot of bugs and problems encountered while making bugs are caused by lack of understanding the differences between related opcodes.


SANNY
0605: actor -1 perform_animation "M_SMKLEAN_LOOP" IFP "LOWRIDER" rate 4.0 loop 1 lockX 0 lockY 0 lockF 0 time -1 // versionA

It can be assumed that "rate" means the speed of the animation. This is wrong, however it does mean something similar.

From what I've seen, it changes the rate of the transition from the actors current position into the animation.

So this means it controls how fast his bones start applying to the animation. It's a little hard for me to explain, but 4.0 seems to be an optimal value. Higher means he will start the animation faster. Slower means that part of the time the anim is playing, he will be moving his limbs into the position of the animation.

So if you we're applying a smoking anim, he would raise his arm up to the initial position before taking a drag tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Oct 11 2010, 02:34 AM
Post #38


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Noteworthy (?)

Global Vars Limit == 50,000


Hehe most think it's much lower tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Oct 11 2010, 04:04 AM
Post #39


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



0915 is equal to GTAIV native SET_SYNC_WEATHER_AND_GAME_TIME.

It also synchronizes the weather accordingly to the current town. More information on the weather process can be found here (the information that reminded me to update this opcode) and of course, the opcode database has been updated here.

Oh yeah.. and it unlocks the weather if it was locked by set_weather wink.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Oct 11 2010, 10:16 PM
Post #40


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



SANNY
076B: get_zone 17@s dealer_density_to 16@
076A: set_zone 'CHC1A' dealer_density_to 4


Wanna specify that these aren't what the opcode lines make them seem.

The gang "density" sets how many dealers are in the current zone. The external thread 'DEALER' decreases this value every time you kill a dealer.

However, it in no way effects the amount of dealers that spawn. It's more like a statistic. It only takes effect if the density is 0 (which stops dealers from spawning).



The actual amount of dealers that spawn is controlled the same way all the other peds are spawned.


--------------------
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

4 User(s) are reading this topic (4 Guests and 0 Anonymous Users)
0 Members: