Help with Editor modding

Mods, guides how to use and install mods go right in here.
Post Reply
Megadardery
Posts: 15
Joined: 07 Jan 2014, 22:45

Post » 07 Jan 2014, 22:58

I'm a new here, and I tried every possible way I know. So if someone can help or make this mod, I'll be glad.

I need to change the background color option in the editor and add the option to load images as background (similar to the custom background image), for example the dropdownbox will contain the following Grass, Sky, Water. And if I choose Grass a specific image will load, If I choose Sky, another specific image will load.. and so on.

EDIT: it like the Hat loader mod but for backgrounds

User avatar
MM102
Posts: 970
Joined: 11 May 2012, 06:08
Contact:

Post » 07 Jan 2014, 23:13

welcome to the forums!
custom backgrounds are already in the game; the portal background is just the default
to add custom backgrounds place the image you want in the mappack folder and rename it 'background1'
if need more help please visit this thread

Megadardery
Posts: 15
Joined: 07 Jan 2014, 22:45

Post » 07 Jan 2014, 23:18

I knew that already, I wanted this option:
Image
to have the option to load some pre-defied backgrounds.

User avatar
Mr.Q.Marx?
Posts: 849
Joined: 15 May 2012, 18:35

Post » 08 Jan 2014, 00:15

Not sure I see the point. However not sure I need to.
First off make a folder full of the overlays you want it to have in 'graphics'.
Next open the editor.lua
If you're in Vanilla a.k.a. Standard Mari0 1.6 line 28 should read:

Code: Select all

guielements["backgrounddropdown"] = guielement:new("dropdown", 17, 85, 6, changebackground, background, "blue", "black", "water")
Under that line add

Code: Select all

guielements["backgroundoverlaydropdown"] = guielement:new("dropdown", 100, 85, 6, changebackgroundoverlay, overlay, "none", "grass", "sky", "water")
	
Then around line 418 you'll see:

Code: Select all

guielements["backgrounddropdown"]:draw()
so add:

Code: Select all

guielements["backgroundoverlaydropdown"]:draw()
Go ahead and test that and you'll see you have made a dropdown menu next to the colour one. You can't use it yet though.

Around 500 there is a line that says

Code: Select all

guielements["backgrounddropdown"].active = true
Under add

Code: Select all

guielements["backgroundoverlaydropdown"].active = true
Near the bottom after:

Code: Select all

function changebackground(var)
	background = var
	guielements["backgrounddropdown"].var = var
	love.graphics.setBackgroundColor(backgroundcolor[var])
end
add in

Code: Select all

function changebackgroundoverlay(var)
	backgroundoverlay = var
	guielements["backgroundoverlaydropdown"].var = var
	
end
You now have a dropdown. I'm bored, if someone else wants to tell him how to load the images please do.

Megadardery
Posts: 15
Joined: 07 Jan 2014, 22:45

Post » 08 Jan 2014, 16:12

you understood correctly actually I already done things similar to this ;). I'm only stuck on loading images as background.. I need some codes similar to loading custom images.

User avatar
Mr.Q.Marx?
Posts: 849
Joined: 15 May 2012, 18:35

Post » 08 Jan 2014, 17:43

You know that it would pretty much be sure to be incompatible with standard Mari0 yeah?

Megadardery
Posts: 15
Joined: 07 Jan 2014, 22:45

Post » 08 Jan 2014, 18:53

what you mean? I just want this for myself, I won't share the mappack in this state. Once I finish, I will normally import the custom background then I may share it here.

Megadardery
Posts: 15
Joined: 07 Jan 2014, 22:45

Post » 18 Jan 2014, 18:23

help?

User avatar
SauloFX
Posts: 556
Joined: 26 Feb 2014, 02:52

Post » 02 Mar 2014, 02:40

first of all,with Mari0 you're using,SE or 1.6?

Post Reply