Open urban119 opened 8 years ago
No, it's not possible, but loadMap could be extended to allow offset arguments.
do you just want to load a certain part of the map and re create it somewhere else, or what are you trying to achieve?
I try load fragment part of the map in Main map. Just put a little fragment... It is possible, because second fragment a map been added to Main map, started as x,y (because position xyz on loaded second map has been the same in Main map when it been loaded). I just need moved example x + 50, y + 50 loading fragment map.
I just do function like Dungeon, Raids, BattleMap for TeamPlayers. (Like dungeon system in World Of Warcraft).
That idea is very nice.
actually you can do that pretty easy completly in lua aswell, I've once written what you suggested here using coroutines and such, so it didn't affect server performence and such here's the youtube link https://youtu.be/sqSWUJy_wa4 https://www.youtube.com/watch?v=HG8hFqU0zI0 If you want it feel free to hit me up.
Nice, would be very useful
I search function, to add offset and moved generated fragment map. Why i have problem and want this to do? Becouse if I am load more copy of fragment map, I am need do loadmap with offset + 1000 example. If i do that, i can load example x5 fragment map for x5 team. Each of the teams have separate map for myself. (other thema is delete nousing map and other clearing function, but not yet to speak). I do that in luascript.... but i wanna do werry fast, accurate and without errors load map... and source give exacly that for me. Youtube for You: https://youtu.be/xkvfVS5VZIg
Well my function does exactly what you are asking for, it's combined with an indexing system to be able to locate all maps with their coordinates, you have to keep in mind if you copy a map and it contains levers and such you need to provide the scripts the offset aswell or it wont work at all
How to contact you @EvilHero90 ?
Skype: evilhero19, I'm still at work tho
Okey I am end that work and say It is Done! Watch me video 0:48: https://youtu.be/gNEJnYDhcT8
I don't want do that functions with lua files (probably lags server).... I am edit only source and me new function loadMapU (its not laging server). It is exacly what i want ;)
Lua performance is generally not an issue. Please do consider the effort of recompiling everytime and the extra issues of lower level programming of C++ when choosing not to use Lua.
@urban119 can you do a pull request with it?
I've accomplished a lot more with c++ than I ever have with lua, sometimes editing or making a slight change in the source is much easier and less time consuming than writing a complex script.
Hello It is possible, to loadMap as specified start position x,y,z ?
If i use loadMap(data/map.otbm) it imposes two map... Can You direct me, what function i need edit, when map Starts load?
Maybe class Map: void setTile(uint16_t x, uint16_t y, uint8_t z, Tile* newTile); void setTile(const Position& pos, Tile* newTile) {
setTile(pos.x, pos.y, pos.z, newTile); }
Regards