Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor problems and arrangement of SB tool files. #95

Closed
XMDS opened this issue Nov 17, 2020 · 8 comments
Closed

Some minor problems and arrangement of SB tool files. #95

XMDS opened this issue Nov 17, 2020 · 8 comments
Labels
discussion Further discussion is requested priority:p2 Medium priority scope:edit modes type:nice-to-have minor enhancements
Milestone

Comments

@XMDS
Copy link

XMDS commented Nov 17, 2020

@x87 I noticed some minor issues with the current version (3.6.0) of the SB tool file. I think it is necessary to rearrange the contents of these files. In fact, some things are still problems left over from the old version.

@XMDS
Copy link
Author

XMDS commented Nov 17, 2020

In my free time recently, I sorted out these questions. I should upload the organized files, but I plan to write them out here.

1.About CLEO4 pluginIntOperations.cleo
.In fact, we have not included some OPs. In the source code, we can see that these OPs are indeed registered and can be used:

SCM:
0B17=2,%1d% &= %2d%
0B18=2,%1d% |= %2d%
0B19=2,%1d% ^= %2d%
0B1A=1,~%1d%
0B1B=2,%1d% %= %2d%
0B1C=2,%1d% >>= %2d%
0B1D=2,%1d% <<= %2d%

OP:
0B17: 0@ &= 1@
0B18: 0@ |= 1@
0B19: 0@ ^= 1@
0B1A: ~0@
0B1B: 0@ %= 1@
0B1C: 0@ >>= 1@
0B1D: 0@ <<= 1@

extensions:
0B17=bitwise
0B18=bitwise
0B19=bitwise
0B1A=bitwise
0B1B=bitwise
0B1C=bitwise
0B1D=bitwise

keywords:
0B17=bitwise_and_thing_with_thing
0B18=bitwise_or_thing_with_thing
0B19=bitwise_xor_thing_with_thing
0B1A=bitwise_not
0B1B=mod_thing_by_thing
0B1C=bitwise_shr_thing_by_thing
0B1D=bitwise_shl_thing_by_thing

@XMDS
Copy link
Author

XMDS commented Nov 17, 2020

2.About newOpcodes.cleo plugin.
The final version of the plug-in is version 2.1. In fact, some OPs were disabled in the final release notes. These OPs currently use no function, we should delete these OPs:

0D62=2,set_car %1d% remap_texture %2d%
0D63=5,set_car %1d% color %2d% RGB %3d% %4d% %5d%
0D67=2,set_audiostream %1d% position_time %2d%
0D68=2,%2d% = get_audiostream %1d% position_time
0D69=4,%4d% = set_audiostream %1d% effect %2d% priority %3d%
0D6A=2,remove_audiostream %1d% effect %2d%
0D6B=2,set_audiostream_effect %1d% parameters_from_buf %2d%
0D6C=2,get_audiostream_effect %1d% parameters_to_buf %2d%
0D6D=1,reset_audiostream_effect %1d%
0D6E=3,set_audiostream %1d% attribute %2d% to %3d%
0D6F=3,%3d% = get_audiostream %1d% attribute %2d%
0D70=7,set_3d_audiostream %1d% _3d_attributes_mode %2d% min %3d% max %4d% iangle %5d% oangle %6d% outvol %7d%
0D71=7,get_3d_audiostream %1d% _3d_attributes_mode_to %2d% min_to %3d% max_to %4d% iangle_to %5d% oangle_to %6d% outvol_to %7d%


