Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

How can I create a teleport mod for android gta sa?


Alex NB
 Share

Recommended Posts

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

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 by OrionSR
  • Like 1
Link to comment
Share on other sites

  • 1 month later...
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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.