Eclipse - Free 2D Mmorpg Maker
September 02, 2010, 10:18:57 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Shop Arcade chat Login Register  
 
 
   
 
collapse

* No Spam Or Websites

Refresh History
  • Ertzel: So... Anyone with basic/none/limited photoshop or even paint skills want to make some money converting sprites for me?
    Today at 10:07:35 PM
  • Gamma™: weaver why are you oflfine on H&H? :S
    Today at 10:04:26 PM
  • Ertzel: Ya, only one try per knife, my one try failed :(
    Today at 10:00:17 PM
  • LegendWeaver: is it one use?
    Today at 09:43:15 PM
  • Ertzel: Wish I didnt spend my 1k+ credits to buy the stupid knife that failed at stealing Robins credits >.<
    Today at 09:42:42 PM
  • Wraith: ) Kreator!
    Today at 09:06:52 PM
  • Wraith: yes! you were! (in red text
    Today at 09:06:46 PM
  • ToshiroHayate: Kreator!
    Today at 08:25:02 PM
  • Kreator: o_0 Was I supposed to Wraith?
    Today at 08:16:02 PM
  • [Pie] ICT: Don't worry.. I commented.
    Today at 07:55:08 PM
  • Wraith: Ay, kreator, wtf is up with you not posting anything about my new cliffs??
    Today at 07:50:36 PM

* Recent Topics

[EO] Attaching Problem. by Ertzel
[Today at 10:11:57 PM]


Project Vertigo [2d Tile-based Side-Scrolling Engine] by Miguu
[Today at 10:03:22 PM]


Zacaras Empire (Hiring) by Ertzel
[Today at 08:43:54 PM]


custom cliff tiles by ToshiroHayate
[Today at 08:29:15 PM]


.: RPG Kingdom :. by LegendWeaver
[Today at 08:25:20 PM]


What do you think? by [Pie] ICT
[Today at 07:54:54 PM]


[Show Off] Aztec Stuff by [Pie] ICT
[Today at 07:50:07 PM]


So I herd you liek mudkipz by Kreator
[Today at 07:36:52 PM]


Haven and Hearth: Epic Screenshot Thread by Tompwnage™
[Today at 07:14:21 PM]


The Lonliest Star [RP] by DDunit
[Today at 07:09:46 PM]


* Who's Online


Pages: [1] 2 3
Site Author : Topic: Script Submission: MAPGENERATOR(!) (Difficulty 10/5)  (Read 19552 times)
0 Members and 1 Guest are viewing this topic.
October 15, 2006, 10:14:52 AM
The Uber-Scriptor
Advanced Member
****
User No : 375
Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW


    Hello all,

    Good news and bad news:
    Bad:
    This will be my last script submission for a long time. I'm going to quit eclipse for some time, so you'll have to do with this one for a while. Cya around all.

    Bad2:
    Difficulty:
    Noob/Newb: 200/5 (never mind about this script, believe me)
    Advanced scripter: 10/5 (good luck, you might be able to use it with a lot of trying)
    Pro Scripter: 4/5 (you should be able to do this, but it's hard, believe me)
    Uber-Scriptor: 3/5 (believe it or not, but it's just messed up hard)

    Good:
    I kinda p0wned every single other script on the forum (exept for barons version, but this wasn't posted on the forum, therefore I did pown them all, sorta, no offence ofcourse, I would love to see someone prove me wrong), if you disaprove with this, idk, it's still a hella awesome script :p. The mapgen generates a random map, withing around 20 seconds, completely random, and detailed as much as you want to! If configured correctly!

    I know I told everyone I wasn't going to post it, but well, I finished the tutorial, so I could just as well post it. I'm not going to explain how to use it any further though, if you can't understand it, to bad, its an extremely high level script (if I may say this), and only real good scripters will probably get it to work. Also, I do not want to encourage anyone to just use this script to mapgen a complete game, and that way building a prefab game. Also, if you do use this mapgen for a game, please give me some credits, I spend around 40 hours on this thing (believe it or not, it's true. It might look like something easy because the script itself is only 15 kb, but it was headache all the fukcing way).

    Ok, the tutorial sucks, so if someone DOES understand it, and DOES get it to work, please rewrite it, mail it to me and I'll post it instead (contrary to my scripting ability, my tutorial ability sucks)


    The script itself, I'm not going to explain how to install it, if you cannot do this you sure as hell won't be able to do the configuring part (sorry guys).

    The main code *bows*:
    Code: [Select]
    '*****************************************************************
    '*****************************************************************
    'XX This script has been created by Ilnair, aka Dinand Mentink  XX
    'XX Please do not give it out saying you made it, or distribute XX
    'XX it anywhere outside the Eclipse forums! Also, please always XX
    'XX distribute these credits along with the script! XX
    'XX           www.nishansu.tk       ©Dinand Mentink (aka Ilnair)XX
    '*****************************************************************
    '*****************************************************************
    'START MAPGEN!
    '*****************************************************************
    '*****************************************************************

    Sub GenerateMap(index, map, patern)
    On Error Resume Next
    Dim x
    Dim y
    Dim tileset
    Dim tilex
    Dim tiley
    Dim paternname
    Dim likely
    Dim likelymin
    Dim likelymax
    Dim likelycurrent
    Dim patch
    Dim solid
    Dim solidmax
    Dim patchmax
    Dim random
    Dim object
    Dim objectmax
    Dim width
    Dim height
    Dim objectxset
    Dim objectyset
    Dim objectx
    Dim objecty
    Dim ystart
    Dim xstart
    Dim objectyloc
    Dim objectxloc
    Dim loopvar
    Dim objecttiles
    Dim objecttile
    Dim layer
    Dim controllobject
    paternname = GetVar("mapgenerator.ini", "paternnames", patern & "")
    If paternname = "none" Then
    Call PlayerMsg(index, "No patern specified for this number!", 12)
    Exit Sub
    End If
    Call PlayerMsg(index, "Building a " & paternname & " at map " & map & " using predefined values and random variables.", 15)
    Call PlayerMsg(index, "Building Ground...", 15)
    tileset = GetVar("mapgenerator.ini", paternname & "Ground", "groundset")
    tilex = GetVar("mapgenerator.ini", paternname & "Ground", "groundx")
    tiley = GetVar("mapgenerator.ini", paternname & "Ground", "groundy")
    x = 0
    y = 0
    Do While y < 15
    Do While x < 20
    Call SetTile(map, x, y, tilex, tiley, tileset, 0)
    x = x + 1
    Loop
    y = y + 1
    x = 0
    Loop
    Call PlayerMsg(index, "Finished Ground, building Patches...", 15)
    patch = 1
    patchmax = GetVar("mapgenerator.ini", paternname & "Ground", "patches") + 1
    Do While patch < patchmax
    x = 0
    y = 0
    tileset = GetVar("mapgenerator.ini", paternname & "Ground", "patch" & patch & "set")
    tilex = GetVar("mapgenerator.ini", paternname & "Ground", "patch" & patch & "x")
    tiley = GetVar("mapgenerator.ini", paternname & "Ground", "patch" & patch & "y")
    likely = GetVar("mapgenerator.ini", paternname & "Ground", "patch" & patch & "likely")
    likelymin = Int(likely - 2)
    likelymax = Int(likely + 2)
    likely = Int((likelymax - likelymin + 1)*Rnd) + likelymin
    likelycurrent = 1
    Do While likelycurrent < likely
    x = Int((19 - 0 + 1)*Rnd)+0
    y = Int((14 - 0 + 1)*Rnd)+0
    Call SetTile(map, x, y, tilex, tiley, tileset, 1)
    likelycurrent = likelycurrent + 1
    Loop
    patch = patch + 1
    Loop
    Call PlayerMsg(index, "Finished Patches, building Solids...", 15)
    solid = 1
    solidmax = GetVar("mapgenerator.ini", paternname & "Ground", "solids") + 1
    Do While solid < solidmax
    x = 0
    y = 0
    tileset = GetVar("mapgenerator.ini", paternname & "Ground", "solid" & solid & "set")
    tilex = GetVar("mapgenerator.ini", paternname & "Ground", "solid" & solid & "x")
    tiley = GetVar("mapgenerator.ini", paternname & "Ground", "solid" & solid & "y")
    likely = GetVar("mapgenerator.ini", paternname & "Ground", "solid" & solid & "likely")
    likelymin = Int(likely - 2)
    likelymax = Int(likely + 2)
    likely = Int((likelymax - likelymin + 1)*Rnd) + likelymin
    likelycurrent = 1
    Do While likelycurrent < likely
    x = Int((18 - 1 + 1)*Rnd)+1
    y = Int((13 - 1 + 1)*Rnd)+1
    Call SetTile(map, x, y, tilex, tiley, tileset, 1)
    Call SetBlock(map, x, y)
    likelycurrent = likelycurrent + 1
    Loop
    solid = solid + 1
    Loop
    Call PlayerMsg(index, "Finished Solids, building Objects...", 15)

    object = 1
    objectmax = GetVar("mapgenerator.ini", paternname & "Ground", "objects") + 0
    layer = GetVar("mapgenerator.ini", paternname & "Ground", "objectlayer") + 0

    Do While object <= objectmax
    likelycurrent = 1
    likely = GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "likely")
    likelymin = Int(likely - 2)
    likelymax = Int(likely + 2)
    likely = Int((likelymax - likelymin + 1)*Rnd) + likelymin
    Do While likelycurrent <= likely
    width = GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "width")
    height = GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "height")
    tileset = GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "set")
    x = Int((19 - 0 + 1)*Rnd) + 0
    y = Int(((13 - height) - 0 + 1)*Rnd) + 0
    xstart = x
    ystart = y
    objecttiles = GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "tiles") + 0
    objecttile = 1
    objectcontroll = 0
    Do While y < ystart + height
    Do While x < xstart + width
    If GetTileX(map, x, y, layer) > 0 Then
    objectcontroll = 1
    End If
    If GetTileY(map, x, y, layer) > 0 Then
    objectcontroll = 1
    End if
    x = x + 1
    Loop
    x = xstart
    y = y + 1
    Loop
    y = ystart
    x = xstart
    loopvar = 1
    Do While objectcontroll = 1
    objectcontroll = 0
    x = Int((19 - 0 + 1)*Rnd) + 0
    y = Int(((13 - height) - 0 + 1)*Rnd) + 0
    xstart = x
    ystart = y
    Do While y < ystart + height
    Do While x < xstart + width
    If GetTileX(map, x, y, layer) > 0 Then
    objectcontroll = 1
    End If
    If GetTileY(map, x, y, layer) > 0 Then
    objectcontroll = 1
    End if
    x = x + 1
    Loop
    x = xstart
    y = y + 1
    Loop
    loopvar = loopvar + 1
    If loopvar = 5000 Then
    Call PlayerMsg(index, "Map full. Aborting Current Object!", 12)
    objecttile = objecttiles + 1
    likelycurrent = likely
    objectcontroll = 0
    End If
    Loop
    Do While objecttile <= objecttiles
    objectx = xstart + GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "tile" & objecttile & "x")
    objecty = ystart + GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "tile" & objecttile & "y")
    objectxset = GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "tile" & objecttile & "setx")
    objectyset = GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "tile" & objecttile & "sety")
    blocked = GetVar("mapgenerator.ini", paternname & "Ground", "object" & object & "tile" & objecttile & "blocked")
    If blocked = 1 Then
    Call SetBlock(map, objectx, objecty)
    End If
    Call SetTile(map, objectx, objecty, objectxset, objectyset, tileset, layer)
    objecttile = objecttile + 1
    Loop
    likelycurrent = likelycurrent + 1
    Loop
    object = object + 1
    Loop
    Call PlayerMsg(index, "Finished Objects, placing 2nd layer objects...", 15)
    object = 1
    objectmax = GetVar("mapgenerator.ini", paternname & "Ground", "objectsb") + 0
    layer = GetVar("mapgenerator.ini", paternname & "Ground", "object2layer") + 0
    Do While object <= objectmax
    likelycurrent = 1
    likely = GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "likely")
    likelymin = Int(likely - 2)
    likelymax = Int(likely + 2)
    likely = Int((likelymax - likelymin + 1)*Rnd) + likelymin
    Do While likelycurrent <= likely
    width = GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "width")
    height = GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "height")
    tileset = GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "set")
    x = Int((19 - 0 + 1)*Rnd) + 0
    y = Int(((13 - heigth) - 0 + 1)*Rnd) + 0
    xstart = x
    ystart = y
    objecttiles = GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "tiles") + 0
    objecttile = 1
    objectcontroll = 0
    Do While y < ystart + height
    Do While x < xstart + width
    If GetTileX(map, x, y, layer) > 0 Then
    objectcontroll = 1
    End If
    If GetTileY(map, x, y, layer) > 0 Then
    objectcontroll = 1
    End if
    x = x + 1
    Loop
    x = xstart
    y = y + 1
    Loop
    y = ystart
    x = xstart
    loopvar = 1
    Do While objectcontroll = 1
    objectcontroll = 0
    x = Int((19 - 0 + 1)*Rnd) + 0
    y = Int(((13 - height) - 0 + 1)*Rnd) + 0
    xstart = x
    ystart = y
    Do While y < ystart + height
    Do While x < xstart + width
    If GetTileX(map, x, y, layer) > 0 Then
    objectcontroll = 1
    End If
    If GetTileY(map, x, y, layer) > 0 Then
    objectcontroll = 1
    End if
    x = x + 1
    Loop
    x = xstart
    y = y + 1
    Loop
    loopvar = loopvar + 1
    If loopvar = 5000 Then
    Call PlayerMsg(index, "Map full. Aborting Current Object!", 12)
    objecttile = objecttiles + 1
    likelycurrent = likely
    objectcontroll = 0
    End If
    Loop
    Do While objecttile <= objecttiles
    objectx = xstart + GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "tile" & objecttile & "x")
    objecty = ystart + GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "tile" & objecttile & "y")
    objectxset = GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "tile" & objecttile & "setx")
    objectyset = GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "tile" & objecttile & "sety")
    blocked = GetVar("mapgenerator.ini", paternname & "Ground", "objectb" & object & "tile" & objecttile & "blocked")
    If blocked = 1 Then
    Call SetBlock(map, objectx, objecty)
    End If

    Call SetTile(map, objectx, objecty, objectxset, objectyset, tileset, layer)
    objecttile = objecttile + 1
    Loop
    likelycurrent = likelycurrent + 1
    Loop
    object = object + 1
    Loop
    Call PlayerMsg(index, "Finished 2nd layer Objects!", 15)
    Call PlayerMsg(index, "Succesfully Generated a " & paternname & " at map " & map & ".", 15)
    End Sub


    The command:


    Code: [Select]
    'Map save/load/generate commands
    'Hieronder: TextSay, 1, lengte commando (dus /x is 2, /xxxxx is 6)
    If LCase(Mid(TextSay, 1, 4)) = "/map" Then
    'Als commando alleen voor GM's is, kun je hier Exit Sub doen 
    'Hieronder vorige getal + 1 (2x)
    If GetPlayerAccess(index) = 0 Then
    Exit Sub
    End If

    If Len(TextSay) > 5 Then
    TextSay = Mid(TextSay, 5)
    'Dit gebeurt er als er een commando op is gegeven, TextSay is het commando
    Select Case LCase(Trim(TextSay))
    Case "clear"
    x = 0
    y = 0
    map = GetPlayerMap(index)
    Call PlayerMsg(index, "Clearing the map. Please wait...", 15)
    layer = 0
    Do While layer < 9
    Do While y < 15
    Do While x < 20
    Call SetTile(map, x, y, 0, 0, 0, layer)
    x = x + 1
    Loop
    x = 0
    y = y + 1
    Loop
    x = 0
    y = 0
    layer = layer + 1
    Loop
    x = 0
    y = 0
    Do While y < 15
    Do While x < 20
    Call SetAttribute(map,X,Y,0,0,0,0,"","","")
    x = x + 1
    Loop
    x = 0
    y = y + 1
    Loop
    Call PlayerMsg(index, "Map cleared!", 15)
    Exit Sub


    Case "list paterns"
    n = 1
    Do While n < 10
    name = GetVar("mapgenerator.ini", "paternnames", n & "")
    Call PlayerMsg(index, n & ": " & name, 15)
    n = n + 1
    Loop
    Exit Sub

    Case "save"
    Call SaveMap(index, GetPlayerMap(index))
    Exit Sub

    Case "load"
    Call LoadMap(index, GetPlayerMap(index))
    Exit Sub

    Case "help"
    Call PlayerMsg(index, "COMMAND REFERENCE for /map:", 15)   
    Call PlayerMsg(index, "Admin mapping commands.", 15)
    Call PlayerMsg(index, "save: Will save the current map to a .ini file.", 15)
    Call PlayerMsg(index, "load: loads the saved map from the .ini file to the current map.", 15)
    Call PlayerMsg(index, "clear: completely clears the current map.", 15)
    Call PlayerMsg(index, "gen <map> <pattern number>: generate a map based on predevined values and random variables. Use /map gen help for more info!", 15)
    Call PlayerMsg(index, "putvars <pattern number>: will use the 2 first rows to put vars for the solids and patches. Row 1 being patches, row 2 being solids. Use the MASK layer!", 15)
    Call PlayerMsg(index, "putobject <pattern number> <object number> <width> <height>: saves an object made in MASK layer as an object to the mapgenerator.ini file!", 15)
    Call PlayerMsg(index, "put2object <pattern number> <object number> <width> <height>: saves an object made in MASK layer as an 2nd layer object to the mapgenerator.ini file!", 15)
    'Call PlayerMsg(index, "", 15)
    Exit Sub
    End Select

    'Hieronder TestSay, 1, lengte subcommando

    If Mid(TextSay, 2, 7) = "putvars" Then 
    x = 1
    name = Int(Mid(TextSay, 10, 10))
    name = GetVar("mapgenerator.ini", "paternnames", name & "")

    Do While x < 20
    Call PutVar("mapgenerator.ini", name & "Ground", "patch" & X & "set", GetTileSet(GetPlayerMap(index), x, 0, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "patch" & X & "x", GetTileX(GetPlayerMap(index), x, 0, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "patch" & X & "y", GetTileY(GetPlayerMap(index), x, 0, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "patch" & X & "likely", "3")
    x = x + 1
    Loop

    x = 1

    Do While x < 20
    If GetTileX(GetPlayerMap(index), x, 1, 1) > 0 or GetTileY(GetPlayerMap(index), x, 1, 1) > 0 Then
    Call PutVar("mapgenerator.ini", name & "Ground", "solid" & X & "set", GetTileSet(GetPlayerMap(index), x, 1, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "solid" & X & "x", GetTileX(GetPlayerMap(index), x, 1, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "solid" & X & "y", GetTileY(GetPlayerMap(index), x, 1, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "solid" & X & "likely", "1")
    Else
    x = 20
    End If
    x = x + 1
    Loop
    Call PutVar("mapgenerator.ini", name & "Ground", "groundset", GetTileSet(GetPlayerMap(index), 0, 0, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "groundx", GetTileX(GetPlayerMap(index), 0, 0, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "groundy", GetTileY(GetPlayerMap(index), 0, 0, 1) & "")

    Call PlayerMsg(index, "Saved solid, patches and ground tiles for the " & name & " pattern.", 15)
    Exit Sub
    End If


    If Mid(TextSay, 2, 9) = "putobject" Then

    objectnumber = Mid(TextSay, 14, 1)
    name = Mid(TextSay, 12, 1)
    width = Int(Mid(TextSay, 16, 1))
    height = Int(Mid(TextSay, 18, 1))

    name = GetVar("mapgenerator.ini", "paternnames", name & "")

    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "width", width & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "height", height & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "tiles", height * width & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "likely", "1")
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "set", GetTileSet(GetPlayerMap(index), width  - 1, height - 1, 1) & "")

    x = 0
    y = 0

    n = 1
    Do While y < height
    Do while x < width
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "tile" & n & "x", x & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "tile" & n & "y", y & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "tile" & n & "setx", GetTileX(GetPlayerMap(index), x, y, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "tile" & n & "sety", GetTileY(GetPlayerMap(index), X, Y, 1) & "")

    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "tile" & n & "blocked", "0")

    If GetAttribute(GetPlayerMap(index), x, y) = 1 Then
    Call PutVar("mapgenerator.ini", name & "Ground", "object" & objectnumber & "tile" & n & "blocked", "1")
    End If
    n = n + 1
    x = x + 1
    Loop
    x = 0
    y = y + 1
    Loop

    Call PlayerMsg(index, "Saved as object " & objectnumber & " on the " & name & " pattern!", 15)
    Exit Sub
    End If

    If Mid(TextSay, 2, 10) = "put2object" Then
    objectnumber = Mid(TextSay, 15, 1)
    name = Mid(TextSay, 13, 1)
    width = Int(Mid(TextSay, 17, 1))
    height = Int(Mid(TextSay, 19, 1))
    name = GetVar("mapgenerator.ini", "paternnames", name & "")

    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "width", width & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "height", height & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "tiles", height * width & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "likely", "1")
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "set", GetTileSet(GetPlayerMap(index), width, height, 1) & "")

    x = 0
    y = 0

    n = 1
    Do While y < height
    Do while x < width
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "tile" & n & "x", x & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "tile" & n & "y", y & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "tile" & n & "setx", GetTileX(GetPlayerMap(index), x, y, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "tile" & n & "sety", GetTileY(GetPlayerMap(index), X, Y, 1) & "")
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "tile" & n & "blocked", "0")

    If GetAttribute(GetPlayerMap(index), x, y) = 1 Then
    Call PutVar("mapgenerator.ini", name & "Ground", "objectb" & objectnumber & "tile" & n & "blocked", "1")
    End If
    n = n + 1
    x = x + 1
    Loop
    x = 0
    y = y + 1
    Loop

    Call PlayerMsg(index, "Saved object as 2nd layer object " & objectnumber & " on the " & name & " pattern!", 15)
    Exit Sub
    End If

    If Mid(TextSay, 2, 3) = "gen" then
    map = Mid(TextSay, 6, 3)
    patern = Int(Mid(TextSay, 10, 1))
    If map = "loc" Then
    map = GetPlayerMap(index)
    End If
    Call GenerateMap(index, map, patern)
    Exit Sub
    End If

    Call PlayerMsg(index, "This command does not exist. Please enter /map help for all commands.", 12)
    Else
    'Dit gebeurt er als je niets invult achter het commando
    Call PlayerMsg(index, "You need to enter a subcommand. Please enter /map help for all commands.", 12)
    End If
    Exit Sub
    End If

    Ok, now you installed the script. Now the fun is about to start :D.


    CONFIGURING THE SCRIPT


    Basics
    There are some words I am using in this script you need to know, these are:
    - Patern:
    The "type" of map you are going to make, for instance wood or meadow or forest. When done you will have a .ini file with 9 "paterns", every patern will when used generate a different type of map.
    - Ground:
    The "tyle" that is placed on the ground, for instance, in the "forest" patern you would select a normal grass tyle, or sumting.
    - Patches:
    Little extras that are randomly placed on the map, like flowers, patches are not blocked. Patches are placed as mask. They have a 1x1 size.
    - Solids:
    Little extras that are randomly placed on the map, like Stones, Solids are blocked. Solids are placed as mask. They have a 1x1 size.
    - Objects:
    Bigger extras that are randomly placed on the map, like trees. They have a configurable size and layer, and can contain both blocked and non-blocked tiles. All objects have the same layer, wich is customizable for every pattern (this is due to the fact that the mapgen needs to check if another object is already on a spot). Layer is usually fringe.
    - 2nd layer objects:
    Like objects, but on another layer, usually fringe2.
    - Likely
    How often a object/solid/patch etc is placed on a map, if the likely is 3, a random value around 3 of this thing is placed on the map. (in the case of 3, there are 1 - 5 placed, in the case of 2 there are 0 - 4 placed, etc).

    The .ini file, basic
    The mapgen script uses a .ini file called mapgenerator.ini. Create it in your server folder. Containing this info (at first):
    Code: [Select]
    [paternnames]
    1=Patername1
    2=Patername2
    3=Patername3
    4=Patername4
    5=Patername5
    6=Patername6
    7=Patername7
    8=Patername8
    9=Patername9

    The .ini file, ground/patch/solid.
    In this example, I'll be using the paternname called "Paternname1". So, if you are making a forest, replace "Paternname1" by "Forest", for example: "Paternname1Ground" -> "ForestGround". Use this for the ground tile:

    Code: [Select]
    [paternname1ground]
    groundset=0
    groundx=7
    groundy=3

    groundset=the tileset where the tile comes from.
    groundx=the x value of the tile you want to use as ground
    groundy=the y value of the tile you want to use as ground.

    As easy as that. Now, right below this, add:

    Code: [Select]
    patches=2
    solids=2
    patches=the total number of patches for this pattern
    solids=total number of solids for this pattern

    right below this, add:

    Code: [Select]
    patch1set=0
    patch1x=8
    patch1y=3
    patch1likely=3
    patch2set=0
    patch2x=9
    patch2y=3
    patch2likely=3
    patch1set=what tileset patch number 1 comes from
    patch1x=the x value of the patch tile. (in the tileset)
    patch1y= the y value of the patch tile. (in the tileset)
    patch1likely= the amount that is likely to be placed on the map, please look at "likely" in the basics section for more info about likely.
    patch2set=the tileset of patch number 2, etc....

    right below this, add:

    Code: [Select]
    solid1set=0
    solid1x=5
    solid1y=209
    solid1likely=3
    solid2set=0
    solid2x=6
    solid2y=209
    solid2likely=3
    And this works exactly the same as the patch thing.

    Well, this seems like an incredible amount of work, right. So I made it a little easyer for you guys (go me). Instead of doing all this yourself, you can use a command for this (I still recommend you to at least know how it works though), do the following.
    - Go to an empty map
    - Open the mapeditor
    - Use the MASK layer !!!!!! script will ignore ANY other layer
    - on x0 y0, place the ground tile you want.
    - on x0 x1-19 (the top row of your map, exept for the first tile), place all PATCHES you want, from LEFT to RIGHT, the script will abort the patches part when it finds an emtpy tile!
    - on x1 x0-19 (the 2nd row of your map), place all SOLIDS you want.
    - hit save
    - Use the folowing command:
    /putvars <paternnumber>
    ie: /putvars 1
    this will instantly make the .ini file for you!

    Objects
    For the objects, add this right below your solids and patches:
    Code: [Select]
    objects=0
    objectsb=2
    objectlayer=5
    object2layer=7
    objects= number of objects
    pbjectsb= number of 2nd layer objects
    object2layer= the layer of the 2nd layer objects (fringe 2 in this case)
    objectlayer= the layer of the objects


    Ok, I'm not even going to explain how the .ini stuff for every object works, all you need to know is that:
    Code: [Select]
    objectb1likely=2
    object1likely=2
    Objectb1likely=the likely of 2nd layer object 1
    Object1likely=the likely of object 1.
    That's all you need to edit in the .ini file, here's how to add objects:

    - Open mapeditor
    - Use MASK layer (!!!!!!!!)
    - Create the "object" you want, a tree, a house, whatever. And place it on the map. Starting on x0,y0. Then, use blocked on the tiles you want to make blocked, and hit save.
    - Use the folowing command:
    /putobject <paternnumber> <objectnumber> <width> <height>
    for instance, you got a tree, starting on x0,y0, ending at x3 y3, you now have with=4 and height =4. Due to a scripting error the counting of width and height starts at 1, not at 0.
    ie:
    /putobject 1 1 4 4
    this would save the current made object to object number 1 on patern 1 (in our example it's called PaternName1), the object is starting at x0,y0, and ending at x3,y3.

    For 2nd layer objects, it's exaclty the same, only instead of
    /putobject <paternnumber> <objectnumber> <width> <height>
    you use:
    /put2object <paternnumber> <objectnumber> <width> <height>

    The commands
    Ok, you have the folowing commands:
    /map save
    Saves your current map to a .ini file. Watch out, causes lag.
    /map load
    Loads the map from a .ini file, will overwrite everytihng, causes lag.
    /map gen <location> <paternnumber>
    Will generate a map, if configured correctly. ie:
    /map gen 001 1
    will generate patern 1 on map 1
    /map gen 010 1
    will generate patern 1 on map 10
    /map gen 010 9
    will generate patern 9 on map 10
    /map gen loc 3
    will generate patern 3 on your current map.

    Et voila, that should be around everything. Good luck figuring it out. And if I'm ever catching someone building a prefab game using this script I'm going to personnaly kill him/her (just jking, but please don't abuse this to build an ready-made game). A few more notes:

    - Please give me credit for this, mention me on your game site, ingame, whatever, idk, but anyway will do.
    - There is considerable time spent (40 hours, I counted them), please do not claim this to be your script, I WILL kill you for doing that.
    - I am not going to give any more help, follow this tutorial, it should explain everything.
    - Feel free to modify this script, but do not post it modified and then claim you made it.
    - Please do not distribute this outside the eclipse forum. (useless anyway, because it uses stuff only total eclipse and newer has)

    That should be everything. Good luck, this will be my last script for a big time, I hope you guys like this. Cya all in a few months, take care!

    Code: [Select]
    '*****************************************************************
    '*****************************************************************
    'XX This script has been created by Ilnair, aka Dinand Mentink  XX
    'XX Please do not give it out saying you made it, or distribute XX
    'XX it anywhere outside the Eclipse forums! Also, please always XX
    'XX distribute these credits along with the script! XX
    'XX           www.nishansu.tk       ©Dinand Mentink (aka Ilnair)XX
    '*****************************************************************
    '*****************************************************************


    Dinand Mentink (aka Ilnair Uber-Scriptor)

    Ps. Would any admin/mod mind stickying this one?
    pps. I'll be back, please look in the other topic on why I left, good luck yall.
    Ppps. Just a little note to my fellow scripters, no offence, but: p0wned!!!
    « Last Edit: January 19, 2007, 09:58:05 AM by Godlord » Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    October 15, 2006, 10:23:48 AM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    Sorry for the double post, but here, a mapgenerator.ini, for if you do not understand something. Copying this one is useless, because you'll use differnt tilesest than I do.

    http://www14.rapidupload.com/d.php?file=dl&filepath=4474
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    October 15, 2006, 10:25:40 AM
    Cake Supporter
    Global Moderator
    Teh Uberleet
    *
    User No : 1081
    Posts: 3806
  • 0 credits
  • View Inventory
  • Send Money To Ballie
    • View Profile
    OOoooo. This should be fun trying to figure this thing out. Sucks you can't stay. Hope you can still come around once in a while.

    Quote
    Ok, now you installed the script. Now the fun is about to start .

    Indeed...

    O_O! That's a long .ini. Heh, here goes.
    « Last Edit: October 15, 2006, 10:28:29 AM by OBJECT_SELF » Logged

    October 15, 2006, 10:26:22 AM
    ♥ Cake ♥
    Global Moderator
    Advanced Eclipser
    *
    User No : 251
    Posts: 1735
  • 72 credits
  • View Inventory
  • Send Money To Tylian!
    • View Profile
    This owns, I think ill sticky this.
    If anyone else thinks this shouldnt be stickied please remove the sticky.

    Also: I got pwned -.-
    Logged

    Real men use Eclipse Origins v1.1.0 to create their games!
    October 15, 2006, 10:27:54 AM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    I'll have a look every now and then. :)
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    October 15, 2006, 11:00:45 AM
    Cake Supporter
    Global Moderator
    Teh Uberleet
    *
    User No : 1081
    Posts: 3806
  • 0 credits
  • View Inventory
  • Send Money To Ballie
    • View Profile
    Heh, got it working. It's not that hard if you follow the tutorial/know what you're doing. Good job. Lots of commands to make the .ini process easier (That .ini was freakishly long; was afraid I was going to have to type the variables out).

    The script rocks. The only limitation is the user. :P
    Logged

    October 15, 2006, 09:34:52 PM
    Veteran
    Advanced Eclipser
    *
    User No : 192
    Posts: 1600
  • 120 credits
  • View Inventory
  • Send Money To Bobosk
    • View Profile
    This thing rocks... just ermm.. a few notes for people trying to use this script:
    1. either change
    Quote
          map = Mid(TextSay, 6, 3)
    to
    Quote
          map = Mid(TextSay, 6, 1)
    or alway be on the map you want to generate and type /map gen loc <pattern #>
    ~~~~~~
    2.~~forgot xD I hate it when that happens.. anyways great script! but I guess you just "pooned" use mappers too, cause now we're outta a job
    Logged
    October 15, 2006, 09:40:17 PM
    DFAx
    Guest
    This thing rocks... just ermm.. a few notes for people trying to use this script:
    1. either change
    Quote
          map = Mid(TextSay, 6, 3)
    to
    Quote
          map = Mid(TextSay, 6, 1)
    or alway be on the map you want to generate and type /map gen loc <pattern #>
    ~~~~~~
    2.~~forgot xD I hate it when that happens.. anyways great script! but I guess you just "pooned" use mappers too, cause now we're outta a job

    na, machines lack creativitiy to the max
    humans can still produce maps 100x better....
    Logged
    October 15, 2006, 10:08:48 PM
    Administrator
    Demi God
    *
    User No : 141
    Posts: 5001
  • 48 credits
  • View Inventory
  • Send Money To unnown
  • -Admin-
    • View Profile
    'Dit gebeurt er als je niets invult achter het commando

    lol goew gedaan hoor ;D

    sad to see you leaving :'(
    Logged

    thinks godlord is an crazy dutchie :D
    October 15, 2006, 11:03:14 PM
    Lord Of Spleens
    Administrator
    Teh Uberleet
    *
    User No : 166
    Posts: 2951
  • 0 credits
  • View Inventory
  • Send Money To Baron
  • Location : Australia
    Badges? We dont need no stinkin' badges!
    • View Profile
    Goddam man.... you made this a lot more complicated then it really needed to have been :(

    If I may make a suggestion for anyone attempting to use this, I HIGHLY recommend building a script to automatically configure the ini's the world is built from.
    Logged


    Apparently ICT thinks that:
    [ 98% of Eclipse forums thinks baron is cool. Put this in your signature if you are on of the 2% that knows he's an asshôle ]

    If I'm only pissing 1 in 50 people off, I don't think that is too bad at all :D
    October 16, 2006, 05:59:27 AM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    I already made that script, it's in the command thing. It doesn't do all the work, but like 98% it does, you have to edit the other 2% for a bit.

    And bobosk. No need to, but instead of using /map gen 1 1, you should use /map gen 001 1, that should work.
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    October 16, 2006, 10:36:21 AM
    Veteran
    Advanced Eclipser
    *
    User No : 192
    Posts: 1600
  • 120 credits
  • View Inventory
  • Send Money To Bobosk
    • View Profile
    yea I remembered that after I went to bed last night :\ anyhow, great script
    Logged
    October 16, 2006, 12:37:15 PM
    ♥ Cake ♥
    Global Moderator
    Advanced Eclipser
    *
    User No : 251
    Posts: 1735
  • 72 credits
  • View Inventory
  • Send Money To Tylian!
    • View Profile
    'Dit gebeurt er als je niets invult achter het commando

    lol goew gedaan hoor ;D

    sad to see you leaving :'(


    English please... Translater technology has only come so far...
    Logged

    Real men use Eclipse Origins v1.1.0 to create their games!
    October 19, 2006, 05:50:51 AM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    Ah, that's just useless. 'Dit gebeurt er als je niets invult achter het commando. That's a part in the script that's just there for me to know what it does, it means sumething like"this happenes if you don't add anything after the command". Lol goew gedaan hoor = Good job.


    Anyone already finished a map with this thing? I would like to see some screenies.
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    October 19, 2006, 06:23:46 AM
    Global Moderator
    Demi God
    *
    User No : 1712
    Posts: 6821
  • 1292 credits
  • View Inventory
  • Send Money To Stephan
    • View Profile
    I don't know...  :-\ I make the maps by myself but good job for making this...
    Logged


    • I do not provide help through the PM-system, e-mail, Skype or MSN, since this is kind of disturbing. I encourage you to make a new topic with proper spelling and grammar in the appropriate board instead, if possible.
    • I can't stand people who act like if they were children, so please don't.
    • I recommend you to read the rules before posting. It might solve conflicts before they actually occur.
    • I also recommend you to find the solution yourself before making a new topic about your issue. Chances are that other people had the same issue as well.
    October 19, 2006, 01:40:47 PM
    ♥ Cake ♥
    Global Moderator
    Advanced Eclipser
    *
    User No : 251
    Posts: 1735
  • 72 credits
  • View Inventory
  • Send Money To Tylian!
    • View Profile
    I tried it and it works..
    The map is pritty bare tho so ill get a better screenie later =p
    Logged

    Real men use Eclipse Origins v1.1.0 to create their games!
    October 23, 2006, 08:57:08 AM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    ok, looking forward to some results :).
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    October 23, 2006, 09:14:15 AM
    Global Moderator
    Demi God
    *
    User No : 1712
    Posts: 6821
  • 1292 credits
  • View Inventory
  • Send Money To Stephan
    • View Profile
    ok, looking forward to some results :).
    Me too  ;D
    Logged


    • I do not provide help through the PM-system, e-mail, Skype or MSN, since this is kind of disturbing. I encourage you to make a new topic with proper spelling and grammar in the appropriate board instead, if possible.
    • I can't stand people who act like if they were children, so please don't.
    • I recommend you to read the rules before posting. It might solve conflicts before they actually occur.
    • I also recommend you to find the solution yourself before making a new topic about your issue. Chances are that other people had the same issue as well.
    October 31, 2006, 01:17:12 PM
    Leader of the Society Of Flaws
    Member
    **
    User No : 1574
    Posts: 52
  • 0 credits
  • View Inventory
  • Send Money To Shadow Master
    • View Profile
    Yes nice does very well it works fine tho it coukd have made it easy for the noob scripters tho.

    P.S. What happened to your game Ilnair?
    Logged

    If u are a host I need u for a great game in produtcion we are hoping tobe a great success pm if u can host the game and u can tell em what u want and want wil go on in the game.
    October 31, 2006, 10:25:55 PM
    The Uber-Scriptor
    Advanced Member
    ****
    User No : 375
    Posts: 590
  • 0 credits
  • View Inventory
  • Send Money To Ilnair
  • Location : Netherlands, The
    The Uber-Scriptor
    • View Profile
    • WWW
    I never made this to be usefull for noob scriptors to build a prefab game, it already was hard enough to make anyway.

    p.s. Still exists, still working on it, just taking little brake.
    Logged

    Ilnair
    Uber-Scriptor

    Nishansu, beta testing. Have a look at http://www.nishansu.com
    Pages: [1] 2 3
     


    Powered by MySQL Powered by PHP Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
    SimplePortal 2.3.1 © 2008-2009, SimplePortal
    Valid XHTML 1.0! Valid CSS!
    Page created in 0.449 seconds with 30 queries.