0D62: set_car 0@ remap_texture 1@
0D63: set_car 0@ color PRIMARY_COLOR RGB 255 255 255
0D67: set_audiostream 0@ position_time 30.0
0D68: 1@ = get_audiostream 0@ position_time
0D69: 1@ = set_audiostream 0@ effect AUDIOSTREAMEFFECT_ECHO priority 0
0D6A: remove_audiostream 0@ effect 1@
0D6B: set_audiostream_effect 0@ parameters_from_buf 1@
0D6C: get_audiostream_effect 0@ parameters_to_buf 1@
0D6D: reset_audiostream_effect 0@
0D6E: set_audiostream 0@ attribute AUDIOSTREAMATTR_PAN to -1.0
0D6F: 1@ = get_audiostream 0@ attribute AUDIOSTREAMATTR_PAN
0D70: set_3d_audiostream 0@ _3d_attributes_mode 3DAUDIOSTREAM3DMODE_NORMAL min -1.0 max -1.0 iangle -1 oangle -1 outvol -1.0
0D71: get_3d_audiostream 0@ _3d_attributes_mode_to 1@ min_to 2@ max_to 3@ iangle_to NULL oangle_to NULL outvol_to NULL

@XMDS
Copy link
Author

XMDS commented Nov 17, 2020

3.In SAMobile mode, {iOS opcodes}, the name is wrong. These OPs are not only available in IOS, but also in the Android version. They should be more clearly defined as {SAMobile opcodes}:

0242=2,arm_car_with_bomb %1d% %2d%
0a51=1,  is_widget_pressed %1d%
0a52=1,  is_widget_released %1d%
0a53=1,  is_widget_doubletapped %1d%
0a54=1,  is_widget_swiped %1d%
0A55=1,  is_widget_swiped_left %1d%
0A56=1,  is_widget_swiped_right %1d%
0a57=2,  do_mission_skip %1d% %2d%
0a58=1,  skip_to_mission_num %1d%
0a59=1,  skip_to_mission_page %1d%
0a5A=2,get_widget_value %1d% %2d%
0A5B=3,get_widget_value2 %1d% %2d% %3d%
0A5C=3,display_text_widget %1d% %2d% %3g%
0A5D=5,get_widget_position %1d% %2d% %3d% %4d% %5d%
0A5E=2,set_widget_value %1d% %2d%
0A5F=3,set_widget %1d% range %2d% %3d%
0a60=2,add_widget_flag %1d% %2d%
0a61=2,remove_widget_flag %1d% %2d%
0a62=2,add_button_flag %1d% %2d%
0a63=2,remove_button_flag %1d% %2d%
0a64=0,  is_touch_enabled
0a65=0,  skip_intro_cutscene
0a66=1,write_log %1k%
0a67=4,write_log_int %1d% %2d% %3d% %4k%
0a68=4,write_log_float %1d% %2d% %3d% %4k%
0a69=1,create_shop_widget %1g%
0a6a=2,add_shop_item %1g% %2d%
0a6b=1,delete_widget %1d%
0a6c=2,set_equipped_item %1d% %2d%
0a6d=2,print_help_forever_conditional %1g% %2d%
0a6e=2,set_widget_texture %1d% %2k%
0a6f=1,checkpoint_save %1d%
0a70=4,display_text_clamped %1d% %2d% %3d% %4d%
0a71=5,display_text_with_number_clamped %1d% %2d% %3g% %4d% %5d%
0a73=4,set_widget_value3 %1d% %2d% %3d% %4d%
0a74=1,  is_checkpoint_resuming %1d%
0a75=2,set_active_menu_item_car_mods %1d% %2d%
0a76=1,  hid_implements %1d%
0a77=1,checkpoint_save_oddjob %1d%
0a78=2,print_help_conditional %1g% %2d%
0a79=2,print_help_conditional_touch %1g% %2d%
0a7a=2,print_help_conditional_hid %1g% %2d%
0a7b=2,print_help_conditional_touch_classic %1g% %2d%
0a7c=2,print_help_conditional_touch_adapted %1g% %2d%
0a7d=2,print_help_conditional_hid_joypad %1g% %2d%
0a7e=2,print_help_conditional_hid_keyboard %1g% %2d%
0a7f=2,print_help_conditional_touch_analog %1g% %2d%
0a80=2,print_help_conditional_unknown %1g% %2d%
0a81=2,set_widget_info2 %1g% %2d%
0a82=2,set_widget_info2 %1g% %2d%
0a83=2,set_widget_info2 %1g% %2d%
0a84=2,set_widget_info2 %1g% %2d%
0a85=2,set_widget_info2 %1g% %2d%
0a86=2,set_widget_info2 %1g% %2d%
0a87=2,set_widget_info2 %1g% %2d%
0a88=2,set_widget_info2 %1g% %2d%
0a89=3,set_widget_value %1d% %2d% %3d%
0a8a=8,set_widget_info %1d% %2d% %3d% %4d% %5d% %6d% %7d% %8g%
0a8b=7,set_widget_info %1d% %2d% %3d% %4d% %5d% %6g% %7g%
0a8c=0,load_all_streaming_models
0a8d=1,  is_hid_released %1d%
0A8E=1,award_achievement %1d%
0A8F=0,
0A90=1,  %1d%

