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

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by danick10, Apr 29, 2015.

?

Do you think Tibia-Craft is a nice project

  1. Yes

    100.0%
  2. No

    0 vote(s)
    0.0%
  1. danick10

    danick10 Member

    Joined:
    Apr 11, 2009
    Messages:
    118
    Likes Received:
    22
    Best Answers:
    2
    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!
    [​IMG]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: Apr 29, 2015
  2. Mokerhamer

    Mokerhamer Retired Global Mod

    Joined:
    Aug 6, 2007
    Messages:
    1,764
    Likes Received:
    33
    Best Answers:
    0
    Please use the following:
    Images


    For the code:
    Code (Text):
    1. [-code]code here[-/code] (remove - at code part)
    or http://pastebin.com/
     
  3. danick10

    danick10 Member

    Joined:
    Apr 11, 2009
    Messages:
    118
    Likes Received:
    22
    Best Answers:
    2
    Thx :p added it in pastebin ! updated post!
     
  4. chiitus

    chiitus Member

    Joined:
    Jun 1, 2009
    Messages:
    202
    Likes Received:
    10
    Best Answers:
    0
    OOOHHH!! So good!! Thanks!!
     
  5. danick10

    danick10 Member

    Joined:
    Apr 11, 2009
    Messages:
    118
    Likes Received:
    22
    Best Answers:
    2
    Thx Nice to see you liked it!
     
  6. Codinablack

    Codinablack Dreamer

    Joined:
    Dec 26, 2013
    Messages:
    1,215
    Likes Received:
    370
    Best Answers:
    3
    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
     
  7. tejdi

    tejdi The legend never die.

    Joined:
    Oct 26, 2010
    Messages:
    303
    Likes Received:
    44
    Best Answers:
    0
  8. zbizu

    zbizu Retired

    Joined:
    Nov 22, 2010
    Messages:
    2,440
    Likes Received:
    1,348
    Best Answers:
    1
    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 (Text):
    1.                 repeat
    2. local pos_ = {x=posx,y=posy,z=posz}
    add this:
    Code (Text):
    1. if not Tile(pos_) then
    2.     Game.createTile(pos_)
    3. end
    so you won't have to draw pointless floor on your map
     
    Last edited: Jan 28, 2017
    Codinablack and tejdi like this.
  9. danick10

    danick10 Member

    Joined:
    Apr 11, 2009
    Messages:
    118
    Likes Received:
    22
    Best Answers:
    2
    @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
     
    Codinablack and zbizu like this.
  10. TheRealMystic

    TheRealMystic Aros.Online

    Joined:
    Oct 30, 2007
    Messages:
    223
    Likes Received:
    1
    Best Answers:
    0
    @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>
     
  11. danick10

    danick10 Member

    Joined:
    Apr 11, 2009
    Messages:
    118
    Likes Received:
    22
    Best Answers:
    2
    @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 ?
     
  12. danick10

    danick10 Member

    Joined:
    Apr 11, 2009
    Messages:
    118
    Likes Received:
    22
    Best Answers:
    2
    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 (Text):
    1. local items = Tile(pos_):getItems()
    2. if items ~= nil then
    3.     for i = 1, #items do
    4.     items[i]:remove()
    5.     end    
    6.     end

    By this :

    Code (Text):
    1. if  Tile(pos_):getItems() ~= nil then
    2. local items = Tile(pos_):getItems()
    3.     for i = 1, #items do
    4.     items[i]:remove()
    5.     end    
    6.     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
     
  13. TheRealMystic

    TheRealMystic Aros.Online

    Joined:
    Oct 30, 2007
    Messages:
    223
    Likes Received:
    1
    Best Answers:
    0
    Hi there, sorry it taken a bit to get back with you!I solved the issue. Thanks for the reply tho! :D
     

Share This Page

Loading...