Coding

 Reply to this postStart new topic

OpcodeDB v2: New keywords.txt Proposal

Deji
post Feb 22 2011, 12:01 AM
Post #1


Coding like a Rockstar!

Group Icon

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



I've been working hard on GTAG's Opcode Database System, trying to make SCM scripting easier, faster and MUCH more accurate. I decided to list my proposal for the new keywords.txt file, specific to San Andreas (I'll fill in any needed opcodes for VC and III later). I've already worked on the new Opcode Definitions generator, which has fixed many bugs and has a much improved design as well as being more interactive.

I'll probably create a similar topic for classes.db file sometime. I just want to make sure people are happy with the proposal before I send it off to the database, as once it's implemented in people's scripts, changes would result in lack of ability to compile them. After I add the keywords, none will change. Some may be added (especially those which I have commented out in the list below) and alternates may come about, but compatibility with old scripts is a must.


I am also planning on other variants of these files. Such as ones which will use the original Rockstar natives, allowing us to code using such function names, which I think is benaficial - despite the restrictions of the current IDE ("compiler") choices. These variants will be optional, of course.

The options supplied for the Opcode Definitions Generator should allow a lot of customisation to SCM syntax. I will be creating new .ini definitions (".ini v2" - yeah, everything is version two now) with changed parameter orders to suit developments in SCM coding. However, these changes are completely optional. It would be a simple case of choosing between "Original .ini" (perhaps I'll name it "Classic .ini" - lol) or "v2 .ini" - which should suit the needs of everyone.

Some modders will indeed want to stick with the original SCM style and some will prefer an upgrade. Either way, I hope the Opcode Definitions Generator can be made handy for everyone.


One day, I may learn to program well enough to put the potential of the generator to use and create my own IDE ("compiler")... Alas, that probably won't be any time soon. Still, if anyone else was pondering the creation of a new IDE ("compiler"), the generator is more than capable of creating more files (.xml containing parameter info, etc. - perhaps?), which could help.


Anyway, here's the list. You could even try it out smile.gif

SANNY
0001=wait
0002=jump
0002=goto
0003=shake_camera
0003=shake_cam
004D=else_jump
004D=jf
004D=jump_if_false
004D=else_goto
004E=end_thread
004F=create_thread
0050=gosub
0051=return
0094=gabsf
0095=absint
0096=gabsf
0097=absf
0098=random_float
0099=random_int
00BE=clear_prints
00C0=set_time
00D7=create_thread_noparams
00D8=mission_cleanup
0111=set_wb_check_to
0112=wasted_or_busted
015A=restore_cam
015D=set_game_speed
0169=set_fade_rgb
016A=fade
016B=fading
016B=is_fading
0180=set_mission_flag
01B5=set_next_weather
01B6=set_weather
01B7=release_weather
01BD=get_game_time
01F0=set_max_wanted_level
//01F6
0208=random_float_in_ranges
0209=random_int_in_ranges
0247=load_model
0247=request_model
0248=is_model_available
0248=has_model_loaded
0249=release_model
0253=save_time
0254=restore_time
02A3=set_widescreen
02E7=start_cutscene
//02E4 maybe
02E8=get_cutscene_time
02E9=has_cutscene_finished
02EA=stop_cutscene
02EB=cam_restore_jumpcut
//02ED
//030C
//030D
0317=increment_mission_attempts
//0318=set_last_mission_passed_gxt
031A=remove_script_fires
//032A=set_cam_mode
0335=set_free_resprays
0373=set_cam_behind_player
038B=load_requested_models
0391=release_textures
0394=play_music
0396=freeze_timer
03A4=thread
03A4=name_thread
03AF=enable_streaming
//03B7=stream_cutscene
03C7=set_wanted_multiplier
03C8=set_cam_in_front_of_player
//03CB
//03D5
//03D6
03D8=show_save_screen
03D9=did_save_complete
03DE=set_ped_density_multiplier
03E5=show_text_box
03E6=clear_text_box
//03E7
//03EB
//03F0
040C=is_german_version
0417=start_mission
041D=set_cam_near_clip
041E=set_radio_station
0424=is_system_metric
042C=set_total_missions
0434=start_credits
0435=end_credits
0436=are_credits_finished
//043C
0445=is_handling_cheat_on
0459=end_thread_named
//045C=abort_mission
0485=return_true
//0488
//048A: set_RC_car_detonation 0 // or opcode 04D6
04BB=set_interior
04BB=select_interior
//04C1=
//04D6: enable_RC_car_detonation 0 // or opcode 048A
//04DB: exit_RC_mode // on foot version
//04E4
04ED=load_anims
04ED=request_anims
04EE=are_anims_available
04EE=have_anims_loaded
04EF=release_anims
04F9=set_sky_color
04FA=reset_sky_colors_with_fade
050F=get_max_wanted_level
0512=show_text_box_forever
051E=get_current_radio_station
//054C=set_gxt_table
//056A=
0572=set_all_taxis_have_nitro
057E=set_radar_as_interior
0581=show_radar
0595=set_oddjob_mission_passed
059A=return_false
//059D
//059E
//05B6
//05D6
//05D7
//0615=begin_task_sequence
//0616=end_task_sequence
//061B
//061E
//06B9:   cutscene_data_loaded
06C8=enable_riot
06D0=enable_emergency_services
06D7=enable_random_trains
06D9=delete_script_trains
06DA=reset_train_directions
06DB=delete_all_trains
//06E0=set_2player_cam_mode
//06F1=set_2player_distance_limit
//06F2=release_2player_distance
//06F3
//06FA=unknown_2player_flag
//0701
//0707
//0719
072C=enable_police_bikes
0732=suppress_car_model
0733=dont_suppress_car_model
0734=dont_suppress_any_car_models
0754=clear_patrol_route
075B=set_radar_zoom
//075D
//075E
//075F
//076F
//0776
//0777
//0778
//077E
//0790
//0792
0793=save_player_clothes
0794=restore_player_clothes
//079D
//079E
//079F
//07A1=set_walk_speed
//07A8
07D0=get_weekday
//07DE
//07F1
//07F2
//07F9
//07FA
//0800
//0822=enable_bumper_view
0826=show_hud
0828=set_max_fire_generations
//0844
//0845
//0846
//0847
//084D
//0867
//0871
//0872
0879=enable_gang_wars
087A=is_gang_war_active
//087C
088E=set_next_day
//08A3=allow_player_to_gain_respect_during_mission - loonng
08A8=enable_lod_markers
08A9=load_script
08A9=request_script
08AB=has_script_loaded
08AB=is_script_available
//08AC
08B1=enable_night_vision
08B2=enable_thermal_vision
{08B4:   test $390 bit 1
08B5:   test $GIRLS_GIFTS_BITMASK bit $GIRLFRIEND
08B6:   test $383($GIRLFRIEND,6i) bit 3@
08B7:   test 54@ bit 5
08B8:   test $1044 bit 20
08B9:   test 239@ bit 216@
08BA: set $377[0] bit 1
08BB: set $1210 bit $GIRLFRIEND
08BC: set $390 bit 3@
08BD: set 54@ bit 10
08BE: set $377[0] bit 1
08BF: set 54@ bit 49@
08C0: clear $391 bit 31
08C1: clear $1210 bit $GIRLFRIEND
08C2: clear $391 bit 3@
08C3: clear 54@ bit 11
08C4: clear $377[0] bit 31
08C5: clear 54@ bit 49@}

//08CA=reset_zones
//08D0:
//08D1=store_cutscene_pos
08DD=lose_weapons_when_wasted
08DE=lose_weapons_when_busted
08E1=get_tags_sprayed
08E2=get_percent_of_territories_owned
08E7=disable_entrance_markers
08EA=enable_gang_members
08F4=set_gang_size_limit
08F5=save_player_gang
08F5=restore_player_gang
08F5=hide_player_gang
08F5=show_player_gang
08F8=show_stat_update
08FD=enable_heat_haze
08FE=is_text_box_displayed
//090C: highlight_inactive_gang_zone "GLN1" as_available_for_gangwars
//090D: highlight_all_inactive_gang_zones_as_available_for_gangwars
090F=end_script
0910=release_script
0913=run_script
0915=sync_time_and_weather
0992=enable_air_traffic
0925=restore_cam_to_user_defined
//0926
092F=lock_cam_target
0930=lock_cam_pos
0931=lock_cam_zoom
0933=is_cam_moving
0934=is_cam_rotating
093D=set_cam_cinematic
//0942:   item_with_textureCRC $SELECTED_MENU_ITEM is_clothing
//0944: manipulate_weapon_camera $ACTOR_SMOKE
0951=disable_trip_skip
0952=load_soundtrack
0953=get_soundtrack_status
0954=play_soundtrack
0955=stop_soundtrack
//0956=get_respect
//096A=enable_police_helis
//096B: set_present_mod_apply
//096C: set_present_mod_remove
//0970: teleport_in_override_restart // 016Eh
0971=sync_water
//0974=emulate_wasted_busted
//0983: unknown_disable_gang_wars 1
0986=remove_references_to_all_fires
0989=set_text_box_width
//098A: set_gunshot_sense_range_for_riot2 15.0  // pretty pointless, really
098B=concat
//098C == 098B
0991=pause_soundtrack
//0994: unknown_create_escape_at 76.6 -1527.6 4.1 // add_convoy_point
//0995: unknown_remove_escapes  // clear_convoy_points
0997=set_total_respect
0998=award_respect
099D=is_night_vision_on
099E=enable_random_cops
//09A3=
//09A6
09AC=hide_map_icons
09AD=set_vehicle_camera_mode
09B9=show_entered_car_text
09BA=show_entered_area_text
//09BD
//09BE
//09BF=set_random_car_model
09C1=add_next_message_to_brief_history
//09C2: cancel_rampage
09C8=are_subtitles_on
//09D2: unknown_flag 0
09D4=suspend_wanted_level
09D9=detonate_satchel_charges
//09DD: unknown_player_group 1
//09E4
//09E6: set_burglary_houses_accessible 1
//09EC: set_garages_leave_camera_alone 0
//09EE=keep_status_text_on_screen
//09F0: restore_behind_camera_autoposition_mode_for_all_car_models
//09F5: disable_player_mutal_activities 1
//09F8: give_player2_weapons_of_player1
//09FA:   is_menu_closed    // pretty damn useless
09FB=get_language
//0A0B: set_rendering_origin_at_3D_coord 2493.362 -1734.295 12.3828 angle 258.7583
0A0E=clear_text_now_style
0A0F=is_new_language_set
//0A13: unknown_sync_player_camera
0A14=disable_respray_garages
0A19=display_area_name
//0A1E=take_snapshot
//0A24=enable_military_zones_wanted_level
//0A25=set_cam_angles_on_player
0A26=set_radio_station_as_favourite
0A2A=is_this_text_box_displayed
0A2B=is_widescreen_option_on
0A2C=hide_priority_text_during_fade
0A2D=hide_styled_text_during_fade
0A2F=display_sniper_scope_this_frame
0A2F=display_camera_viewfinder_this_frame
//0A36=is_trip_skip_ready_for_fadein
0A37=disable_vehicle_light_rendering
0A3D=enable_prostitutes_pay_player
0A43=get_rid_of_player_prostitute
//0A44: unknown_override_09BD 1
0A45=set_railtrack_friction_multiplier
//0A46: set_external_scripts_triggers_type 1 enabled 0
//0A47=set_dialgogue_mode_enabled_no_gxt
0A48=enable_menu_during_widescreen
0A4A=get_mouse_input
0A4A=get_joystick_input
0A4B=are_controls_set_to_joystick
0A4C=is_look_inverted
0A92=create_custom_thread
0A93=end_custom_thread
0A94=star_custom_mission
0A95=enable_thread_saving
0A99=chdir
0A9F=get_current_thread_pointer
0AA0=gosub_if_false
0AA0=else_gosub
0AA1=return_if_false
0AA1=else_return
0AA9=is_game_version_original
0AAB=does_file_exist
0AB0=is_key_pressed
0AB1=call
0AB2=ret
0AB6=get_target_marker_coords
0ABA=end_custom_thread_named
//0ADC=test_cheat
//0ADD: spawn_car_with_model #RHINO like_a_cheat
//0AE4=does_directory_exist
//0AE5=create_directory
//0AE9=pop_float

(btw, Sanny tags in the new GTAG are more or less perfected)

"Where's the rest of the opcodes?" - Opcodes related to chars, vehicles, objects etc. aren't suitable to be keywords. Imagine this line:
SANNY
perform_anim 0@ "M_SMKLEAN_LOOP" "LOWRIDER" 4.0 1 0 0 0 -1

These will be part of classes.db - just like most of the opcodes in this list won't be in classes.db..


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Feb 22 2011, 09:51 PM
Post #2


Member

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



Hope you'll make methods wich include extended params.
SANNY
actor.HasWeapon(0@, AK47)
key.PressedVirtual(VK_L)
shadow.Add(HEADLIGHT, 0.0, 1.0, 0xFF, 0xFF, 0, 0, 0@, 1@, 2@)

Would it real to create such keywords:
SANNY
0@ = cos 0@

I mean, when param is before a keyword?
Go to the top of the page
 
+Quote Post
Deji
post Feb 22 2011, 10:48 PM
Post #3


Coding like a Rockstar!

Group Icon

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



Nah, Sanny wants the keyword to be first, before the parameters. Classes will be implemented for that.
SANNY
0@ = Math.cos(175.0)

However, the sascm.ini still dictates how the classes syntax gets ordered...
SANNY
060A: create_decision_maker_type 0 store_to 207@ // decision\allowed\m_.ped files
208@ = Decision.Create(0)  // not possible without sascm.ini changes
Decision.Create(0, 209@)

I believe, anyway... So different versions will be implemented, one following a new INI version, one using the old order and of course, the Rockstar-style ones.

I need to get the list of classes from CLEO 4, since I never installed those files.


--------------------
Go to the top of the page
 
+Quote Post
Silent
post Feb 23 2011, 12:43 PM
Post #4


The master of cut retort

Group Icon

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



QUOTE (Deji @ Feb 22 2011, 11:48 PM) *
I need to get the list of classes from CLEO 4, since I never installed those files.


CODE
$File
$begin
;^Open,[0A9A,=,2,0,0],("FileName: ^NULL=0" "Mode: ^NULL=0")
Open,0A9A,0,0,("FileHandle%h" "FileName: ^NULL=0" "Mode: ^NULL=0")
Close,0A9B,0,0,("FileHandle%h")
^Size,[0A9C,=,2,1,0],("FileHandle%h")
Read,0A9D,0,0,("FileHandle%h" "Size%i" "Destination%i")
Write,0A9E,0,0,("FileHandle%h" "Size%i" "Source%i")
Seek,0AD5,0,0,("FileHandle%h" "Offset%i" "Origin: ^SEEK_SET^SEEK_CUR^SEEK_END")
EOF,0AD6,1,0,("FileHandle%h")
ReadString,0AD7,0,0,("FileHandle%h" "Destination: ^NULL=0" "BufSize%i")
WriteString,0AD8,0,0,("FileHandle%h" "Source: ^NULL=0")
$end


I can remember that there's also an "Audiostream" class, but my classes.db doesn't have it.
Go to the top of the page
 
+Quote Post
DK22
post Mar 2 2011, 05:02 PM
Post #5


Member

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



Ok. Think it will be cool.
SANNY
var
0@: math
end

1@ = 0@.cos

Also, can you post a list of classes you want to create, please?
Go to the top of the page
 
+Quote Post
BnB
post Mar 12 2011, 08:10 AM
Post #6


The New Guy!

Posts: 8
From: Greece
Joined: 4-August 10



What about this:

CODE
$Math
$begin
Sine,02F6,0,0("Variable%h" "Z-Angle%f")
Cosine,02F7,0,0("Variable%h" "Z-Angle%f")
$end


SANNY
Math.Cosine(2@, 45,1)
Math.Sine(3@, 45,12)


It s just an example.

Also...
CODE
$Key
$begin
TestCheat,0ADC,1,0("Cheat%v")
PressedVirtual,0AB0,1,0("VirtualKey:^LMB=1^RMB=2^CBP=3^MMB=4^Backspace=8^Tab=9^Enter=13^Shift=16^Ctrl=17^Pause=1
9^CapsLock=20^Esc=27^Space=32^PageUp=33^PageDown=34^End=35^Home=36^Left=37^Up=38
^
Right=39^Down=40^Insert=45^Delete=46^0=48^1=49^2=50^3=51^4=52^5=53^6=54^7^8^9^A^
B
^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^WinLeft^WinRight^App^Num0=96^Nu
m
1^Num2^Num3^Num4^Num5^Num6^Num7^Num8^Num9^*^+^-^.^/^F1^F2^F3^F4^F5^F6^F7^F8^F9^F10^F11^F12^NumLock=144^ScrollLock=145^;=186^=^,^-^.^/^`^[^\^]^'")
Pressed,00E1,1,0("Player%h" "Key%i")
$end


We get
SANNY
Key.PressedVirtual(MMB)


This post has been edited by BnB: Mar 12 2011, 11:35 AM
Go to the top of the page
 
+Quote Post
Deji
post Mar 12 2011, 03:24 PM
Post #7


Coding like a Rockstar!

Group Icon

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



Nice. Never actually considered constants for each class, but that will be very handy. Still a lot of work to actually do on the opcode database, though.


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

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