Popular Post kashtesov Posted January 8, 2020 Popular Post Share Posted January 8, 2020 (edited) Hi everyone! Release small, but maybe useful resource for servers with default map without any mapping. This resource allows for you use getGroundPosition (without Z axis) on server-side. 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. What bugs you can detect with this resource? 1. Float positions will be always rounded to nearby integer. 2. If you remove world models, script dont know about that and will return position on removed object. 3. If you add new objects to map, script dont know about that and will return position on world object. How use that? exports.ground:getGroundPosition(x, y) Where it can be used? 1. Random airdrops? 2. Unbug script with random position nearby player? 3. Random forest generation on server-side? Future plans 1. Add method for check water in position. 2. Add method for get material in position. 3. Add method for get object info in position (world/custom, id) 4. Release script for capture map heights. Little demo Spoiler Download link https://drive.google.com/open?id=1JCYiKPRcv7a6Cw4g2MZgbsVEk3G6H_t8 Edited January 8, 2020 by SalwadoR 5 Link to comment
Moderators IIYAMA Posted January 8, 2020 Moderators Share Posted January 8, 2020 (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 January 8, 2020 by IIYAMA Link to comment
kashtesov Posted January 8, 2020 Author Share Posted January 8, 2020 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. 1 Link to comment
Moderators IIYAMA Posted January 8, 2020 Moderators Share Posted January 8, 2020 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? Link to comment
kashtesov Posted January 8, 2020 Author Share Posted January 8, 2020 (edited) 8 minutes ago, IIYAMA said: How long did it take for you to complete the process? 6000х6000 ~1 hr 8000x8000 ~1.5hr CPU FX 6300, 6x3.6 GHz Edited January 8, 2020 by SalwadoR Link to comment
Moderators IIYAMA Posted January 8, 2020 Moderators Share Posted January 8, 2020 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 Link to comment
kashtesov Posted February 3, 2020 Author Share Posted February 3, 2020 What about more smoothly positions? 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 1 Link to comment
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