gokuta Posted July 23, 2020 Share Posted July 23, 2020 Alright, me disappointed! I cannot find an opcode for checking whether actor is in sphere! Like this 7FFF: actor $PLAYER_ACTOR in_sphere 0.0 0.0 0.0 radius 10.0 Very important thing to check indeed. Happens all the time. How do I do it? Link to comment https://gtaforums.com/topic/958943-actor-in-sphere-request/ Share on other sites More sharing options...
ZAZ Posted July 23, 2020 Share Posted July 23, 2020 (edited) The location checks have an integrated sphere parameter read more here Location checks for actor 00FE: actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 15.0 15.0 15.0 00FF: actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 1.0 1.0 2.0 on_foot 0100: actor $PLAYER_ACTOR in_sphere 2493.5 -1682.5 13.35 radius 4.0 4.0 4.0 sphere 1 in_car 0101: actor $PLAYER_ACTOR in_sphere 2493.5 -1682.5 13.35 radius 5.0 5.0 3.0 sphere 1 stopped 0102: actor $PLAYER_ACTOR in_sphere 2493.5 -1682.5 13.35 radius 1.2 1.2 3.0 sphere 1 stopped_on_foot 0103: actor $PLAYER_ACTOR in_sphere 2493.5 -1682.5 13.35 radius 4.0 4.0 6.0 sphere 1 stopped_in_car 0104: actor $PLAYER_ACTOR near_actor 1@ radius 15.0 15.0 15.0 sphere 1 0105: actor $PLAYER_ACTOR near_actor 1@ radius 5.0 5.0 2.0 sphere 1 on_foot Location checks for car 01AD: car 1@ sphere 1 near_point 2493.5 -1682.5 radius 6.0 6.0 01AE: car 1@ sphere 1 near_point 2493.5 -1682.5 radius 3.0 3.0 stopped 01AF: car 1@ sphere 1 in_sphere 2493.5 -1682.5 radius 0.2 0.2 1.0 01B0: car 1@ sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 4.0 4.0 4.0 stopped reason why the red sphere won't be shown, can be: - because of limits, look in Sanny Builder Help: SCM Documentation: GTA Limits - because sphere parameter of location check is disabled - because there's more than 0 ms wait time inside the loop Edited July 23, 2020 by ZAZ gokuta 1 Link to comment https://gtaforums.com/topic/958943-actor-in-sphere-request/#findComment-1071284919 Share on other sites More sharing options...
gokuta Posted July 23, 2020 Author Share Posted July 23, 2020 (edited) Three radii. I get it, I set them all three to the same value and it is all done. But the question remains, what are the other two radii for? One radius is all I need really. Also seems like "near_point" opcodes ignore height. Edited July 23, 2020 by gokuta Link to comment https://gtaforums.com/topic/958943-actor-in-sphere-request/#findComment-1071285173 Share on other sites More sharing options...
ZAZ Posted July 24, 2020 Share Posted July 24, 2020 radius 15.0 15.0 10.0 radius x y z the sphere can be an oval, if x is different to y like this radius 5.0 15.0 10.0 z param doesn't have an effect to the visual red sphere but to the capturing for the location check summery: 00FE: actor $PLAYER_ACTOR sphere 1 in_sphere 2493.5 -1682.5 13.35 radius 15.0 15.0 15.0 1.param = en/disable red spot ; 2.3.4. param = x,y,z, for position; 5.6.7. param = x,y,z for size of capturing spot Link to comment https://gtaforums.com/topic/958943-actor-in-sphere-request/#findComment-1071285487 Share on other sites More sharing options...
gokuta Posted July 24, 2020 Author Share Posted July 24, 2020 (edited) Quote the sphere can be an oval, if x is different to y like this U sure? Cuz me lil' test shows them spheres are actually boxes Edited July 24, 2020 by gokuta Link to comment https://gtaforums.com/topic/958943-actor-in-sphere-request/#findComment-1071286036 Share on other sites More sharing options...
ZAZ Posted July 24, 2020 Share Posted July 24, 2020 There're also opcodes that checks if actor is inside a cube 00A4: actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2782.693 -1921.125 11.7984 cornerB 2746.098 -1993.905 16.9599 cornerA x y z and cornerB x y z must be given (i always use the smaller floats (south/west) for the first corner, when i use such codes or for water cubes or for zone cubes) or in rectangle (checks also inside a cube but z is unlimited) 00A3: actor $PLAYER_ACTOR sphere 0 in_rectangle_cornerA 2037.536 2365.373 cornerB 2117.177 2483.922 Link to comment https://gtaforums.com/topic/958943-actor-in-sphere-request/#findComment-1071286093 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