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

Support for Cleo+ Opcodes #71

Closed
OrionSR opened this issue Sep 21, 2020 · 12 comments
Closed

Support for Cleo+ Opcodes #71

OrionSR opened this issue Sep 21, 2020 · 12 comments
Labels
contributions welcome The community is welcome to contribute to this feature scope:compiler type:nice-to-have minor enhancements
Milestone

Comments

@OrionSR
Copy link

OrionSR commented Sep 21, 2020

I came across this link while checking for updates of fastman92's script command definitions:
Cleo+ by JuniorDjjr
But it's blocked by an ad block blocker and I'm not curious enough to whitelist, so I pulled these out of the SA files instead.

'''
0E01=7,create_object_no_save %1o% at %2d% %3d% %4d% offset %5d% ground %6d% to %7d%
0E02=1,set_car_generator %1d% no_save
0E04=1,get_next_weather_to %1d%
0E05=1,set_next_weather_to %1d%
0E06=1,get_rain_intensity %1d%
0E07=1,set_rain_intensity %1d%
0E08=1,is_car_script_controlled %1d%
0E09=1,mark_car_as_needed %1d%
0E0A=1,is_char_script_controlled %1d%
0E0B=1,mark_char_as_needed %1d%
0E0C=1,is_object_script_controlled %1d%
0E0D=1,mark_object_as_needed %1d%
0E0E=2,get_current_resolution_to %1d% %2d%
0E0F=4,get_fixed_xy_aspect_ratio %1d% %2d% to %3d% %4d%
0E10=0,is_mouse_wheel_up
0E11=0,is_mouse_wheel_down
0E12=2,get_vehicle %1d% subclass_to %2d%
0E13=2,get_entity %1d% type_to %2d%
0E14=3,init_extended_char_vars %1d% id %2d% new_vars %3d%
0E15=4,set_extended_char_var %1d% id %2d% var %3d% value %4d%
0E16=4,get_extended_char_var %1d% id %2d% var %3d% to %4d%
0E17=3,init_extended_car_vars %1d% id %2d% new_vars %3d%
0E18=4,set_extended_car_var %1d% id %2d% var %3d% value %4d%
0E19=4,get_extended_car_var %1d% id %2d% var %3d% to %4d%
0E1A=3,init_extended_object_vars %1d% id %2d% new_vars %3d%
0E1B=4,set_extended_object_var %1d% id %2d% var %3d% value %4d%
0E1C=4,get_extended_object_var %1d% id %2d% var %3d% to %4d%
0E1D=0,is_on_mission
0E1F=4,ease %1d% mode %2d% way %3d% to %4d%
0E20=0,is_on_samp
0E21=1,get_audio_sfx_volume %1d%
0E22=1,get_audio_radio_volume %1d%
0E23=1,get_mouse_sensibility_to %1d%
0E24=4,fix_char %1d% ground %2d% brightness %3d% and_fade_in %4d%
0E25=0,is_on_cutscene
0E26=2,is_weapon %1d% fire_type %2d%
0E27=5,get_angle_from_two_coords %1d% %2d% and %3d% %4d% to %5d%
0EA0=3,set_actor_second_player %1d% enable_camera %2d% separate_cars %3d%
0EA1=1,disable_second_player_restore_camera %1d%
0EA2=1,fix_two_players_separated_cars %1d%
'''
'''
0E01: create_object_no_save %1o% at 2@ 3@ 4@ offset 5@ ground 6@ to 7@
0E02: set_car_generator 1@ no_save
0E04: get_next_weather_to 1@
0E05: set_next_weather_to 1@
0E06: get_rain_intensity 1@
0E07: set_rain_intensity 1@
0E08: is_car_script_controlled 1@
0E09: mark_car_as_needed 1@
0E0A: is_char_script_controlled 1@
0E0B: mark_char_as_needed 1@
0E0C: is_object_script_controlled 1@
0E0D: mark_object_as_needed 1@
0E0E: get_current_resolution_to 1@ 2@
0E0F: get_fixed_xy_aspect_ratio 1@ 2@ to 3@ 4@
0E10: is_mouse_wheel_up
0E11: is_mouse_wheel_down
0E12: get_vehicle 1@ subclass_to 2@
0E13: get_entity 1@ type_to 2@
0E14: init_extended_char_vars 1@ id 2@ new_vars 3@
0E15: set_extended_char_var 1@ id 2@ var 3@ value 4@
0E16: get_extended_char_var 1@ id 2@ var 3@ to 4@
0E17: init_extended_car_vars 1@ id 2@ new_vars 3@
0E18: set_extended_car_var 1@ id 2@ var 3@ value 4@
0E19: get_extended_car_var 1@ id 2@ var 3@ to 4@
0E1A: init_extended_object_vars 1@ id 2@ new_vars 3@
0E1B: set_extended_object_var 1@ id 2@ var 3@ value 4@
0E1C: get_extended_object_var 1@ id 2@ var 3@ to 4@
0E1D: is_on_mission
0E1F: ease 1@ mode 2@ way 3@ to 4@
0E20: is_on_samp
0E21: get_audio_sfx_volume 1@
0E22: get_audio_radio_volume 1@
0E23: get_mouse_sensibility_to 1@
0E24: fix_char 1@ ground 2@ brightness 3@ and_fade_in 4@
0E25: is_on_cutscene
0E26: is_weapon 1@ fire_type 2@
0E27: get_angle_from_two_coords 1@ 2@ and 3@ 4@ to 5@
0EA0: set_actor_second_player 1@ enable_camera 2@ separate_cars 3@
0EA1: disable_second_player_restore_camera 1@
0EA2: fix_two_players_separated_cars 1@
'''

