Jump to content

How can I define an @actor inside the radius / sphere?


Recommended Posts

I'm new, and I don't know much about coding, but I'm starting a mod inspired by this:

 

https://gtaforums.com/topic/917353-sa-homies-extended-control/

 

 

 

I am looking to make a guard / helper mod. My problem is that I want it to attack peds in a radius / sphere of 50, but I can't find how to identify each ped within this range. Can anybody help me?

Edited by Yazor_Qunt
// Let say you have 0@ as the guard actor, the code would look like this:

:Get_Actor
wait 0
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0
0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 50.0 find_next 1 pass_deads 1
if
056D:   actor 4@ defined
jf @Get_Actor
05E2: AS_actor 0@ kill_actor 4@

// Loop somewhere else

 

Hace 19 horas, In45do dijo:

// Let say you have 0@ as the guard actor, the code would look like this:

:Get_Actor
wait 0
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0
0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 50.0 find_next 1 pass_deads 1
if
056D:   actor 4@ defined
jf @Get_Actor
05E2: AS_actor 0@ kill_actor 4@

// Loop somewhere else

 

Thanks for your prompt reply, but I have doubts about what "1@ 2@ 3@ 4@"  represents in:

04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0
0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 50.0 find_next 1 pass_deads 1

Thank you for your patience.

Edited by Yazor_Qunt
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0

04C4 is an opcode which stores coordinates from an actor within their offsets

1@ = X position from an actor (left, right)

2@ = Y position from an actor (front, back)

3@ = Z position from an actor (up, down)

0@ = the actor

 

0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 50.0 find_next 1 pass_deads 1

0AE1 is an opcode which stores a random actor within area, with custom radius, skip certain actor, and skip dead actor

4@ = the random actor

1@ = X position from a point

2@ = Y position from a point

3@ = Z position from a point

 

You can learn more of these stuff from here

On 8/16/2020 at 3:40 AM, In45do said:

04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0

04C4 es un código de operación que almacena coordenadas de un actor dentro de sus desplazamientos

1o X posición desde un actor (izquierda, derecha)

2o Posición Y desde un actor (delantero, trasero)

Posición Z de 3o desde un actor (arriba, abajo)

0o el actor

 


0AE1: 4@ = random_actor_near_point 1@ 2@ 3@ in_radius 50.0 find_next 1 pass_deads 1

0AE1 es un código de operación que almacena un actor aleatorio dentro del área, con radio personalizado, omitir cierto actor y saltar el actor muerto

4o el actor al azar

1o X posición desde un punto

2o Posición Y desde un punto

Posición Z de 3o desde un punto

 

Puedes aprender más de estas cosas desde aquí

Very good tutorial, I have been doing some research. I have used this OpCode but can't think of how it could handle deactivation. Any recommendation?
Thanks again

  • 2 weeks later...
2 hours ago, Kucing.Bertelur said:

Hi zaz, you can help about XOR For GTA SA Android??

You can write ARM assembly code in CLEO to realize the function of XOR operation.  Then call this function with 0DD2.  Or complete the XOR operation directly in the assembly code.  If you only consider the simplicity of the code, you can implement the XOR operation through ordinary calculation OP.  But I will not provide any sample code to help you.  Because before I published the source code for reading and writing Android CLEO configuration ini files, those authors chose to encrypt CLEO.  This is not conducive to learning CLEO, so I will not provide any Android cleo code.  Unless it's a good friend.

Kucing.Bertelur
12 hours ago, China·XMDS said:

You can write ARM assembly code in CLEO to realize the function of XOR operation.  Then call this function with 0DD2.  Or complete the XOR operation directly in the assembly code.  If you only consider the simplicity of the code, you can implement the XOR operation through ordinary calculation OP.  But I will not provide any sample code to help you.  Because before I published the source code for reading and writing Android CLEO configuration ini files, those authors chose to encrypt CLEO.  This is not conducive to learning CLEO, so I will not provide any Android cleo code.  Unless it's a good friend.

Does the Code Set Bit and Test Bit as an Alternative XOR? Please help friends, I am from Indonesia and not stealer. You can see MOD MADE ITU IN YOUTUTY CHANNEL: Muhammad Zauqie and GTainside: MZFS99, MZAUQIEFS. My elephant friend lay eggs.

2 minutes ago, Kucing.Bertelur said:

Does the Code Set Bit and Test Bit as an Alternative XOR? Please help friends, I am from Indonesia and not stealer. You can see MOD MADE ITU IN YOUTUTY CHANNEL: Muhammad Zauqie and GTainside: MZFS99, MZAUQIEFS. My elephant friend lay eggs.

 You should create a new theme.  Instead of continuing under the subject.  Perhaps the question about Android CLEO can have a general theme.  Then we should continue on that topic.

 

@OrionSR 

https://gtaforums.com/topic/926144-gta-sa-android-scm-write-memory-address-value/

Here is a very good topic on Android cleo.  You should create a similar theme.

Kucing.Bertelur
7 hours ago, XMDS said:

 You should create a new theme.  Instead of continuing under the subject.  Perhaps the question about Android CLEO can have a general theme.  Then we should continue on that topic.

 

@OrionSR 

https://gtaforums.com/topic/926144-gta-sa-android-scm-write-memory-address-value/

Here is a very good topic on Android cleo.  You should create a similar theme.

Okey bro, btw you can create cvector used memory in android ? I'am try create cvector used metode you but not working bro -_-

22 hours ago, Kucing.Bertelur said:

Okey bro, btw you can create cvector used memory in android ? I'am try create cvector used metode you but not working bro -_-

CVetcor is just a structure of XYZ coordinates.  It is actually a pointer.  You can write data into cleo's static space, and then use 0DD0 to get the address of the static memory space.

 

Ok.  I have already written the code to use XOR operation on Android.  Do you need it?  You can create new themes if needed.  I can upload the code.

Kucing.Bertelur
5 hours ago, XMDS said:

CVetcor is just a structure of XYZ coordinates.  It is actually a pointer.  You can write data into cleo's static space, and then use 0DD0 to get the address of the static memory space.

 

Ok.  I have already written the code to use XOR operation on Android.  Do you need it?  You can create new themes if needed.  I can upload the code.

yes I want XOR for Android bro, are the results of the XYZ Actor saved to pointer memory to become a vector?

5 hours ago, XMDS said:

CVetcor is just a structure of XYZ coordinates.  It is actually a pointer.  You can write data into cleo's static space, and then use 0DD0 to get the address of the static memory space.

 

Ok.  I have already written the code to use XOR operation on Android.  Do you need it?  You can create new themes if needed.  I can upload the code.

Check message

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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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