Alex NB Posted January 5, 2021 Share Posted January 5, 2021 I am new creating mods for the android gta sa. but there are some things that I still do not know, and I would like to know how I can create the teleport mod to the marker, and that it is compatible for gta sa 1.08 and 2.0 I hope you understand me, I used a translator and sometimes you get confused thanks. Link to comment Share on other sites More sharing options...
OrionSR Posted January 5, 2021 Share Posted January 5, 2021 (edited) This is a basic version of a Teleport to Marker script that I adapted for SA Android 1.08 from a PC script created by ZAZ. I expect it will need to be updated to work properly on v2. It could also use a few improvements. Spoiler {$CLEO .csa} // SASCM.ini 14.12.2013 //2marker.txt 03A4: name_thread '2MARKER' //Author: [email protected] //OSR/CG4Android: Adapted for CleoA by OrionSR //OSR/CG4Android: Any-version address codes by Markuza97 { go to the map and set the red marker hold the map widget for 2 seconds to teleport } { //----------------------------------------------------- [email protected], X coordinate [email protected], Y coordinate [email protected], Z coordinate [email protected], icon ID [email protected], angle [email protected], marker index calcs to read addresses [email protected], start of marker structure [email protected], marker index address //----------------------------------------------------- } // Markuza97's any-version address codes - read once 0DD0: [email protected] = get_label_addr @_ZN6CRadar13ms_RadarTraceE 0DD1: [email protected] = get_func_addr_by_cstr_name [email protected] // start of marker structure 0DD0: [email protected] = get_label_addr @gMobileMenu 0DD1: [email protected] = get_func_addr_by_cstr_name [email protected] // start of... menu data? 000A: [email protected] += 0x48 // offset to marker index :2marker_01 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @2marker_01 00D6: if 03EE: player $PLAYER_CHAR controllable 0001: wait 0 ms 00D6: if 0A51: is_widget_pressed 160 004D: jump_if_false @2marker_01 0001: wait 2000 ms 00D6: if 0A51: is_widget_pressed 160 004D: jump_if_false @2marker_01 0050: gosub @sub_read_marker_X_Y_ID // to [email protected] [email protected] [email protected] 00D6: if 8039: not [email protected] == 41 // prevent teleport if not marker id 004D: jump_if_false @2marker_08 0001: wait 1000 ms 0002: jump @2marker_01 //ZAZ's original codes start here //OSR/ updated to SASCM.ini 14.12.2013 :2marker_08 0172: [email protected] = actor $PLAYER_ACTOR Z_angle 0169: set_fade_color_RGB 0 0 0 016A: fade 0 time 500 0001: wait 500 ms 01B4: set_player $PLAYER_CHAR can_move 0 04BB: select_interior 0 04FA: reset_sky_colors_with_fade 0 057E: set_radar_grey 0 04E4: refresh_game_renderer_at [email protected] [email protected] 03CB: set_rendering_origin_at [email protected] [email protected] [email protected] 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @2marker_012 0050: gosub @sub_read_marker_X_Y_ID // to [email protected] [email protected] [email protected] 00D6: if 0039: [email protected] == 41 // prevent teleport if not marker id 004D: jump_if_false @2marker_012 0860: link_actor $PLAYER_ACTOR to_interior 0 00A1: put_actor $PLAYER_ACTOR at [email protected] [email protected] -100.0 0173: set_actor $PLAYER_ACTOR Z_angle_to [email protected] 0373: set_camera_directly_behind_player 02EB: restore_camera_with_jumpcut :2marker_012 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false jf @2marker_012 0001: wait 1500 ms 016A: fade 1 time 1000 :2marker_013 00D6: if 016B: fading 004D: jump_if_false @2marker_014 0001: wait 0 ms 0002: jump @2marker_013 :2marker_014 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @2marker_014 01B4: set_player $PLAYER_CHAR can_move 1 :2marker_015 //004E: end_thread 0002: jump @2marker_01 :sub_read_marker_X_Y_ID // Markuza97's any-version address codes 0DD8: [email protected] = read_mem_addr [email protected] size 2 add_ib 0 // read marker index 0012: [email protected] *= 0x28 // marker record size 000A: [email protected] += [email protected] // start of marker structure 000A: [email protected] += 0x8 // offset to X coord 0DD8: [email protected] = read_mem_addr [email protected] size 4 add_ib 0 // read X coord 000A: [email protected] += 0x4 // offset to Y coord 0DD8: [email protected] = read_mem_addr [email protected] size 4 add_ib 0 // read Y coord 000A: [email protected] += 0x18 // offset to icon ID 0DD8: [email protected] = read_mem_addr [email protected] size 1 add_ib 0 // read icon ID 0051: return // Markuza97's magic hex codes :gMobileMenu hex "gMobileMenu" 00 end :_ZN6CRadar13ms_RadarTraceE hex "_ZN6CRadar13ms_RadarTraceE" 00 end I'm pretty sure this will work for v1.08, but if I recall correctly, some widget IDs have changed in v2. I suspect that the correct widget ID for the v2 map widget in the upper left corner is 161, maybe 159 - I'm not sure. There is a cleo command that can identify the game version being played. This should make it easy to adjust the widget ID for each version. I had a lot of trouble with the fade feature during the teleport. It didn't transition as smoothly as on PC and I don't remember if I worked out the bugs. Ideas for other improvements: The script could be adapted to run from the cleo menu instead of requiring widget presses or screen swipes. The script could be reworked to teleport to marker whenever it is set and clear the marker when done, again avoiding widgets and screen swipes but you loose the use of the map marker in game. This feature could be a toggle. This script has a primitive format. It could benefit from the use of high level constructs and subroutines as well as the use of constants and perhaps some of the other new features available in updated versions of Sanny Builder. The script would benefit from additional features to support special vehicles. If CJ is in a boat it should spawn him on the surface of the water instead of the bottom of the sea. If CJ is flying a helicopter it should teleport him to a safe distance above the ground and start the engine to enable hovering. If CJ is flying a plane it should teleport him high above the ground with enough speed to continue flying. Edited January 5, 2021 by OrionSR RyanDri3957V 1 Link to comment Share on other sites More sharing options...
Alex NB Posted February 20, 2021 Author Share Posted February 20, 2021 On 5/1/2021 at 0:41, OrionSR said: Esta es una versión básica de un script de Teleport to Marker que adapté para SA Android 1.08 de un script de PC creado por ZAZ. Espero que sea necesario actualizarlo para que funcione correctamente en v2. También podría utilizar algunas mejoras. Revelar contenidos ocultos {$CLEO .csa} // SASCM.ini 14.12.2013 //2marker.txt 03A4: name_thread '2MARKER' //Author: [email protected] //OSR/CG4Android: Adapted for CleoA by OrionSR //OSR/CG4Android: Any-version address codes by Markuza97 { go to the map and set the red marker hold the map widget for 2 seconds to teleport } { //----------------------------------------------------- [email protected], X coordinate [email protected], Y coordinate [email protected], Z coordinate [email protected], icon ID [email protected], angle [email protected], marker index calcs to read addresses [email protected], start of marker structure [email protected], marker index address //----------------------------------------------------- } // Markuza97's any-version address codes - read once 0DD0: [email protected] = get_label_addr @_ZN6CRadar13ms_RadarTraceE 0DD1: [email protected] = get_func_addr_by_cstr_name [email protected] // start of marker structure 0DD0: [email protected] = get_label_addr @gMobileMenu 0DD1: [email protected] = get_func_addr_by_cstr_name [email protected] // start of... menu data? 000A: [email protected] += 0x48 // offset to marker index :2marker_01 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @2marker_01 00D6: if 03EE: player $PLAYER_CHAR controllable 0001: wait 0 ms 00D6: if 0A51: is_widget_pressed 160 004D: jump_if_false @2marker_01 0001: wait 2000 ms 00D6: if 0A51: is_widget_pressed 160 004D: jump_if_false @2marker_01 0050: gosub @sub_read_marker_X_Y_ID // to [email protected] [email protected] [email protected] 00D6: if 8039: not [email protected] == 41 // prevent teleport if not marker id 004D: jump_if_false @2marker_08 0001: wait 1000 ms 0002: jump @2marker_01 //ZAZ's original codes start here //OSR/ updated to SASCM.ini 14.12.2013 :2marker_08 0172: [email protected] = actor $PLAYER_ACTOR Z_angle 0169: set_fade_color_RGB 0 0 0 016A: fade 0 time 500 0001: wait 500 ms 01B4: set_player $PLAYER_CHAR can_move 0 04BB: select_interior 0 04FA: reset_sky_colors_with_fade 0 057E: set_radar_grey 0 04E4: refresh_game_renderer_at [email protected] [email protected] 03CB: set_rendering_origin_at [email protected] [email protected] [email protected] 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @2marker_012 0050: gosub @sub_read_marker_X_Y_ID // to [email protected] [email protected] [email protected] 00D6: if 0039: [email protected] == 41 // prevent teleport if not marker id 004D: jump_if_false @2marker_012 0860: link_actor $PLAYER_ACTOR to_interior 0 00A1: put_actor $PLAYER_ACTOR at [email protected] [email protected] -100.0 0173: set_actor $PLAYER_ACTOR Z_angle_to [email protected] 0373: set_camera_directly_behind_player 02EB: restore_camera_with_jumpcut :2marker_012 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false jf @2marker_012 0001: wait 1500 ms 016A: fade 1 time 1000 :2marker_013 00D6: if 016B: fading 004D: jump_if_false @2marker_014 0001: wait 0 ms 0002: jump @2marker_013 :2marker_014 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @2marker_014 01B4: set_player $PLAYER_CHAR can_move 1 :2marker_015 //004E: end_thread 0002: jump @2marker_01 :sub_read_marker_X_Y_ID // Markuza97's any-version address codes 0DD8: [email protected] = read_mem_addr [email protected] size 2 add_ib 0 // read marker index 0012: [email protected] *= 0x28 // marker record size 000A: [email protected] += [email protected] // start of marker structure 000A: [email protected] += 0x8 // offset to X coord 0DD8: [email protected] = read_mem_addr [email protected] size 4 add_ib 0 // read X coord 000A: [email protected] += 0x4 // offset to Y coord 0DD8: [email protected] = read_mem_addr [email protected] size 4 add_ib 0 // read Y coord 000A: [email protected] += 0x18 // offset to icon ID 0DD8: [email protected] = read_mem_addr [email protected] size 1 add_ib 0 // read icon ID 0051: return // Markuza97's magic hex codes :gMobileMenu hex "gMobileMenu" 00 end :_ZN6CRadar13ms_RadarTraceE hex "_ZN6CRadar13ms_RadarTraceE" 00 end Estoy bastante seguro de que esto funcionará para la v1.08, pero si mal no recuerdo, algunas ID de widgets han cambiado en la v2. Sospecho que el ID de widget correcto para el widget de mapa v2 en la esquina superior izquierda es 161, quizás 159; no estoy seguro. Hay un comando cleo que puede identificar la versión del juego que se está jugando. Esto debería facilitar el ajuste de la ID del widget para cada versión. Tuve muchos problemas con la función de atenuación durante el teletransporte. La transición no fue tan fluida como en la PC y no recuerdo si resolví los errores. Ideas para otras mejoras: El script podría adaptarse para ejecutarse desde el menú cleo en lugar de requerir que se presionen widgets o se deslice la pantalla. La secuencia de comandos podría modificarse para teletransportarse al marcador siempre que esté configurado y borrar el marcador cuando haya terminado, evitando nuevamente los widgets y deslizamientos de pantalla, pero perderá el uso del marcador del mapa en el juego. Esta característica podría ser una alternativa. Este script tiene un formato primitivo. Podría beneficiarse del uso de construcciones y subrutinas de alto nivel, así como del uso de constantes y quizás algunas de las otras características nuevas disponibles en las versiones actualizadas de Sanny Builder. El guión se beneficiaría de funciones adicionales para admitir vehículos especiales. Si CJ está en un barco, debería engendrarlo en la superficie del agua en lugar de en el fondo del mar. Si CJ está volando un helicóptero, debe teletransportarlo a una distancia segura sobre el suelo y arrancar el motor para permitir el vuelo estacionario. Si CJ está volando un avión, debería teletransportarse por encima del suelo con suficiente velocidad para seguir volando. I have been slow to adapt it to android, after many crashes I have achieved it, thank you very much friend OrionSR 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now