@XMDS
Copy link
Author

XMDS commented Nov 17, 2020

4.About {CLEO1.1 OP} of GTA3/GTAVC. We should not distinguish the version of these OPs as 1.1. In fact, up to now, VC/3 writers will still use these OPs. Moreover, there are still OP source codes in the CLEO2.0 source code, and they can also be used in 2.0. Considering that some people still use it, we should summarize these OPs as {CLEO} standard CLEO libraries instead of 1.1 independently.

05dc=0,terminate_this_custom_script
05dd=1,terminate_all_custom_scripts_with_this_name %1s%
05de=-1,stream_custom_script %1s%
05df=4,write_memory %1d% size %2d% value %3d% virtual_protect %4d%
05e0=4,%4d% = read_memory %1d% size %2d% virtual_protect %3d%
05e1=-1,call %1d% num_params %2h% pop %3h%
05e2=-1,call_function %1d% num_params %2h% pop %3h%
05e3=-1,call_method %1d% struct %2d% num_params %3h% pop %4h%
05e4=-1,call_function_method %1d% struct %2d% num_params %3h% pop %4h%
05e5=1,%1d% = game_version
05e6=2,%2d% = actor %1h% struct
05e7=2,%2d% = car %1h% struct
05e8=2,%2d% = object %1h% struct
05e9=2,%2h% = ped_struct %1d% handle
05ea=2,%2h% = vehicle_struct %1d% handle
05eb=2,%2h% = object_struct %1d% handle
05ec=1,%1d% = get_this_script_struct
05ed=2,%2d% = get_script_struct_named %1s%
05ee=1,  key_pressed %1d%  //VK_...
05ef=7,%7d% = random_actor_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% pass_deads %6h% //IF and SET
05f0=7,%7d% = random_vehicle_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% pass_wrecked %6h% //IF and SET
05f1=6,%6d% = random_object_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% //IF and SET
05f2=1,%1d% = pop_float
05f3=3,%3d% = %1d% exp %2d% //all floats
05f4=3,%3d% = log %1d% base %2d% //all floats
05f5=-1,call_scm_func %1p% params_count %2d%
05f6=-1,ret %1d%
05f7=2, %2d% = label %1p% offset
05f8=2, %2d% = var %1d% offset
05f9=3, %3d% = %1d% AND %2d%
05fa=3, %3d% = %1d% OR %2d%
05fb=3, %3d% = %1d% XOR %2d%
05fc=2, %2d% = NOT %1d%
05fd=3, %3d% = %1d% MOD %2d%
05fe=3, %3d% = %1d% SHR %2d%
05ff=3, %3d% = %1d% SHL %2d%

@XMDS
Copy link
Author

XMDS commented Nov 17, 2020

It is very late now, I will continue tomorrow, there are still some questions
@x87 if you think it is possible, I can upload the files I have modified, which can save time.

@x87
Copy link
Collaborator

x87 commented Nov 18, 2020

@XMDS

.About CLEO4 pluginIntOperations.cleo. In fact, we have not included some OPs.

