2pacproducer2 Posted October 31, 2009 Share Posted October 31, 2009 (edited) 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 October 31, 2009 by 2pacproducer2 Link to comment Share on other sites More sharing options...
Deji Posted October 31, 2009 Share Posted October 31, 2009 (edited) "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 October 31, 2009 by Deji Link to comment Share on other sites More sharing options...
ZAZ Posted October 31, 2009 Share Posted October 31, 2009 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 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
2pacproducer2 Posted October 31, 2009 Author Share Posted October 31, 2009 Ok, ZAZ suggestion is a little more easier, and Deji I dont get yours... any more ideas ? Link to comment Share on other sites More sharing options...
TheSiggi Posted November 2, 2009 Share Posted November 2, 2009 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 More sharing options...
gtasearcher Posted November 2, 2009 Share Posted November 2, 2009 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 More sharing options...
chaosislife Posted November 26, 2011 Share Posted November 26, 2011 (edited) 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 November 28, 2011 by chaosislife 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