Mod Loader [Now Has Hub World!]
Mari0 Mod Loader
Download:http://www.mediafire.com/download.php?4sp7t3ue2k62cua
Warning: I take no responsibility for anything this or mods made for this do to your computer. This is not sandboxed. You have been warned.
Warning two: If you use this you won't be able to use turtle95's character loader. To fix this simply delete your options.txt file.
Have you ever wanted to add a mod to you mappack but didn't because you didn't want any potential players to have to download another custom mari0 executable. Well no longer! This mod loader won't completely eliminate that problem but it will allow all mods to be run from the mappack, and by extension not from a custom love.
To make mods for this simply
1. make your mod
2. place the modified lua/s in your mappack's folder.
3. If there is more than one lua, make a new lua that launches all the other luas name it loadmod.lua and place it in your mappack's folder.
4. If there is more than one lua, copy the original vanilla luas to your mappack's folder changing their names as necessary and make a new lua named unloadmod.lua that loads them and place it in your mappack's folder
5. If there is only one lua, rename it loadmod.lua
6. If there is only one lua, copy the original unmodded lua and paste it in your mappack's folder under the new name of unloadmod.lua
7. Bam! Your done!
Download:http://www.mediafire.com/download.php?4sp7t3ue2k62cua
Warning: I take no responsibility for anything this or mods made for this do to your computer. This is not sandboxed. You have been warned.
Warning two: If you use this you won't be able to use turtle95's character loader. To fix this simply delete your options.txt file.
Have you ever wanted to add a mod to you mappack but didn't because you didn't want any potential players to have to download another custom mari0 executable. Well no longer! This mod loader won't completely eliminate that problem but it will allow all mods to be run from the mappack, and by extension not from a custom love.
To make mods for this simply
1. make your mod
2. place the modified lua/s in your mappack's folder.
3. If there is more than one lua, make a new lua that launches all the other luas name it loadmod.lua and place it in your mappack's folder.
4. If there is more than one lua, copy the original vanilla luas to your mappack's folder changing their names as necessary and make a new lua named unloadmod.lua that loads them and place it in your mappack's folder
5. If there is only one lua, rename it loadmod.lua
6. If there is only one lua, copy the original unmodded lua and paste it in your mappack's folder under the new name of unloadmod.lua
7. Bam! Your done!
Last edited by ucenna on 05 May 2013, 01:52, edited 16 times in total.
It's doable, but you need to learn to code.
Like, you put something like this:
In game_load().(You can override vanilla functions from here)
Problem: you can't restore functions, but when quitting the game, we could do something like
Where "unloadmod.lua" restore the default functions.
The problem is that it's not sandboxed.
Like, you put something like this:
Code: Select all
if love.filesystem.exists('mappacks/'..mappackname..'/mod.lua')then
love.filesystem.load('mappacks/'..mappackname..'/mod.lua')()
end
Problem: you can't restore functions, but when quitting the game, we could do something like
Code: Select all
if love.filesystem.exists('mappacks/'..mappackname..'/unloadmod.lua')then
love.filesystem.load('mappacks/'..mappackname..'/unloadmod.lua')()
end
The problem is that it's not sandboxed.
Doesn't seem to hard. If I understand correctly the first section'll check and load the mod. What if it finds an loads a mod? Will I have to prevent it from loading the default then?
Edit: I changed you first code to this:
Now if the mappack has a custom editor.lua it loads it, (hangs a bit when it boots though...) Success! Now I just need to repeat this 50 more times with slight variation and I'll be done! Thanks!
Does that mean I can't force it to load the default .lua if I loaded a modded one?Problem: you can't restore functions, but when quitting the game, we could do something like
I don't entirely understand what sandboxing is but is it really necessary?The problem is that it's not sandboxed.
Edit: I changed you first code to this:
Code: Select all
if love.filesystem.exists('mappacks/'..mappack..'/editor.lua')then
love.filesystem.load('mappacks/'..mappack..'/editor.lua')()
end
No, because the default files are loaded before the mappack is opened, and the default functions get overriden anyways.Doesn't seem to hard. If I understand correctly the first section'll check and load the mod. What if it finds an loads a mod? Will I have to prevent it from loading the default then?
Sandboxing mean that you keep the mod from doing "bad" things like deleting files, etc.(A mod can do as much as a standalone love2d game) It's not absolutely necessary, but it's security so it's never a bad thing.I don't entirely understand what sandboxing is but is it really necessary?The problem is that it's not sandboxed.
Or you can do a loop.Edit: I changed you first code to this:Now if the mappack has a custom editor.lua it loads it, (hangs a bit when it boots though...) Success! Now I just need to repeat this 50 more times with slight variation and I'll be done! Thanks!Code: Select all
if love.filesystem.exists('mappacks/'..mappack..'/editor.lua')then love.filesystem.load('mappacks/'..mappack..'/editor.lua')() end
Code: Select all
for i,v in ipairs({'editor','game','mario',etc}) do
if love.filesystem.exists('mappacks/'..mappack..'/'..v..'.lua')then
love.filesystem.load('mappacks/'..mappack..'/'..v..'.lua')()
end
end
Ex, mod.lua:
Code: Select all
oldproperprint=properprint
function properprint(s, x, y)
love.graphics.print(s,x,y)
end
Code: Select all
properprint=oldproperprint
Okay with my limited programming knowledge I'm having trouble picking up what your laying down. would using mod.lua make it refer to the custom luas it needs, would it "patch" the luas it wants changed, or something else that I clearly don't understand.
sorry I'm so slow...
Alternatively, it could just load any luas within the mappack's folder although that's probably not as good as using a mod.lua. Edit: I don't actually know how to do that.
Also why is the unloadmod.lua necessary?
sorry I'm so slow...
Alternatively, it could just load any luas within the mappack's folder although that's probably not as good as using a mod.lua. Edit: I don't actually know how to do that.
Also why is the unloadmod.lua necessary?
The "mod.lua" is a file in the mappack. It patch the game, it will only change the parts of the game you want.Okay with my limited programming knowledge I'm having trouble picking up what your laying down. would using mod.lua make it refer to the custom luas it needs, would it "patch" the luas it wants changed, or something else that I clearly don't understand.
Well, yes, but since you will probably just change some parts of a lua file and not completely replace it, you will just put the parts that you changed.Alternatively, it could just load any luas within the mappack's folder although that's probably not as good as using a mod.lua. Edit: I don't actually know how to do that.
And since there is no reason to have to separate the mod into multiple files(try to put the content of game.lua into editor.lua, and vice-versa:Everything still work!), we just load a mod.lua .
Because the mod.lua can change things in the game that can't be undone magically(unless you restart the game).Also why is the unloadmod.lua necessary?
Let say you put in mappack1 a mod.lua that make goombas jump.
When you load mappack1, you have the jumping goombas. Cool, everything work!
Then you load mappack2, the goombas will still jump, because the code that make goombas jump is still here.
So, when you stop playing mappack1, you should put a unloadmod.lua that restore goombas to their non-jumping state.
Well, it's a per-mappack mod loader.
If you want to load "globals" mod, then put in love.load, after the looooooooong require() list:
Then, a "mods" folder will appear, next to the mappack folder, and if you put a folder inside that contain a init.lua, it will load it.
But the problem here is that Turtle's more entity mod was never made for this, and will probably don't work.
If you want to load "globals" mod, then put in love.load, after the looooooooong require() list:
Code: Select all
love.filesystem.mkdir('mods')
for v in love.filesystem.enumerate('mods/') do
if love.filesystem.exist('mods/'..v..'/init.lua') then
love.filesystem.load('mods/'..v..'/init.lua)(v)
end
end
But the problem here is that Turtle's more entity mod was never made for this, and will probably don't work.
Ah, uh, it's at multiple places(because there is multiple ways of quitting.)
So, ctrl+F "_load"
Line 3448
3458
4107
2610
So, ctrl+F "_load"
Line 3448
Code: Select all
function nextlevel()
love.audio.stop()
mariolevel = mariolevel + 1
if mariolevel > 4 then
mariolevel = 1
marioworld = marioworld + 1
end
levelscreen_load("next")
end
Code: Select all
function warpzone(i)
love.audio.stop()
mariolevel = 1
marioworld = i
mariosublevel = 0
prevsublevel = false
-- minus 1 world glitch just because I can.
if not displaywarpzonetext and i == 4 then
marioworld = "M"
end
levelscreen_load("next")
end
Code: Select all
function endgame()
love.audio.stop()
playertype = "minecraft"
playertypei = 2
gamefinished = true
saveconfig()
menu_load()
end
Code: Select all
function game_keypressed(key, unicode)
if pausemenuopen then
if menuprompt then
if (key == "left" or key == "a") then
pausemenuselected2 = 1
elseif (key == "right" or key == "d") then
pausemenuselected2 = 2
elseif (key == "return" or key == "enter" or key == "kpenter" or key == " ") then
if pausemenuselected2 == 1 then
love.audio.stop()
pausemenuopen = false
menuprompt = false
#HERE
menu_load()
else
menuprompt = false
end
BAM!
http://www.mediafire.com/download.php?6rl0tnqgonyvlm1
I decided it was easy, and more concise, to just run the unloadmod.lua as part of the menu_load function.
Oh credit goes to Automatik because he did pretty much everything
I'd make a thread for this but I don't really know how it works...
http://www.mediafire.com/download.php?6rl0tnqgonyvlm1
I decided it was easy, and more concise, to just run the unloadmod.lua as part of the menu_load function.
Oh credit goes to Automatik because he did pretty much everything
I'd make a thread for this but I don't really know how it works...
This: viewtopic.php?f=13&t=782&p=12217&hilit=system#p12217
I guess this one goes straight through the mappacks folder, so you can (hopefully) more easily use mods with a mappack that won't effect other mappacks.
I guess this one goes straight through the mappacks folder, so you can (hopefully) more easily use mods with a mappack that won't effect other mappacks.
- BobTheLawyer
- Posts: 2232
- Joined: 01 May 2012, 21:00
Another question, will this allow me to modify Mario.lua and others?
I'm going to assume so. But Automatik did virtually all the coding so I can't say. Furthermore I don't even know how to make a mod. I was using it to run the better level editor through the mappack folder and it worked like a charm. If you try making a custom mario.lua and rename it to loadmod.lua and put it in your mappack folder it should load it instead of the default one.
Edit: You'll need to rename the default mario.lua to unloadmod.lua and put it in the mappack to unload the mod when you switch mappacks.
Edit: You'll need to rename the default mario.lua to unloadmod.lua and put it in the mappack to unload the mod when you switch mappacks.
Edited original post with instructions and stuff!
@BobTheLawyer
This explains it pretty well.
@BobTheLawyer
This explains it pretty well.
Oh, and this isn't sandboxed so use someone else's mods at your own risk.Because the loadmod.lua can change things in the game that can't be undone magically(unless you restart the game).
Let say you put in mappack1 a loadmod.lua that make goombas jump.
When you load mappack1, you have the jumping goombas. Cool, everything work!
Then you load mappack2, the goombas will still jump, because the code that make goombas jump is still here.
So, when you stop playing mappack1, you should put a unloadmod.lua that restore goombas to their non-jumping state.
...
Last edited by Qcode on 21 Oct 2021, 17:38, edited 1 time in total.
- BobTheLawyer
- Posts: 2232
- Joined: 01 May 2012, 21:00
@QCode, There are many levels of sandboxing. You could sandbox it to a degree so it still worked.
You wish QCode. I got gels working for my EE Mari0MS port over. What now?Qcode wrote:I doubt you'd be able to sandbox extra entities. It does so much shit to the physics to get those gels working it's unreal.ucenna wrote:If I wanted to say, make turtle's or qcode's extra entities, work with this how would I do that?
Why would you want to change the main.lua? You could load and replace stuff with the mod.lua.
You can copy-paste the revelants lines in mod.lua
Ex, mod.lua:
unloadmod.lua
Ex, mod.lua:
Code: Select all
oldgoombaimage=goombaimage
goombaimage = love.graphics.newImage("mappack/"..({...})[1].."/greengoomba.png")
Code: Select all
goombaimage=oldgoombaimage
- BobTheLawyer
- Posts: 2232
- Joined: 01 May 2012, 21:00
Because it is a good idea.
I, personally, am done messing with other's code.
I want to program my own game.
There aren't many modders left that would use your modloader, though...
I, personally, am done messing with other's code.
I want to program my own game.
There aren't many modders left that would use your modloader, though...
That's okay. It's mainly meant to make it easier for mappers to enclose mods with their maps. Assuming enough people were to use this, people wouldn't have to download a new modded .love for the maps that use them i.e. A0zora, Under Aperture, the list goes on.
Oh and partially modded A0zora that's compatible with this:http://www.mediafire.com/?wfzrfumed88ulxu (Used without permission. if SJB wants me to get rid of this he only need ask)
Oh and partially modded A0zora that's compatible with this:http://www.mediafire.com/?wfzrfumed88ulxu (Used without permission. if SJB wants me to get rid of this he only need ask)
Well, actually...ucenna wrote:It's mainly meant to make it easier for mappers to enclose mods with their maps.
Well, actually...
- Use "unloadmod.lua" if you want to turn off a mod
- Use the "mods folder" method if it shouldn't be a mappack specific mod.
Updated:
-bundle (without permission) with Mari0MS Credit goes to respective owner)
mods from MMS go in the mappacks folder. they now go in your mappack's mods folder In the future they will probably go in mappacks/(insert name here)/mods folder. And I might add a seperate tab in the mappack section for enabling/disabling mods
@ Automatik:
1. sorry
2. Maybe, but the less work necessary to any potential user the better. if it's possible to only have to specify one folder it's probably better
Edit: I updated this again. The original one doesn't work just so you know.
-bundle (without permission) with Mari0MS Credit goes to respective owner)
mods from MMS go in the mappacks folder. they now go in your mappack's mods folder In the future they will probably go in mappacks/(insert name here)/mods folder. And I might add a seperate tab in the mappack section for enabling/disabling mods
@ Automatik:
1. sorry
2. Maybe, but the less work necessary to any potential user the better. if it's possible to only have to specify one folder it's probably better
Edit: I updated this again. The original one doesn't work just so you know.
I think he meant being able to create an entity with:
The advantage over the "replacing entity table" is that it's simpler, and allow for multiple mods to add entities)
Code: Select all
modloader:createentity(name,desc,icon,class)
Ahhh.....
I might be able do that. Since there is already two ways that you can add entities with this (through the loadmod.lua and Mari0MS which this is packaged with) I probably won't though.
updated: added turtle's character loader (without permission)
put characters in /mappacks/your mappack/characters
currently this will only use characters in the chosen mappacks folder.
I might be able do that. Since there is already two ways that you can add entities with this (through the loadmod.lua and Mari0MS which this is packaged with) I probably won't though.
updated: added turtle's character loader (without permission)
put characters in /mappacks/your mappack/characters
currently this will only use characters in the chosen mappacks folder.
Updated: Just realized that if a variable is declared in game.lua it won't be changeable in the loadmod.lua so I fixed it. If you want to change a variable simple make a variable in your loadmod.lua name loadgamelua and make it equal 'no' as so:
This will prevent it from running the rest of the game_load(suspend) function so you'll have to copy it's contents to your loadmod.lua and change the variable from there. If I missed any important customization that should be added just tell me.
Code: Select all
loadgamelua = 'no'
Nooooooooo
Here, we have a basic mod loader. if you want to replace stuff in game_load(), copy-paste and modify that . So, what's the point of your hack?
If you want to be able to override variables from game_load, then put that
At the end of game_load. not at the beginning.
But if you want to make it easier to add entities, don't make things like that.
Add a proper modloader:createentity(name,desc,icon,class).
Here, we have a basic mod loader. if you want to replace stuff in game_load(), copy-paste and modify that . So, what's the point of your hack?
If you want to be able to override variables from game_load, then put that
Code: Select all
if love.filesystem.exists('mappacks/'..mappackname..'/mod.lua')then
love.filesystem.load('mappacks/'..mappackname..'/mod.lua')()
end
But if you want to make it easier to add entities, don't make things like that.
Add a proper modloader:createentity(name,desc,icon,class).
Sorry, I have a tendency of finding the hard way of doing everything. If people want to make entities I let them use Mari0MS, at least for now. It's already packaged with this and (seems) easy enough to use.
Update: did what Automatik said concerning the game_load stuff.
Update: did what Automatik said concerning the game_load stuff.
I made a hub world thing using this! Actually I primarily used Mari0MS but it's packaged to be compatible with this. http://www.mediafire.com/download.php?8yko1q1orjib5na (see below)
Naturally you'll need the modloader to use this. Please note that all of my custom entities stink. This is basically a proof of concept (except I don't know what those are) so I 'll just call it a proof of possibility.
Naturally you'll need the modloader to use this. Please note that all of my custom entities stink. This is basically a proof of concept (except I don't know what those are) so I 'll just call it a proof of possibility.
Last edited by ucenna on 01 May 2013, 20:39, edited 1 time in total.
- Flutter Skye
- Posts: 1690
- Joined: 08 Apr 2012, 17:54
- Contact:
Can you give us evidence a screenshot ?ucenna wrote:I made a hub world thing using this! Actually I primarily used Mari0MS but it's packaged to be compatible with this. http://www.mediafire.com/download.php?8yko1q1orjib5na
Naturally you'll need the modloader to use this. Please note that all of my custom entities stink. This is basically a proof of concept (except I don't know what those are) so I 'll just call it a proof of possibility.
Sure! Be warned though, there isn't much to look at.
the number in the green star shows how many stars have been obtained, which it finds out by looking in the stars.lua I made. the grey stars are stargates you need 0 stars for the first two 1star for the second two and so on. The last two are setup as they are because I don't know how to stack them. under the two pipes there is access to two gold stars. which if you get will add one to your star count and changes a variable in stars.lua that effectively terminates there existence. Since stars.lua gets changed during gameplay it has an "autosave" feature.
- Flutter Skye
- Posts: 1690
- Joined: 08 Apr 2012, 17:54
- Contact:
So you made Super Mario 64 possible ? You are awesome.
More or less... I wouldn't recommend using this until it gets some serious polishing. kinda hope some of our more experienced coders fix this hope because I don't have much idea on how to do it.
Heres a quick list o' flaws:
Star Counter is rendered in the foreground.
Star Counter doesn't have a proper entity png.
Stars & Star Gates are effected by gravity.
Stars & Star Gates might be affected by turtle shells and stuff.they're not. But neither are the turtle shells
Stars & Star Gates don't have drop down menus/boxs, if you want to make more you have to make more entities. Unfortuantely I don't know how to make text box drop downs yet so you'll have to use the good old fashion right click menu. Until I get it figured, you'll be limited to approx 20 stars
Fun fact: all the custom entities are modified poison shrooms.
Updated: fixed a few things and removed a ton of unnecessary code from my hub world stuff.
http://www.mediafire.com/download.php?1aznzzjjeiw9uz1
edit: make sure you have a hub folder inside of your mappack.
Heres a quick list o' flaws:
Star Counter is rendered in the foreground.
Star Counter doesn't have a proper entity png.
Stars & Star Gates are effected by gravity.
Stars & Star Gates might be affected by turtle shells and stuff.they're not. But neither are the turtle shells
Stars & Star Gates don't have drop down menus/boxs, if you want to make more you have to make more entities. Unfortuantely I don't know how to make text box drop downs yet so you'll have to use the good old fashion right click menu. Until I get it figured, you'll be limited to approx 20 stars
Fun fact: all the custom entities are modified poison shrooms.
Updated: fixed a few things and removed a ton of unnecessary code from my hub world stuff.
http://www.mediafire.com/download.php?1aznzzjjeiw9uz1
edit: make sure you have a hub folder inside of your mappack.
Guess what! My mod loader had a HUGE flaw! It used to load the unloadmod.lua to quick and effectively disabled the loadmod.lua before it could even be used. But I fixed it so If anyone is using this I encourage them to give the fixed mod loader (in the original post) a download. Oh this also loads (and unloads) the mod at the mappack screen.
- TripleXero
- Posts: 892
- Joined: 08 Aug 2012, 00:23
- Contact:
I figured it was better to post it here than the ANSYS thread, but I think it'd be cool if I could use the differing physics per character for my SMB mod if you didn't mind
Sure! I was actually considering making a physics for character mod for all the players but you beat me too it. Just a note the code doesn't check the player number, it checks which character is selected. Anywho, here's the code:
Code: Select all
if characteri ~= nil then
if characterlist[characteri] == "luigi" then
(insert modified physics. here luigi used this:
friction = 5
yaccelerationjumping = 27
hatoffsets = {}
hatoffsets["idle"] = {0, 2}
hatoffsets["running"] = {{0, 2}, {0, 2}, {-1, 1}}
hatoffsets["sliding"] = {0, 2}
hatoffsets["jumping"] = {0, 1}
hatoffsets["falling"] = {0, 2}
hatoffsets["climbing"] = {{2, 2}, {2, 1}}
hatoffsets["swimming"] = {{1, 1}, {1, 1}}
hatoffsets["dead"] = false
hatoffsets["grow"] = {-6, 2})
else
(insert default code here or change the else to an elseif and make code for something else, luigi used this for default code:
friction = 14
yaccelerationjumping = 30
hatoffsets = {}
hatoffsets["idle"] = {0, 0}
hatoffsets["running"] = {{0, 0}, {0, 0}, {-1, -1}}
hatoffsets["sliding"] = {0, 0}
hatoffsets["jumping"] = {0, -1}
hatoffsets["falling"] = {0, 0}
hatoffsets["climbing"] = {{2, 0}, {2, -1}}
hatoffsets["swimming"] = {{1, -1}, {1, -1}}
hatoffsets["dead"] = false
hatoffsets["grow"] = {-6, 0})
end
end
Slight update: Now loads custom entities per mappack. Doesn't unload them though. Shouldn't be a problem unless you accidentally add an entity to a mappack that doesn't have it in it's mods folder.
http://www.mediafire.com/download.php?dre608la83ot76f
http://www.mediafire.com/download.php?dre608la83ot76f
-
- Posts: 524
- Joined: 02 Jun 2012, 03:40
If that's the case, maybe add an extra graphic to overlay on the mod's graphic that says "NOT INSTALLED" or something?
-
- Posts: 524
- Joined: 02 Jun 2012, 03:40
I was wondering if it'd go something like
Check if the mod is there in the mappack folder (love.filesystem.Exists()) after loading the mod
If it doesn't, then draw the "Not Installed" graphic in place of the actual graphic.
But then again I'm no expert in this stuff, just giving basic ideas off what I know o3o
Check if the mod is there in the mappack folder (love.filesystem.Exists()) after loading the mod
If it doesn't, then draw the "Not Installed" graphic in place of the actual graphic.
But then again I'm no expert in this stuff, just giving basic ideas off what I know o3o