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

Behind the CJ ?


2pacproducer2
 Share

Recommended Posts

2pacproducer2

Hi, I want to know, is it possible to spawn an actor in a random coord arround the player with radius of 50 in all directions but when player doesnt see when that actor appears, it should work like remove references to anything, when player doesnt looks the thing dissapears, so when player doesnt looks, an actor spawns. Is it possible ?

 

I was trying with this:

 

Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])[email protected] = -1 08E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 65.0 handle_as [email protected] if   not [email protected] == -1 jf @THUG_185 [email protected] = 0 jump @THUG_201 :THUG_185Actor.RemoveReferences([email protected])wait 0 jump @THUG_11 :THUG_201wait 0 if 00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere [email protected] [email protected] [email protected] radius 65.0 65.0 65.0 on_foot jf @THUG_185 replace actor [email protected] with actor I want. and bla bla bla

 

 

But it sometimes gets that actor when CJ looks at that place and it is not what I want. Any help ?

Edited by 2pacproducer2
Link to comment
Share on other sites

"random_float_in_ranges" is what you need to opcode search for. Simply get your center point, add 50.0 to the x, y radius' and then take 50.0 from the x and y radius' and store them in seperate variables to use as parameters for the random float line... Unfortunately I don't have the Sanny to get the opcodes and explain it a little easier...

 

 

[email protected] = [email protected] // store x in a new variable

[email protected] = [email protected] // store y in a new variable

[email protected] = [email protected] // store x in a new variable (2)

[email protected] = [email protected] // store y in a new variable (2)

 

[email protected] + 65.0 // add 65.0 to the new variable of x

[email protected] + 65.0 // add 65.0 to the new variable of y

[email protected] - 65.0 // take 65.0 from the new variable of x (2)

[email protected] - 65.0 // take 65.0 from the new variable of y (2)

 

[email protected] = random_int_in_ranges [email protected] and [email protected] // get the random coords within 65.0 of the player for the x coord.

[email protected] = random_int_in_ranges [email protected] and [email protected] // get the random coords within 65.0 of the player for the y coord.

 

create_actor_at [email protected] [email protected] [email protected] // [email protected] is the height and can remain the same.

Edited by Deji
Link to comment
Share on other sites

 

Hi, I want to know, is it possible to spawn an actor in a random coord arround  the player with radius of 50 in all directions but when player doesnt see when that actor appears, it should work like remove references to anything, when player doesnt looks the thing dissapears, so when player doesnt looks, an actor spawns. Is it possible ?

 

But it sometimes gets that actor when CJ looks at that place and it is not what I want. Any help ?

I used in several mods the opcode 068D: get_camera_position_to [email protected] [email protected] [email protected]

to get the camera target area or to calculate

in connection with 0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]

the angle of oriention to move to a destination

it's equal to the mouse move

 

but your actors can stuck in buildings, yards, garden

 

For ResidentEvil main I calculated the area behind the camera to find a random actor in car and got his coords to spawn 6 zombies at a hidden place

Link to comment
Share on other sites

 

Deji I dont get yours...

 

 

He duplicates the x and y coordinate and edits both:

 

e.g.:

 

 

X: X1 + 65X2 [...]

 

 

so he extendns the range

 

if you add 65 to X1 and deduct 65 from X2

 

you hav a X-coord- range which has the size of 130 (2*65)

 

same with the y coord....so now you have random points in the radius of 65 around the player

 

but the problem that the actor will be spawn in walls, houses or the map itself still exists

Link to comment
Share on other sites

If you don't want the actor stuck.... you can try this:

 

02C0: store_to [email protected] [email protected] [email protected] ped_path_coords_closest_to [email protected] [email protected] [email protected]

 

 

And for cars:

 

02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected]

 

Link to comment
Share on other sites

  • 2 years later...

Old topic, but what about setting the z coordinate to the "blue zone" or whatever they call that depth that causes an actor to be respawned back on the map?

 

Also, an actual working answer for anyone looking for it.

 

 

:Spawn_Guywait 1if0256:   player $PLAYER_CHAR definedjf @Spawn_GuyWait 1if and 00E1:   key_pressed  0  600E1:   key_pressed  0  17jf @Spawn_Guy:Spawn_Guy_1wait 10208: [email protected] = random_float_in_ranges 45.0 and 50.00208: [email protected] = random_float_in_ranges -45.0 and -50.004C4: create_coordinate  [email protected]  [email protected]  [email protected] from_actor $PLAYER_ACTOR offset  [email protected] [email protected] 5009A: [email protected] = create_actor_pedtype 4 model #MALE01 at [email protected] [email protected] [email protected]  05E2: AS_actor [email protected] kill_actor $PLAYER_ACTORwait 2000Actor.RemoveReferences([email protected])jump @Spawn_Guy_1

 

 

activates with Aim+Fire but I do suggest finding the blue hell depth that causes the player to respawn back on the map at the proper level and path and try setting that as the Z coord for the offset.

Edited by chaosislife
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.