• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

GlobalEvent [TFS1.0] Generate Automatic Map [ 6 biodiversity + river and underground! ]

Do you think Tibia-Craft is a nice project


  • Total voters
    17

danick10

Intermediate OT User
Joined
Apr 11, 2009
Messages
196
Solutions
4
Reaction score
141
Hi Everyone, this is my first script realease on Otland, Hope you guys like it!
The project was for a mix of Tibia and Minecraft Map,
It generates
River
Grass biodomes,
Desert biodomes,
Jungle biodomes,
Snow biodomes,
Field biodomes,
Water Biodomes,
And underground floor from 8 to 15 with blue green and red Crystal.
I've also done a Mining script that digs holes, and building walls, but I've only done the begeining of the project,
I consider these script as a realy nice start for those who wants to continue with the Tibia-Craft Project!
The map size is infinite or until your cpu can't handle it =)
Everything is configurable,
Please do not share on other forums or take credits for my work, it took me a while to do it =) Thx

Here is some screen shot!
image.png
http://postimg.org/image/4j46j6i4b/
http://postimg.org/image/6z5zx106z/
http://postimg.org/image/z1tz457az/
http://postimg.org/image/sf7baypmj/
http://postimg.org/image/yvga11y63/

Here is the script:
http://pastebin.com/gtZiYTtB
Here you go :) --> simply add it in globalevents onstartup!
 
Last edited:
Thanks for the release! Didn't have time to dig much into the coding style and stuff, the only thing I can notice off the bat is indentation, that helps alot, I used to think that as long as I knew where the code was and how it was written why care, but then after working on indentation since I was releasing stuff here, I noticed the huge benefits that really comes with it, and overall in the end you become alot more proud of your own work as it makes it look so much more beautiful :D
 
dude, that's AWESOME!
if you are looking for ideas, join us:
https://otland.net/threads/generating-maps.200487

btw.
Consider working on polygons instead of chunks or using heightmaps, your output map is too linear.
Biomes and land shape should be bound to map seed.

I can provide seed-dependant math.random (which won't be affected by rolling a dice or something) and a way to reduce rendering/drawing lag in exchange for a smooth and good quality heightmap which can be used for lands and biomes

@tejdi it works on 1.2, but... below this:
Code:
                repeat
local pos_ = {x=posx,y=posy,z=posz}

add this:
Code:
if not Tile(pos_) then
	Game.createTile(pos_)
end

so you won't have to draw pointless floor on your map
 
Last edited:
@zbizu Indeed :) using a simple polygone algorythm to spawn the tile would make it look even greater! but I did nt spend a lot of time on this script, ive done it in 1 night, now im doing 3D model on blender and devloping my own game in c# with unity! its nice to see that some ppl are interested in it! Thx
 
@danick10 got Skype? Would like to use this, but getting "attempt to index a nil value stack traceback
C: function '__ index '
Data/globalevents/scripts/map.lua:438: in function <data/globalevents/scripts/map.lua:1>
 
@TheRealMystic Hello! Yes I have a skype, you can PM me your name and ill add you, sorry for the late answer :p, Ill try to find out this issue, which version of tfs are you using ?
 
It looks like your distro does not create the item stack if there is no item on the tile, therefore, it cant assign any stack to the variable, right of the bat, I would try replacing this piece of code :
Code:
local items = Tile(pos_):getItems()
if items ~= nil then
    for i = 1, #items do
    items[i]:remove()
    end     
    end


By this :

Code:
if  Tile(pos_):getItems() ~= nil then
local items = Tile(pos_):getItems()
    for i = 1, #items do
    items[i]:remove()
    end     
    end


This simple change only check if the stack is not null before assigning it to the variable, I think that it was the issue you had, if it doesn't work, you can send me your skype and ill contact you ;p
 
Hi there, sorry it taken a bit to get back with you!I solved the issue. Thanks for the reply tho! :D
 
Back
Top