Thanks for noticing this. Those should be included. I also think I can manage to support bitwise operations without opcodes in the compiler as I did for the integer arithmetic operations (0A8E-0A91).

2.About newOpcodes.cleo plugin. The final version of the plug-in is version 2.1. In fact, some OPs were disabled in the final release notes.

Interesting. Do you know why this is happened? Is there an alternative to the removed opcodes? Do they work in the older versions (2.0 for example)?

3.In SAMobile mode, {iOS opcodes}, the name is wrong. These OPs are not only available in IOS, but also in the Android version.

Ok, my bad. I was confused by a misleading comment in the SASCM.INI. If this is true, then there is no need for an extension and those could be part of default extension for SA Mobile mode.

4.About {CLEO1.1 OP} of GTA3/GTAVC. We should not distinguish the version of these OPs as 1.1.

In principle I agree, those opcodes are part of CLEO 2.0. But my goal here is to encourage people to use unified opcode numbers that are the same across all platforms. For example, 0A93: terminate_this_custom_script instead of 05dc: terminate_this_custom_script. Having duplicated opcodes is actually not good as it confuses newcomers.

@XMDS
Copy link
Author

XMDS commented Nov 19, 2020

Thanks for noticing this. Those should be included. I also think I can manage to support bitwise operations without opcodes in the compiler as I did for the integer arithmetic operations (0A8E-0A91).

Yes. The keyword syntax of OP of computational classes is very bad. We will be very comfortable to make it support shorthand syntax that does not require OP. But I noticed that sb does not support the "&" symbol when compiling.

Interesting. Do you know why this is happened? Is there an alternative to the removed opcodes? Do they work in the older versions (2.0 for example)?

I don't know why these OP features are disabled by dk22pac. But in fact, in newopodes version 2.0, these OPs have been prompted to be disabled. The source code is attached to the file of version 2.0. I checked the source code and these OPs have no function. Version 2.1 is also unavailable. Considering that this plugin will only use version 2.0 or 2.1 at present, we should delete these OPs

In principle I agree, those opcodes are part of CLEO 2.0. But my goal here is to encourage people to use unified opcode numbers that are the same across all platforms. For example, 0A93: terminate_this_custom_script instead of 05dc: terminate_this_custom_script. Having duplicated opcodes is actually not good as it confuses newcomers.

I know what you mean by doing this. But the writers of VC and GTA3 are very few. Even so, I don't know other areas. But in China, some VC players are still very active in this old game. They still write CLEO. Due to habit, even though they have used the 2.0 cleo library, they still use the 05XX OP. Secondly, some old very useful scripts are also written by the old OP, so I think we should summarize these OPs as the "default" CLEO standard library. (In fact, including myself, I still use the 1.1 OP. For example, the OP for obtaining the version number is very useful.)

In addition. I found the original gta3sc syntax in the source code of newopcodes. I think it can be added to the sb tool to add keywords for newopcodes.

@x87
Copy link
Collaborator

x87 commented Nov 19, 2020

But I noticed that sb does not support the "&" symbol when compiling.

This is probably due to & is used for the ADMA type and has to be followed by a number. I will look into it.

Considering that this plugin will only use version 2.0 or 2.1 at present, we should delete these OPs

Ok 👍

we should summarize these OPs as the "default" CLEO standard library.

Ok, I will change it. Thanks for the feedback.

@x87 x87 added the discussion Further discussion is requested label Nov 19, 2020
@x87 x87 mentioned this issue Nov 19, 2020
16 tasks
@x87 x87 added priority:p2 Medium priority scope:edit modes type:nice-to-have minor enhancements labels Nov 20, 2020
@x87 x87 added this to the v3.6.1 milestone Nov 23, 2020
@x87 x87 closed this as completed Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Further discussion is requested priority:p2 Medium priority scope:edit modes type:nice-to-have minor enhancements
Projects
None yet
Development

No branches or pull requests

2 participants