[Request] Just strip the map camera code from xmap.

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
FireSeraphim
Dolphin
Dolphin
Posts: 84
Joined: Wed Apr 16, 2014 4:21 pm
Flair: Verified Professional Vampire Hunter
Contact:

[Request] Just strip the map camera code from xmap.

Postby FireSeraphim » Sat Jul 13, 2024 1:25 am

I would be deeply indebted to the person who can strip the camera code from xmap and just the camera code so I can use it in my worldmaps because I'm sick and tired of fighting camlock and xmap is too complicated to implement at this stage. Especially since Xmap hates organized graphics folders

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9775
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: [Request] Just strip the map camera code from xmap.

Postby Emral » Sat Jul 13, 2024 3:05 am

I'm not buying this "stripping xmap cam code magically fixes everything" stuff. You should leave the decision making on what solution to go with to people who know how to code.
Instead of asserting some fictional solution, please properly post your wrong code, what you tried, what you see when you try it and how it differs from your goal. That way people can actually help you.

deice
Volcano Lotus
Volcano Lotus
Posts: 566
Joined: Fri Jul 23, 2021 7:35 am

Re: [Request] Just strip the map camera code from xmap.

Postby deice » Sat Jul 13, 2024 8:23 am

you can minimize the amount of things xmap handles by only importing chocomap instead of the full xmap library. that way, you'll only use the lua overworld rendering and the camera zones
also, xmap doesn't "hate organized graphics folders", it loads images using the same file resolution method that the base game does. if you're having an issue with a graphic, it's either an issue that would also appear without xmap, or you're using legacy gif graphics which xmap doesn't support (but you can convert them using gifs2png which should still be bundled with your smbx2 installation)

FireSeraphim
Dolphin
Dolphin
Posts: 84
Joined: Wed Apr 16, 2014 4:21 pm
Flair: Verified Professional Vampire Hunter
Contact:

Re: [Request] Just strip the map camera code from xmap.

Postby FireSeraphim » Sat Jul 13, 2024 12:36 pm

@Deice: every graphic I'm using is a .PNG and I store and load my lua files in a organized lua folder as well. The map related functionality of my episode is stored in /lunalua/map/ and if your claims are correct then xmap doesn't like being loaded from my more organized lua folder. Do you have a discord account by the way? Be much easier to speak to you over discord.


Image
This is the aneurysm it throws when I try to load chocomap from /lunalua/map/ in a sane and organized manner.

and to be sure, I do infact have the required files in the right place and the code should work but it doesn't
Image
Image

Added in 14 minutes 6 seconds:
Image
Two steps forward, a hundred steps back. fixed the directory mismatch but it seems have throw out everything else that was coded for the worldmap system.

Added in 3 minutes 5 seconds:
Image
Oh no, oh no. It's seems like it has thrown everything including the camera code out. Houston, we have a problem!

deice
Volcano Lotus
Volcano Lotus
Posts: 566
Joined: Fri Jul 23, 2021 7:35 am

Re: [Request] Just strip the map camera code from xmap.

Postby deice » Sat Jul 13, 2024 4:18 pm

libraries you intend to use globally should be placed inside your episode folder (along with your map.lua file in this case) and required by name only. i'm fairly certain that the lunalua specification does not guarantee any other arrangement to work. require is not your run-of-the-mill "load this file" function and relying on relative paths is far from best practice when using it.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9775
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: [Request] Just strip the map camera code from xmap.

Postby Emral » Sun Jul 14, 2024 3:03 am

May I also see your camlock code from your prior approach? Fixing that seems very simple and figuring out the issue might help you understand how to use it in the future.

FireSeraphim
Dolphin
Dolphin
Posts: 84
Joined: Wed Apr 16, 2014 4:21 pm
Flair: Verified Professional Vampire Hunter
Contact:

Re: [Request] Just strip the map camera code from xmap.

Postby FireSeraphim » Sun Jul 14, 2024 12:34 pm

