#1 22-02-2011 01:05

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

OpcodeDB v2: New keywords.txt Proposal

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

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
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

"Where's the rest of the opcodes?" - Opcodes related to chars, vehicles, objects etc. aren't suitable to be keywords. Imagine this line:

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..

Last edited by Deji (22-02-2011 01:05)

Offline

#2 22-02-2011 07:20

Seemann
Registered: 07-08-2006
Posts: 2,155

Re: OpcodeDB v2: New keywords.txt Proposal

0247=request_model
0248=is_model_available
0248=has_model_loaded
0249=release_model

these opcodes are included in the Model class.

really, I dont think we need so much keywords. They were designed as a replacement for the top-most used commands, not for every single one. So I would shorten that list by removing the rarely used opcodes and moving some of them into the classes.db (for example, make new Math class - Math.abs, Math.SetBit, or Game class)...

Offline

#3 22-02-2011 13:26

Deji
From: UK
Registered: 09-11-2008
Posts: 189
Website

Re: OpcodeDB v2: New keywords.txt Proposal

That is the plan, I guess the amount could be toned down - but I felt since things like request_model would be used a lot (not everyone like's classes). But I'm still not certain about all aspects.

What's tough is trying to organise opcodes into classes. I still want to experiment with the classes.db file a bit more since I'm still not fully sure how they work.

Offline

Board footer

Powered by FluxBB