Jump to content

Gta Spheres : Invisible collision Help


Zintro

Recommended Posts

Yo, so I made a custom mission that makes enemies attack player when he gets into their area ( Sphere ), but I noticed that they act before he gets there so I decided to test in a sub custom script. Here is the script, it tells you when you are in sphere or not :

{$CLEO .cs}
:Thread
03A4: name_thread 'MAIN' 
0007: 2@ = 1921.9714
0007: 3@ = -1406.8552
0007: 4@ = 13.5703
0007: 7@ = 20.0 
0007: 8@ = 20.0 
0007: 9@ = 20.0 
03BC: 1@ = create_sphere_at 2@ 3@ 4@ radius 7@ 8@ 9@

:Sphere
wait 0
if 
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2@ 3@ 4@ radius 7@ 8@ 9@
jf @Sphere  
jump @loop 

:loop
wait 0
00BC: show_text_highpriority GXT 'TXT_01' time 10 flag 1  // You Are In Sphere
if
80FE:   not actor $PLAYER_ACTOR sphere 0 in_sphere 2@ 3@ 4@ radius 7@ 8@ 9@
jf @loop 
jump @Sphere   

I noticed that the game considers that you are in sphere even though you are not touching it .

It isn't noticable while working with small spheres :

 

NrEbJvP.png

 

But In my custom mission  I need the sphere to be large so when the player enter the area, enemies will attack him however this invisible collision ( Or whatever it is ) becomes larger as well :

 

a578ck6.png

 

Is it a problem in the way i create spheres or should I not use large ones? Sorry for bad english as usual ( The area is near the hospital btw )

Edited by Zintro
Link to comment
Share on other sites

yes, i often noticed that the visual red cylinder is smaller than the real radius

just keep that in mind

 

I recommand another detail:

make the radius for the "exit check" bigger than the the one for the "entry check" to avoid "activ/inactiv flickering" problems

if 
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 2@ 3@ 4@ radius 20.0 20.0 20.0


if
80FE:   not actor $PLAYER_ACTOR sphere 0 in_sphere 2@ 3@ 4@ radius 22.0 22.0 22.0

 

btw. your images at postimg.cc are looking good for me

 

 

 

 

Edited by ZAZ
Link to comment
Share on other sites

10 minutes ago, ZAZ said:

yes, i often noticed that the visual red cylinder is smaller than the real radius

just keep that in mind

So there is no dynamic way to define large spaces but using big spheres  and consider that the real radius is bigger than the visual one ?

Link to comment
Share on other sites

this sphere is inaccurate in size

if you wanna  show an exact cube or cylinder or area than use an object and resize it by opcode 08D2: object 15@ scale_model  14@

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
  • 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.