Jump to content

[REL] Server-Side getGroundPosition


kashtesov

Recommended Posts

  • Moderators
Posted (edited)
11 minutes ago, SalwadoR said:

How it works?
All map heights wrotten to file, and resource just read it for get Z position. Not 100% accuracy, but anyway it works. 

Hmm interesting. Good job!

Not so long ago I did the same. Scanning the whole GTA san map 2 units x 2 units and saving all points in to a db. All though my file was a lot bigger, containing not just the x, y, z.

Edited by IIYAMA

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
Just now, IIYAMA said:

Hmm interesting.

Not so long ago I did the same. Scanning the whole GTA san map 2 units x 2 units and saving all points in to a db. All though my file was a lot bigger, containing not just the x, y, z.

Here scanning 1x1 units, and in my way dont need save X,Y positions.

  • Like 1
  • Moderators
Posted
5 hours ago, SalwadoR said:

Here scanning 1x1 units, and in my way dont need save X,Y positions.

How long did it take for you to complete the process?

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted
6 minutes ago, SalwadoR said:

6000х6000 ~1 hr
8000x8000 ~1.5hr

CPU FX 6300, 6x3.6 GHz

Oh lol, then you ran it on speedy mode.

I wasn't sure if it loaded all collision fast enough so I put it on slowmode and it took ~3 hours to process ?, including the separated db queries as second process. (6k*6k, 2x2 grid)

I7 3770k - 3,5GHz

 

 

 

 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • 4 weeks later...
Posted

LWp8i9j1ZGk.jpg

What about more smoothly positions? :D

local x, y = getElementPosition(getRandomPlayer());

for _i = 1, 300 do 
  local i = _i / 10;
  
  local z = getGroundPosition(x + i, y);		
  createObject(1337, x + i, y, z); 

  local z = getGroundPosition(x - i, y);		
  createObject(1337, x - i, y, z); 

  local z = getGroundPosition(x, y + i);		
  createObject(1337, x, y + i, z); 

  local z = getGroundPosition(x, y - i);		
  createObject(1337, x, y - i, z); 
end

 

  • Like 1

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...