Coding

 Reply to this postStart new topic

GTAG Opcode Database

Deji
post Apr 14 2011, 11:22 PM
Post #101


Coding like a Rockstar!

Group Icon

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



Walk modes... they're odd..

CODE
0 Turn on the spot..?
1 Turn to and stay still?
2 Turn to and stay still?
3 Turn to and stay still? (faster?)
4 Walk
5 Turn to and stay still?
6 Run
7 Sprint
8 Turn to and stay still?


I'm trying to find differences between 05D3 and 05F5.

SANNY
if
    0736:   is_keyboard_key_just_pressed 0x32
then
    009A: 1@ = create_actor_pedtype 4 model #MALE01 at 1528.4556 -1662.6246 -100.0
    009A: 2@ = create_actor_pedtype 4 model #MALE01 at 1533.4556 -1662.6246 -100.0
    0173: set_actor 1@ Z_angle_to 180.0
    0173: set_actor 2@ Z_angle_to 180.0
    05D3: AS_actor 1@ goto_point 1528.4556 -1642.6246 13.3828 mode 23 time 7000 ms
    05F5: AS_actor 2@ goto_point 1533.4556 -1642.6246 13.3828 mode 23 time 7000 ms
end


In the IDB, it's only clear that different tasks are set to the actor.


Interestingly, the time value is converted thusly..
-1 > 50000
-2 > -1


Pre-Post Edit

Alright, did a lot of work and figured out that 05D3 refers to this task: TASK_COMPLEX_FOLLOW_NODE_ROUTE

While 05F5 is: TASK_COMPLEX_GO_TO_POINT_AND_STAND_STILL


... big difference.


--------------------
Go to the top of the page
 
+Quote Post
fastman92
post Apr 27 2011, 06:22 PM
Post #102


Trained Member

Posts: 77
Joined: 25-October 10