My Map.Lua (I have since commented out the chocomap code for now)

Code: Select all

---- Costume Fixes ----
Player.setCostume(CHARACTER_MARIO,"Accurate-SMW-Mario",true)
Player.setCostume(CHARACTER_LUIGI,"Accurate-SMW-Luigi",true)
Player.setCostume(CHARACTER_TOAD,"Accurate-SMW-Toad",true)
Player.setCostume(CHARACTER_WARIO,"SMW-Wario",true)

---- Map Fixes ----
local playerManager = require ("playermanager")
playerManager.overworldCharacters = {CHARACTER_MARIO, CHARACTER_LUIGI, CHARACTER_TOAD, CHARACTER_WARIO}

local travL = require ("travL")
travL.showArrows = false  --this is disabled until camlock and travL compatibility is fixed--

local wandR = require ("wandR")
wandR.speed = 5

local mapBorder = require ("lunalua/map/mapBorder")

local map_trans_index = require("lunalua/map/map_trans_index")

---- Experimental Tweaks ----
--local handycam = require("handycam") handycam[1].zoom = 1.25

local pausemenu13 = require ("lunalua/gameplay/pausemenu13")

local jukebox_master = require ("lunalua/map/jukebox_master")

---- Camlock ----
local camlock_master = require("lunalua/map/camlock_master")


--local chocoMap = require ("lunalua/map/chocomap")

--local zones = {

--{-512, 2432, 960, 728, 1.0},--mint island--
--{-3072, 1952, 1408, 1216, 1.0},--lake shroomperior (hub world 1)--
--{2208, 2400, 1056, 1152, 1.0},--DK Island--
--{-2304, 576, 1200, 864, 1.0},--shipbreaker slough-- 
--{2240, 448, 1600, 1216, 1.0},--relic ravine--
--{-1056, 320, 960, 1216, 1.0},--cursed cryptlands--
--{68, 1280, 960, 892, 1.0},--wario's island--
--{64, -832, 1920, 1312, 1.0},--lost world--
--{-1568, 2432, 1024, 832, 1.0},--Chthonic Crossroads (hub world 2)--
--{-608, 3872, 992, 416, 1.0},--Mushroom Metropolis-- 
--{-3104, 3552, 1504, 4768, 1.0},--Dreamtartica--
--}
My camlock code, which I have moved to a separate file but has remained otherwise unaltered

Code: Select all

local camLock = require("camLock")

camLock.addZone(-512, 2432, 960, 728, 1.0)--mint island
camLock.addZone(-3072, 1952, 1408, 1216, 1.0)--lake shroomperior (hub world 1)
camLock.addZone(2208, 2400, 1056, 1152, 1.0)--DK Island 
camLock.addZone(-2304, 576, 1200, 864, 1.0)--shipbreaker slough
camLock.addZone(2240, 448, 1600, 1216, 1.0)--relic ravine
camLock.addZone(-1056, 320, 960, 1216, 1.0)--cursed cryptlands
camLock.addZone(68, 1280, 960, 892, 1.0) --wario's island
camLock.addZone(64, -832, 1920, 1312, 1.0) --lost world
camLock.addZone(-1568, 2432, 1024, 832, 1.0) --Chthonic Crossroads (hub world 2)
camLock.addZone(-672, 3744, 1120, 608, 6.0) --Mushroom Metropolis

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9775
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: [Request] Just strip the map camera code from xmap.

Postby Emral » Sun Jul 14, 2024 6:19 pm

Okay and which one of those is faulty? I downloaded your demo and they look to be working just fine?

FireSeraphim
Dolphin
Dolphin
Posts: 84
Joined: Wed Apr 16, 2014 4:21 pm
Flair: Verified Professional Vampire Hunter
Contact:

Re: [Request] Just strip the map camera code from xmap.

Postby FireSeraphim » Mon Jul 15, 2024 7:36 pm

@emral: this code is from my latest ongoing dev build and I redesigned Mushroom City again. that's the one at fault.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari