Jump to content

RingoD123

The Indie Stone
  • Posts

    449
  • Joined

  • Last visited

Posts posted by RingoD123

  1. 50 minutes ago, Urbs said:

    I've created a really simple map just to test everything out. I've went through this tutorial and got everything working except actually being able to spawn into my own map in-game.

     

    Here's the repository of my mod: https://github.com/Urbs97/ProjectZomboidTestMap

    And as an attachment the finished mod I'm using that is the result of generating lots with the repository I've linked.

     

    The mod is loaded:
    image.png.b168dfbc2bed3167540113052599db87.png

    But I can only choose the vanilla spawns:
    image.png.4528eb1f34c542577ee8bb8b0d1a4c17.png

     

    Those are the contents of my map.info which you can also look up in the repository and fork the project if you like:

    title=Hello World Map
    lots=Muldraugh, KY
    description=My description
    fixed2x=true

    I've tried different "lots" (even the mod name) and also removing it. The result is always the same.

    In case more information is needed I will try to answer as soon as possible in this thread.

    Thank you for your time.

    MyMapMod.zip 420.75 kB · 0 downloads

     

    You have forgotten the final folder inside of the "maps" folder, as per the guide:

     

    OK now you have all of the files you need to test your map in game, so lets go ahead and do that. First, create a new folder on your desktop (or somehwere easily accesible) and give it a name (e.g. MyMapMod), inside create another folder called media, inside there create a 3rd folder called maps and then inside there, create a final folder called MyMapMod (or whatever the name of your map is). Inside this final folder is where you want to put all of the .lotheader, .lotpack and .bin files that were created when you generated the lots for your map, as well as the spawnpoints.lua file and and objects.lua (dont worry about this for now, you will create one when you add foraging zones later).

     

    You remove the "lots=Muldraugh, KY" line from your map.info file if you want your map to not be connected to the vanilla map.

  2. If you want you can subscribe to and download Bedford Falls on steam workshop, if you then add this file:

    bedfordstashdescriptions.lua

    to its "media/lua/shared/StashDescriptions" folder it will enable the test stashes from the original post of this thread and using the methods in the guides. Might be helpful in checking folder/file structure etc.

    You can then load the game in debug mode (-debug in the launch options on steam), when in game select the debug menu, then the "dev" box at the top and then stash debugger, you can then select any Bedford Falls (or vanilla) stash map and click spawn, you will be teleported to the building and the stash will be populated. Obviously will also come in handy for testing your own too.

    You can also press F8 when in game in debug mode to bring up the map debugger, you can use this to load and see what each map/stash maps shows.

  3. 1 hour ago, TheoryOfMadness said:

     

     

      Hide contents

     

     


    require "ISMapDefinitions"

    local MINZ = 0
    local MAXZ = 24

    local WATER_TEXTURE = false

    local function replaceWaterStyle(mapUI)
        if not WATER_TEXTURE then return end
        local mapAPI = mapUI.javaObject:getAPIv1()
        local styleAPI = mapAPI:getStyleAPI()
        local layer = styleAPI:getLayerByName("water")
        if not layer then return end
        layer:setMinZoom(MINZ)
        layer:setFilter("water", "river")
        layer:removeAllFill()
        layer:removeAllTexture()
        layer:addFill(MINZ, 59, 141, 149, 255)
        layer:addFill(MAXZ, 59, 141, 149, 255)
    end

    local function overlayPNG(mapUI, x, y, scale, layerName, tex, alpha)
        local texture = getTexture(tex)
        if not texture then return end
        local mapAPI = mapUI.javaObject:getAPIv1()
        local styleAPI = mapAPI:getStyleAPI()
        local layer = styleAPI:newTextureLayer(layerName)
        layer:setMinZoom(MINZ)
        layer:addFill(MINZ, 255, 255, 255, (alpha or 1.0) * 255)
        layer:addTexture(MINZ, tex)
        layer:setBoundsInSquares(x, y, x + texture:getWidth() * scale, y + texture:getHeight() * scale)
    end

    LootMaps.Init.IScn_Stash_Rosewood = function(mapUI)
        local mapAPI = mapUI.javaObject:getAPIv1()
        MapUtils.initDirectoryMapData(mapUI, 'media/maps/Muldraugh, KY')
        MapUtils.initDefaultStyleV1(mapUI)
        replaceWaterStyle(mapUI)
        mapAPI:setBoundsInSquares(7900, 11140, 8604, 12139)
        overlayPNG(mapUI, 7958, 11962, 0.666, "badge", "media/textures/worldMap/RosewoodBadge.png")
        overlayPNG(mapUI, 8213, 11161, 0.666, "legend", "media/textures/worldMap/Legend.png")
        MapUtils.overlayPaper(mapUI)
    --    overlayPNG(mapUI, 26*300+100, 37*300+30, 0.666, "lootMapPNG", "media/ui/LootableMaps/rosewoodmap.png", 0.5)
    end
     

     

     

    The above file should look like this:

     

     

     

     


    require "ISMapDefinitions"

     

    MapUtils = {}

     

    function MapUtils.initDirectoryMapData(mapUI, directory)
        local mapAPI = mapUI.javaObject:getAPIv1()
        local file = directory..'/worldmap-forest.xml'
        if fileExists(file) then
            mapAPI:addData(file)
        end
        file = directory..'/worldmap.xml'
        if fileExists(file) then
            mapAPI:addData(file)
        end

        -- This call indicates the end of XML data files for the directory.
        -- If map features exist for a particular cell in this directory,
        -- then no data added afterwards will be used for that same cell.
        mapAPI:endDirectoryData()

     

        mapAPI:addImages(directory)
    end

     

    function MapUtils.initDefaultMapData(mapUI)
        local mapAPI = mapUI.javaObject:getAPIv1()
        mapAPI:clearData()
        -- Add data from highest priority (mods) to lowest priority (vanilla)
        local dirs = getLotDirectories()
        for i=1,dirs:size() do
            MapUtils.initDirectoryMapData(mapUI, 'media/maps/'..dirs:get(i-1))
        end
    end

     

    local MINZ = 0
    local MAXZ = 24

     

    local WATER_TEXTURE = false

     

    function MapUtils.initDefaultStyleV1(mapUI)
        local mapAPI = mapUI.javaObject:getAPIv1()
        local styleAPI = mapAPI:getStyleAPI()

     

        local r,g,b = 219/255, 215/255, 192/255
        mapAPI:setBackgroundRGBA(r, g, b, 1.0)
        mapAPI:setUnvisitedRGBA(r * 0.915, g * 0.915, b * 0.915, 1.0)
        mapAPI:setUnvisitedGridRGBA(r * 0.777, g * 0.777, b * 0.777, 1.0)

     

        styleAPI:clear()

     

        local layer = styleAPI:newPolygonLayer("forest")
        layer:setMinZoom(13.5)
        layer:setFilter("natural", "forest")
        if true then
            layer:addFill(MINZ, 189, 197, 163, 0)
            layer:addFill(13.5, 189, 197, 163, 0)
            layer:addFill(14, 189, 197, 163, 255)
            layer:addFill(MAXZ, 189, 197, 163, 255)
        else
            layer:addFill(MINZ, 255, 255, 255, 255)
            layer:addFill(MAXZ, 255, 255, 255, 255)
            layer:addTexture(MINZ, "media/textures/worldMap/Grass.png")
            layer:addTexture(MAXZ, "media/textures/worldMap/Grass.png")
            layer:addScale(13.5, 4.0)
            layer:addScale(MAXZ, 4.0)
        end
        
        layer = styleAPI:newPolygonLayer("water")
        layer:setMinZoom(MINZ)
        layer:setFilter("water", "river")
        if not WATER_TEXTURE then
            layer:addFill(MINZ, 59, 141, 149, 255)
            layer:addFill(MAXZ, 59, 141, 149, 255)
        else
            layer:addFill(MINZ, 59, 141, 149, 255)
            layer:addFill(14.5, 59, 141, 149, 255)
            layer:addFill(14.5, 255, 255, 255, 255)
            layer:addTexture(MINZ, nil)
            layer:addTexture(14.5, nil)
            layer:addTexture(14.5, "media/textures/worldMap/Water.png")
            layer:addTexture(MAXZ, "media/textures/worldMap/Water.png")
    --        layer:addScale(MINZ, 4.0)
    --        layer:addScale(MAX, 4.0)
        end

     

        layer = styleAPI:newPolygonLayer("road-trail")
        layer:setMinZoom(12.0)
        layer:setFilter("highway", "trail")
        layer:addFill(12.25, 185, 122, 87, 0)
        layer:addFill(13, 185, 122, 87, 255)
        layer:addFill(MAXZ, 185, 122, 87, 255)

     

        layer = styleAPI:newPolygonLayer("road-tertiary")
        layer:setMinZoom(11.0)
        layer:setFilter("highway", "tertiary")
        layer:addFill(11.5, 171, 158, 143, 0)
        layer:addFill(13, 171, 158, 143, 255)
        layer:addFill(MAXZ, 171, 158, 143, 255)

     

        layer = styleAPI:newPolygonLayer("road-secondary")
        layer:setMinZoom(11.0)
        layer:setFilter("highway", "secondary")
        layer:addFill(MINZ, 134, 125, 113, 255)
        layer:addFill(MAXZ, 134, 125, 113, 255)

     

        layer = styleAPI:newPolygonLayer("road-primary")
        layer:setMinZoom(11.0)
        layer:setFilter("highway", "primary")
        layer:addFill(MINZ, 134, 125, 113, 255)
        layer:addFill(MAXZ, 134, 125, 113, 255)

     

        layer = styleAPI:newPolygonLayer("railway")
        layer:setMinZoom(14.0)
        layer:setFilter("railway", "*")
        layer:addFill(MINZ, 200, 191, 231, 255)
        layer:addFill(MAXZ, 200, 191, 231, 255)

     

        -- Default, same as building-Residential
        layer = styleAPI:newPolygonLayer("building")
        layer:setMinZoom(13.0)
        layer:setFilter("building", "yes")
        layer:addFill(13.0f, 210, 158, 105, 0)
        layer:addFill(13.5f, 210, 158, 105, 255)
        layer:addFill(MAXZ, 210, 158, 105, 255)

     

        layer = styleAPI:newPolygonLayer("building-Residential")
        layer:setMinZoom(13.0)
        layer:setFilter("building", "Residential")
        layer:addFill(13.0f, 210, 158, 105, 0)
        layer:addFill(13.5f, 210, 158, 105, 255)
        layer:addFill(MAXZ, 210, 158, 105, 255)

     

        layer = styleAPI:newPolygonLayer("building-CommunityServices")
        layer:setMinZoom(13.0)
        layer:setFilter("building", "CommunityServices")
        layer:addFill(13.0f, 139, 117, 235, 0)
        layer:addFill(13.5f, 139, 117, 235, 255)
        layer:addFill(MAXZ, 139, 117, 235, 255)

     

        layer = styleAPI:newPolygonLayer("building-Hospitality")
        layer:setMinZoom(13.0)
        layer:setFilter("building", "Hospitality")
        layer:addFill(13.0f, 127, 206, 225, 0)
        layer:addFill(13.5f, 127, 206, 225, 255)
        layer:addFill(MAXZ, 127, 206, 225, 255)

     

        layer = styleAPI:newPolygonLayer("building-Industrial")
        layer:setMinZoom(13.0)
        layer:setFilter("building", "Industrial")
        layer:addFill(13.0f, 56, 54, 53, 0)
        layer:addFill(13.5f, 56, 54, 53, 255)
        layer:addFill(MAXZ, 56, 54, 53, 255)

     

        layer = styleAPI:newPolygonLayer("building-Medical")
        layer:setMinZoom(13.0)
        layer:setFilter("building", "Medical")
        layer:addFill(13.0f, 229, 128, 151, 0)
        layer:addFill(13.5f, 229, 128, 151, 255)
        layer:addFill(MAXZ, 229, 128, 151, 255)

     

        layer = styleAPI:newPolygonLayer("building-RestaurantsAndEntertainment")
        layer:setMinZoom(13.0)
        layer:setFilter("building", "RestaurantsAndEntertainment")
        layer:addFill(13.0f, 245, 225, 60, 0)
        layer:addFill(13.5f, 245, 225, 60, 255)
        layer:addFill(MAXZ, 245, 225, 60, 255)

     

        layer = styleAPI:newPolygonLayer("building-RetailAndCommercial")
        layer:setMinZoom(13.0)
        layer:setFilter("building", "RetailAndCommercial")
        layer:addFill(13.0f, 184, 205, 84, 0)
        layer:addFill(13.5f, 184, 205, 84, 255)
        layer:addFill(MAXZ, 184, 205, 84, 255)
    end

     

    function MapUtils.overlayPaper(mapUI)
        local mapAPI = mapUI.javaObject:getAPIv1()
        local styleAPI = mapAPI:getStyleAPI()
        local layer = styleAPI:newTextureLayer("paper")
        layer:setMinZoom(0.00)
        local x1 = mapAPI:getMinXInSquares()
        local y1 = mapAPI:getMinYInSquares()
        local x2 = mapAPI:getMaxXInSquares() + 1
        local y2 = mapAPI:getMaxYInSquares() + 1
        layer:setBoundsInSquares(x1, y1, x2, y2)
        layer:setTile(true)
        layer:setUseWorldBounds(true)
        layer:addFill(14.00, 128, 128, 128, 0)
        layer:addFill(15.00, 128, 128, 128, 32)
        layer:addFill(15.00, 255, 255, 255, 32)
        layer:addTexture(0.00, "media/white.png")
        layer:addTexture(15.00, "media/white.png")
        layer:addTexture(15.00, "media/textures/worldMap/Paper.png")
    end

     

    function MapUtils.revealKnownArea(mapUI)
        local mapAPI = mapUI.javaObject:getAPIv1()
        local x1 = mapAPI:getMinXInSquares()
        local y1 = mapAPI:getMinYInSquares()
        local x2 = mapAPI:getMaxXInSquares()
        local y2 = mapAPI:getMaxYInSquares()
        WorldMapVisited.getInstance():setKnownInSquares(x1, y1, x2, y2)
    end

    -----

     

    local function replaceWaterStyle(mapUI)
        if not WATER_TEXTURE then return end
        local mapAPI = mapUI.javaObject:getAPIv1()
        local styleAPI = mapAPI:getStyleAPI()
        local layer = styleAPI:getLayerByName("water")
        if not layer then return end
        layer:setMinZoom(MINZ)
        layer:setFilter("water", "river")
        layer:removeAllFill()
        layer:removeAllTexture()
        layer:addFill(MINZ, 59, 141, 149, 255)
        layer:addFill(MAXZ, 59, 141, 149, 255)
    end

     

    local function overlayPNG(mapUI, x, y, scale, layerName, tex, alpha)
        local texture = getTexture(tex)
        if not texture then return end
        local mapAPI = mapUI.javaObject:getAPIv1()
        local styleAPI = mapAPI:getStyleAPI()
        local layer = styleAPI:newTextureLayer(layerName)
        layer:setMinZoom(MINZ)
        layer:addFill(MINZ, 255, 255, 255, (alpha or 1.0) * 255)
        layer:addTexture(MINZ, tex)
        layer:setBoundsInSquares(x, y, x + texture:getWidth() * scale, y + texture:getHeight() * scale)
    end

     

    local function overlayPNG2(mapUI, x, y, scaleX, scaleY, tex)
        local mapAPI = mapUI.javaObject:getAPIv1()
        local styleAPI = mapAPI:getStyleAPI()
        local layer = styleAPI:newTextureLayer("lootMapPNG")
        layer:setMinZoom(MINZ)
        local texture = getTexture(tex)
        layer:addFill(MINZ, 255, 255, 255, 128)
        layer:addTexture(MINZ, tex)
        layer:setBoundsInSquares(x, y, x + texture:getWidth() * scaleX, y + texture:getHeight() * scaleY)
    end

    -- -- -- -- --

     

    LootMaps.Init.IScn_Stash_Rosewood = function(mapUI)
        local mapAPI = mapUI.javaObject:getAPIv1()
        MapUtils.initDirectoryMapData(mapUI, 'media/maps/Muldraugh, KY')
        MapUtils.initDefaultStyleV1(mapUI)
        replaceWaterStyle(mapUI)
        mapAPI:setBoundsInSquares(7900, 11140, 8604, 12139)
        overlayPNG(mapUI, 7958, 11962, 0.666, "badge", "media/textures/worldMap/RosewoodBadge.png")
        overlayPNG(mapUI, 8213, 11161, 0.666, "legend", "media/textures/worldMap/Legend.png")
        MapUtils.overlayPaper(mapUI)
    --    overlayPNG(mapUI, 26*300+100, 37*300+30, 0.666, "lootMapPNG", "media/ui/LootableMaps/rosewoodmap.png", 0.5)
    end
     

     

     

    as per the lootable map guide:

     

  4. If cars have stopped spawning then your mod has an error in the objects.lua file.

    When the game finds an error in the objects.lua it stops processing all other objects listed after it in the file.

    .bak files are simply backup copies and not used by the game or by tilzed/worlded.

     

    For your main issue you would be better off adding the extra cells to your map mod world in worlded and then creating the actual cell containing the rest of bridge, that way the game knows that everything that is being loaded is part of your mod and will properly be able to overwrite vanilla stuff as it should, it will also make any errors a lot easier to find.

  5. 16 hours ago, BastionViktus said:

    What should I do in the instance World Edit won't let me use .png or .bmg files? Only will let me select .pzw files (when I have none)

    Create a new blank world and make your images bmp files, then use the "maps" window on the right hand side of the screen to navigate to your bmp's (you must have your base and your veg bmps in the same folder and named correctly) and then drag your base bmp over your blank world cells.

  6. 30 minutes ago, LandonPlays said:

    Yes my roof is on level 2 and no I used tile mode.

    Then i'm guessing you didnt add the roof tiles to the roof layer.

    Using the roof tool in iso mode will automatically place things on the correct layers.

  7. 13 hours ago, LandonPlays said:

    I need help! I have been trying to place down anything in build editor and I have tried everything but nothing has worked! All the tools in the tab are not working! The door tool dose not work, the window tool dose not work, and the furniture tool dose not work! The only thing that I can do is place walls. Someone please help me!

    Screenshot 2023-06-15 220014.png

     

    You need to press "o" on your keyboard or click on view and tick "show object shapes", you will then have all functionality back

  8. If your mod works in single player then it should work in multiplayer unless you are setting up your server incorrectly.

    The XML and XML.BIN files should be called worldmap.xml and worldmap.xml.bin

    Check the games logs for any errors.

×
×
  • Create New...