038F: load_texture "DOWN" as 1 // Load dictionary with 0390 first
It should be noted that number of texture is in range 1-128. One day i didn`t know why my CLEO script is crashing and finally found an error caused by loading texture to 0 number.
Go to the top of the page
 
+Quote Post
Adler
post May 5 2011, 04:46 AM
Post #103


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Hey I found this quote from the Opcodes thread in GTAF:

QUOTE (PLPynton @ Feb 28 2007, 05:05)
05A5: is_area_center @489(@228,10f) @499(@228,10f) scale 12.0 12.0 overlaping_area_center @573(@227,10f) @583(@227,10f) scale @613 @613
found by demarest concerns more like screen.

i found only conditional usage of 05B0, and it seems to be that last 5th pair of 2D coords is checked if it fits to unknown relation from first 4 pairs of parameters- also 2D coords. or i can say that is a pretty damn time consuming opcode and after all it can be pooltable-only related.

i can suggest:
CODE
05A4=5,get_angle_between_vectors_origin_to %1d% %2d% and_origin_to %3d% %4d% store_to %5d%

there is a special word in english for angles <180 degrees but i do not know it yet and it would be quite important to insert that word into this description. [ Bolded for emphasis ]


I would like clarification on this opcode's specific function since I'm planning on using this for a mod (otherwise I'll have to calculate the angle myself). Thanks. smile.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post May 21 2011, 10:06 AM
Post #104


Coding like a Rockstar!

Group Icon

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



CODE
0364:   actor 102@(42@,9i) spotted_actor $PLAYER_ACTOR

May be changed to
CODE
0364:   actor 102@(42@,9i) has_actor_in_line_of_sight $PLAYER_ACTOR


In this example, the opcode returns true if the player is in the other actors line of sight. He could even be behind the other actor and it would still return true. Only having another object between them seems to make this return false.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jun 3 2011, 02:27 AM
Post #105


Coding like a Rockstar!

Group Icon

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



SANNY
0560: create_random_actor_in_car 148@ handle_as 149@
0561: 51@(129@,5i) = create_passenger_in_car 46@(129@,5i) seat 0


These seem to choose the character model depending on what model the vehicle is. So not as random as you could be lead to believe.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jun 3 2011, 09:35 PM
Post #106


Coding like a Rockstar!

Group Icon

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



SANNY
074D: AS_actor -1 turns_to_and_look_at_actor 37@ timelimit -2


Maybe.. if the actor has no weapon. But when I tried to use it, Colt 45 in my actors hand, he violently shot a fellow officer. Yes, I'm actually working on Vigilante Justice.

SANNY
074D: AS_actor -1 shoot_at_actor 37@ timelimit -2


Seemed that he would shoot even while the victim was already dead (violent world, eh?). I did wonder why there was a need for a time limit on this opcode.


--------------------
Go to the top of the page
 
+Quote Post
jayd00
post Jun 5 2011, 12:55 AM
Post #107


Ameteur Member

Posts: 42
From: Guatemala
Joined: 22-December 09



please, can someone explain me what does this opcode:
SANNY
070B: set_actor 164@ onbone_attached_object_operation 0

thnks...


--------------------


Go to the top of the page
 
+Quote Post
Deji
post Jun 18 2011, 07:10 AM
Post #108


Coding like a Rockstar!

Group Icon

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



Just some opcode finds. Nothing special. Yawn.

095D

SANNY
095D:   unknown_actor_check $1874(6@,3i)
>>
SANNY
095D:   actor $1874(6@,3i) stuck_under_car


093B

SANNY
093B: unknown_actor $ACTOR_SMOKE flag 1
>>
SANNY
093B: set_actor $ACTOR_SMOKE upper_body_damage_anims_only 1


0961

SANNY
0961: unknown_actor 431@(252@,11i) flag 1
>>
SANNY
0961: set_actor 431@(252@,11i) keep_tasks_after_cleanup 1

This may proove a powerful opcode.

0982

SANNY
0982: unknown_actor 102@ flag 1
>>
SANNY
0982: set_actor 102@ stay_in_car_when_dead 1

Stops the ped from falling out of the car when killed. Most notably used in the mission Pier 69 where you drive some rich guy off the Pier and the poor guy drowns. Notice how he doesn't leave the car when he does? Wow. Amazing. Yeah...

099F

SANNY
099F: unknown_actor -1 flag 1
>>
SANNY
099F: AS_actor -1 ignore_weapon_range 1


09A7

SANNY
09A7: unknown_actor 11@ flag 1
>>
SANNY
09A7: set_actor 11@ drugged_up 1


09B5

SANNY
09B5: unknown_actor $ACTOR_RYDER flag 0
>>
SANNY
09B5: set_actor $ACTOR_RYDER signal_after_kill 0

To stop them from being cocky after their kills.

09B6

SANNY
09B6: unknown_actor 0@ flag 0
>>
SANNY
09B6: set_actor 0@ wanted_by_police 0


09F4

SANNY
09F4: unknown_actor $ACTOR_OG_LOC flag 1
>>
SANNY
09F4: set_actor $ACTOR_OG_LOC ignore_height_difference_following_nodes


0A27

SANNY
0A27: unknown_actor 44@ flag 1
>>
SANNY
0A27: set_actor 44@ death_pickups_persist 1

So you're designing a mission and the goal is to retrieve the parachute that an character is wearing. The character must die and the parachute is created when that happens. But oh no, the parachute dissapears after such a short time. Mission failed? Nah, Rockstar created this nifty little opcode to make them linger, for the mission "Stowaway".

087F

SANNY
087F: unknown_actor 39@ flag 1
>>
SANNY
087F: set_actor 39@ dont_leave_group 1

Don't be a busta, stick with the homies!

0856

SANNY
0856: unknown_actor 98@ driving_flag 0
WUT? >>
SANNY
0856: set_actor 98@ allowed_to_duck 0

Allows/forbids the actor from ducking/crouching.


Now... to be really finicky and exact about some opcodes... Don't worry, I'll make it dramatic so there's a little more than no reason to read it.

02E0

WRONG
SANNY
02E0:   actor $PLAYER_ACTOR aggressive

RIGHT
SANNY
02E0:   actor $PLAYER_ACTOR firing_weapon


09F6

WRONG
SANNY
09F6: set_actor $ACTOR_RYDER unjackable_through_driver_seat 0

RIGHT
SANNY
09F6: set_actor $ACTOR_RYDER get_out_of_upside_down_car 0

This is set on most of the characters who are doomed to be in the players car. When the car is upside down, without this flag, they would leave immediately. However since there is the ability to recover from such an event, this is used to make them stay put, until the car is on fire at least.

08C6

SANNY
08C6: set_actor 65@ stay_on_bike 1

Sets two flags. One to disallow the actor to leave the vehicle (the particular flag works on other vehicles too) and one to prevent the actor from falling off the bike.

00A0

SANNY
00A0: store_actor $PLAYER_ACTOR position_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3

It just should be mentioned SOMEWHERE that if the actor in question is in a vehicle, this opcode returns the vehicle coordinates instead. So don't bother wasting time checking if the actor is in a vehicle, then using a different opcode to get the vehicle coords...

00A3

See above about the whole vehicle thing and such...

00D9

To set the record straight: This should be used during a mission. This opcode adds a reference to any found car, etc. HOWEVER if this opcode is used when the actor isn't in a car, the handle of the last found vehicle will be returned. It sets any car the actor is in as the one and only "mission vehicle" and returns that whenever you call it, unless the actor is in a new vehicle the next time it is called.

087E

WRONG
SANNY
087E: set_actor 35@ weapon_droppable 0

RIGHT
SANNY
087E: set_actor 35@ dont_drop_weapons_when_dead 0


0446

OKAY
SANNY
0446: set_actor 2@ dismemberment_possible 0

BETTER
SANNY
0446: set_actor 2@ suffers_critical_hits 0


07CB

WRONG?
SANNY
07CB: set_actor $ACTOR_RYDER supporting_fire 0

RIGHT?
SANNY
07CB: set_actor $ACTOR_RYDER dont_listen_to_player_group_commands 0


039E

WRONG?
SANNY
039E: set_actor 65@ locked 1 while_in_car

RIGHT?
SANNY
039E: set_actor 65@ cant_be_dragged_out_of_car 1

Should basically mean that no peds will attempt to jack this character.

054A

VERY WRONG
SANNY
054A: set_actor $ACTOR_SWEET immune_to_car_headshots 0

VERY RIGHT
SANNY
054A: set_actor $ACTOR_SWEET can_be_shot_in_a_car 0


0526

VAGUE
SANNY
0526: set_actor 65@ stay_in_car 1

UHH.. NOT VAGUE?
SANNY
0526: set_actor 65@ stay_in_car_when_jacked 1



I've not actually tested most of these so believe what you want to. Course I'm always right on this website tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 5 2011, 10:17 AM
Post #109


Coding like a Rockstar!

Group Icon

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



SANNY
0169: set_fade_color_RGB 2 2 2
fade 0 500


Yeh wouldn't think this would be a risky 2 lines of code but it is.

If all params of the CCamera::SetFadeColor function are 2, a byte is set in the camera struct that specify's that the script wants to fade into a splash screen.

It causes no crashes or real freezes. The gameplay will be frozen (that weird blurry screen thing you get with most camera bugs), however pausing still works (when you unpause, a shadow of the menu remains).


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 8 2011, 04:56 PM
Post #110


Coding like a Rockstar!

Group Icon

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



New Opcode
SANNY
085B: unknown_actor -1 flag 1

>>
SANNY
085B: AS_actor -1 set_kinda_stay_in_same_place 1


--------------------
Go to the top of the page
 
+Quote Post
Adler
post Jul 8 2011, 05:34 PM
Post #111


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Kinda? tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 8 2011, 06:02 PM
Post #112


Coding like a Rockstar!

Group Icon

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



Original Rockstar name (one of the GTA IV natives).


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Jul 8 2011, 11:04 PM
Post #113


Coding like a Rockstar!

Group Icon

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



New Opcode
SANNY
09A6: unknown_radar_flag 1

>>
SANNY
09A6: enable_interior_radar_blips 1


Y'know.. they're usually disabled.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Aug 6 2011, 01:14 AM
Post #114


Coding like a Rockstar!

Group Icon

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



0ABD probably returns true if the car alarm is on, too... which was probably not even known by the creator tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Aug 12 2011, 02:44 PM
Post #115


Coding like a Rockstar!

Group Icon

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



New Opcode!

09D7
CODE
09D7: unknown_player $PLAYER_CHAR flag 1
>>
CODE
09D7: set_player $PLAYER_CHAR force_interior_lighting 1


Will be updated with GTAG v2.


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Sep 7 2011, 02:56 AM
Post #116


Coding like a Rockstar!

Group Icon

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



GTAG's been down for a while. In that time I'm sure to have found and corrected a lot of opcodes...

Opcode Finds


06F3
SANNY
06F3: set_players_can_target_eachother 0

Sets whether players can target lock each other during 2 player missions.

09D2
SANNY
09D2: set_cops_chase_criminals 0

This opcode can disable cops from randomly chasing criminals and such. It's a way to disable a bit of the mayhem that goes on in SA.

06FA
SANNY
06FA: allow_players_to_use_separate_vehicles 0

When set, each player can use a separate vehicle during 2 player missions.

0969
SANNY
0969:   car $CARMOD_CAR is_big

Returns true if the vehicle is 'big'... as set by the vehicle data flags.

0433
SANNY
0433: set_actor 50@ criminal_flag 1

Is this character a criminal? (This flag isn't set for CJ!!!)

09BC
SANNY
09BC: put_actor $PLAYER_ACTOR at $X_BUY_MARKER $Y_BUY_MARKER $Z_BUY_MARKER no_offset_and_dont_warp_gang

Warps the specified character to the specified position without adding the characters height to the Z coordinate and without warping the rest of the characters group.

08C7
SANNY
08C7: put_actor $PLAYER_ACTOR at 2469.7 -1657.0 12.3 dont_warp_gang

Warps the specified character to the specified position without warping the rest of the players group.

05A0
SANNY
05A0:   is_unused_camera_world_viewer_being_used

Probably used to be a debug camera mode. I qoute GXT entry 'OP1'... "You must be in debug camera mode to active the object placer".

0A15
SANNY
0A15:   is_car_affected_by_cheats 34@

Returns true if the car is affected by cheats (seemingly only the handling cheat).

0A21
SANNY
0A21: set_car 72@ not_affected_by_cheats 0

Sets whether the car is affected by cheats (seemingly only the handling cheat).

081D
SANNY
081D: set_car $10934 engine_operation 1

>>
SANNY
081D: set_car $10934 engine_broken 1

Sets whether the cars engine is broken. If it is broken, it cannot be turned on by characters who enter it. This also occurs when the car gets submerged in water, so the engine can be repaired after that using this opcode. 0918 was right, though... but I believe I may have found that one tongue.gif

08AD
SANNY
08AD: put_actor $PLAYER_ACTOR at -2240.854 129.3346 radius 1.5 // interior version

>>
SANNY
08AD: link_actor $PLAYER_ACTOR to_enex_marker_at -2240.854 129.3346 radius 1.5

Locates the entry/exit marker in the specified radius of the specified coordinates and links it to the character, also setting the appropriate interior ID for the character and setting the appropriate sky colour if the character is player controlled. If you ever tried to teleport the player into an interior without using this opcode and then found that upon exiting the interior, you teleport to a place different to where you expected, you'll understand why this opcode is necessary.

09B4
SANNY
09B4: set_object_property_at 345.5621 306.2212 radius 10.0 bitmask 16384 bought 0

>>
SANNY
09B4: set_object_property_at 345.5621 306.2212 radius 10.0 bitmask 16384 flag 0

This opcode is like 098E, except it finds the appropriate enex marker via it's position instead of it's name.

09B4
SANNY
09B4: set_object_property_at 345.5621 306.2212 radius 10.0 bitmask 16384 bought 0

>>
SANNY
09B4: set_object_property_at 345.5621 306.2212 radius 10.0 bitmask 16384 flag 0

This opcode is like 098E, except it finds the appropriate enex marker via it's position instead of it's name.

098E
SANNY
098E: unknown_set_interior 'FDPIZA' bitmask 512 flag 1 // Pizza Stack

>>
SANNY
098E: set_interior 'FDPIZA' bitmask 512 flag 1 // Pizza Stack

No reason for this to be an unknown. But the bitmask param needs documenting. I'll start...

0x1000 - Is Burglary House
0x4000 - Is Active

039C
SANNY
039C: set_car 379@(253@,16i) watertight 1

Makes the vehicle watertight, meaning characters inside will not be harmed if the vehicle is submerged in water. Has no affect if the player is the driver.

I'm glad to find this, cause I somehow knew it had to exist.

068C
SANNY
068C:   is_player_autoaiming $PLAYER_CHAR

Returns true if the player is auto-aiming on something.

0947
SANNY
0947: actor $PLAYER_ACTOR speak_from_audio_table 353 store_spoken_phrase_id_to $2563

Similar to 05C1, but returns which phrase was spoken and is not run as a task.

07BF
SANNY
07BF: set_marker 443@($7257,8i) tracking_blip 1

Sets the marker as a tracking blip. Don't ask me what that means tongue.gif

0859
SANNY
0859: AS_actor 0@ walk_alongisde_actor $PLAYER_ACTOR

Makes the character walk alongside the specified character. Yeah, this one's a task.

0940
SANNY
0940: set_group 260@ enters_leaders_vehicle 1

If set to 0, the group members will not enter a car when the leader does.

0634
SANNY
0634: AS_actor 67@ attack_using_weapon_actor 50@ flags 4 perform_actions_after_time 2000 chance_of_action 100

Confirmation needed on params... Here's what I've got on the flags...

Bit 1 - Unknown (char seems smarter while using this?)
Bit 2 - Allow Movement?
Bit 3 - Allow Crouching


Now the rest of this stuff is still partially unknown, but not as unknown as before...

0742
SANNY
0742: set_plane 35@(328@,10i) unknown_trajectory -0.8

Or not...

07B1
SANNY
07B1: unknown_get_dance_track_data -1 store_to 20@ 21@ 22@

GET_STREAM_BEAT_INFO?

0876
SANNY
0876: unknown_cube_cornera 2682.42 1420.237 28.0 cornerB -2630.365 1411.699 28.0 flag 3 flag 0

From looking around the EXE, it seems like it can to stop birds from flying in the specified area. But the other flags make me think it may do more than that.

0867
SANNY
0867:   unknown_in_burglary_interior 0

With the flag at 0, returns true when in buglary houses, it seems (it returns true when the result matches the parameter... yeah, it's stupid). Maybe it returns true when there is stealable stuff in the current interior?

084D
SANNY
084D: unknown_flag_house_occupants 0

Probably something to do with interiors, anyway.


That's it for now. According to the GTAG v2 Opcode Database, there are only 49 unknown opcodes left for SA. Cool, eh?


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Sep 7 2011, 03:14 AM
Post #117


Coding like a Rockstar!

Group Icon

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



One more, just found now...

0A31
SANNY
0A31: set_player $PLAYER_CHAR group_to_follow_never 1

When set, the specified players group doesn't follow the player, even if the player uses the "group follow" button.
(Native: SET_PLAYER_GROUP_TO_FOLLOW_NEVER)

G'night... or rather, morning, pretty much...


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Sep 9 2011, 11:37 AM
Post #118


Coding like a Rockstar!

Group Icon

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



08EC
SANNY
08EC: $TEMPVAR_CAR_TYPE = car $TEMPVAR_ACTOR_CAR type

>>
SANNY
08EC: $TEMPVAR_CAR_TYPE = car $TEMPVAR_ACTOR_CAR class


Native: GET_VEHICLE_CLASS

It refers to the "class" field in vehicles.ide. I documented the numbers it returns:
CODE
normal = 0
poorfamily = 1
richfamily = 2
executive = 3
worker = 4
big = 5
taxi = 6
moped = 7
motorbike = 8
leisureboat = 9
workerboat = 10
bicycle = 11
ignore = -1


And while we're here.. the vehicle type documentation...
CODE
mtruck = 1
quad = 2
heli = 3
plane = 4
boat = 5
train = 6
f_heli = 3 (floating heli?)
f_plane = 8 (floating plane?)
bike = 9
bmx = 10
trailer = 11


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Sep 9 2011, 11:53 AM
Post #119


Coding like a Rockstar!

Group Icon

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



09B2 is very wrong...

SANNY
09B2: get_random_available_car_type 1 model_to 150@ doorlock_to 151@

>>
SANNY
09B2: get_random_available_car_unk 1 model_to 150@ class_to 151@


Not certain what the first param is but I know it's a boolean that seems to tell the game to choose from specific classes of vehicles.

The purpose of the opcode is to return a vehicle model which is already loaded in the game (or maybe the boolean sets whether to only include loaded models). So it's good for getting vehicles which suit the current population cycle.


--------------------
Go to the top of the page
 
+Quote Post
MasterK
post Sep 12 2011, 01:30 PM
Post #120


The New Guy!

Posts: 2
Joined: 12-September 11



Sorry for disturbing right after registration, but the opcode database has some problem, so it won't load. Could you fix it please? smile.gif

Also, you are doing a great job here!
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

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