@x87 x87 added contributions welcome The community is welcome to contribute to this feature scope:compiler type:nice-to-have minor enhancements labels Sep 21, 2020
@MatiDragon-YT
Copy link
Member

CLEO+ is an extension of NewOpcodes, so you should implement it too.

I adapted some opcodes from both .cleo to the classes.db file and others from the sa folder, to make things easier for new ones, with more than 1000 subcommands.
sa.zip

@OrionSR
Copy link
Author

OrionSR commented Sep 22, 2020

CLEO+ is an extension of NewOpcodes, so you should implement it too.

Is there access and documentation for the new opcodes that isn't locked behind an ad block blocker? If not, I'll cut the new opcodes out of the edit modes I'm working on.

@MatiDragon-YT
Copy link
Member

YES!!!! I have a package of tools as an installer that adds the files to the SB and to the root of your game without problem.
It also adds a documentation to the more minimalist SB, but it is in Spanish, although the opcodes section is in English. You can also do whatever you want with it. It is MIT licensed

link of pack
Installation steps:

  1. Extract the EXE from the ZIP
  2. Run the EXE
  3. Accept the terms and conditions. (MIT license)
  4. Enter the address of your SB3.
  5. Enter the address of your GTA: SA (optional. just add CLEO+ and NewOpcodes)

@OrionSR
Copy link
Author

OrionSR commented Sep 22, 2020

An EXE? Nah, I don't mod that way, but I'm sure the kids will appreciate the easy installation process. I think I'll wait for Seemann to make the first move on this. I just thought it would be good to bring up the issue since Sanny is currently in flux - best not to leave anything out. Is anyone working on translations?

About the new opcodes; Still no way to delete_car_generator_now, so I can't hotswap whole sets of cargens based on town number or something. Also I always wondered what would happen if I set cargens to specific IPL areas instead of the last and unused entry. Would the cargens be removed automatically when CJ left SF, for example? I'm also not sure when the IPL flags flip, or how to associate a specific flag with a general area.

I've been considering writing this as an SCM function but if someone is actively adding new opcodes...

ReadStruct and WriteStruct would be very useful opcodes. Basically the same as the current memory opcodes but add an offset from the base to the start of the structure (or just the element if that's all that's required), the size of the records, a record index, and offset to the specific element.

Cool thing about aDMA is that I can use the format in math and conditional statements directly. No need for reads and writes, but limited to always working with a full dword. There doesn't seem to be an easy opcode strategy to accomplish the same thing.

@MatiDragon-YT
Copy link
Member

MatiDragon-YT commented Oct 23, 2020

I just wanted to warn that Junior_Djjr updated CLEO +, going from 104 opcodes, to 291.
https://www.mixmods.com.br/2020/03/CLEOPlus.html
Note: only some opcodes from NewOpcodes were incorporated into its code, and requires an unofficial version of the cleo library.

@x87
Copy link
Collaborator

x87 commented Oct 23, 2020

I'm well aware of the recent update. We are working closely to make a new CLEO release.

@JuniorDjjr would you have any objections if I ship CLEO+ files with the next SB update?

@JuniorDjjr
Copy link

It would be great, my goal has always been to make this reach as many people as possible.

But it was released recently, it's almost a beta, and I didn't pay much attention to the Sanny Builder data (even though I reviewed it by eye). So it’s good to be aware. My focus was completely on LINK/2012's gta3script, so the enums etc are there.

@x87
Copy link
Collaborator

x87 commented Oct 23, 2020

@JuniorDjjr @MatiDragon-YT if you can contribute sanny builder files for cleo+ I'll be glad to include them. I can do that myself, but it would require extra time.

@x87
Copy link
Collaborator

x87 commented Oct 23, 2020

I'm planning to release a new version sometime mid-November, so if that can be ready by that time it will be great.

@MatiDragon-YT
Copy link
Member

Okay, now I was about to add its opcodes to my classes.db with the enums I leave for gta3script.
Then if you want @x87, you add them to the file that will come in SB, if not change its syntax. Or else in the next update, if the project is not abandoned, the CLEO+ information could be added along with the updates it has ;)

@JuniorDjjr
Copy link

@MatiDragon-YT So just do it yourself, I'm very busy and if I'm going to work on something I would focus on gtamods.com documentation.

@x87 x87 mentioned this issue Oct 25, 2020
46 tasks
@x87
Copy link
Collaborator

x87 commented Nov 11, 2020

Added in v3.6

@x87 x87 closed this as completed Nov 11, 2020
@x87 x87 added this to the v3.6.0 milestone Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome The community is welcome to contribute to this feature scope:compiler type:nice-to-have minor enhancements
Projects
None yet
Development

No branches or pull requests

4 participants