Space for armor in the bones

Post Reply
Sporax
Member
Posts: 149
Joined: Mon Jul 11, 2016 16:33
GitHub: Sporax
IRC: Sporax
In-game: Sporax
Location: France

Space for armor in the bones

by Sporax » Post

Hi guys,

Again, i come to ask for some help !
This time it's to add slots in bones to keep armors when the player's inventory is full.

An idea on how to do this ? I've made this to help you to understand, i've changed the mtg mod bones:

Code: Select all

local bones_formspec =
	"size[8,10]" ..
	"list[current_name;main;0,0.3;8,4;]" ..
	"list[current_player;main;0,5.85;8,1;]" ..
	"list[current_player;craft;0,4.55;8,1;]"..
	"list[current_player;main;0,7.08;8,3;8]" ..
	"listring[current_name;main]" ..
	"listring[current_player;main]" ..
	default.get_hotbar_bg(0,5.85)
If you want to test... Any idea on how we could do that are welcomed. Thanks

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: Space for armor in the bones

by bosapara » Post

Something like this, by adding 1 more line to bones inventory:
Image

Sporax
Member
Posts: 149
Joined: Mon Jul 11, 2016 16:33
GitHub: Sporax
IRC: Sporax
In-game: Sporax
Location: France

Re: Space for armor in the bones

by Sporax » Post

Yes that's exactly what i mean, i've tried too, but... i don't know how to make armor go there and how to defin correctly these extra slots.

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: Space for armor in the bones

by bosapara » Post

Quick solution:

Go to 'bones' init.lua. Firstly change bones formspec:

Code: Select all

	"size[8,9.3]" ..
	default.gui_bg ..
	default.gui_bg_img ..
	default.gui_slots ..
	"list[current_name;main;0,0;8,5;]" ..
	"list[current_player;main;0,5.5;8,1;]" ..
	"list[current_player;main;0,6.5;8,3;8]" ..
	"listring[current_name;main]" ..
	"listring[current_player;main]" ..
	default.get_hotbar_bg(0,5.5)
Then go to line 217 and change it:

Code: Select all

inv:set_size("main", 8 * 5)
Image

Sporax
Member
Posts: 149
Joined: Mon Jul 11, 2016 16:33
GitHub: Sporax
IRC: Sporax
In-game: Sporax
Location: France

Re: Space for armor in the bones

by Sporax » Post

A great improvement!

Thanks for it and for your time :).

NB: The second change was line 254 if another one looking for it ;-).

Post Reply

Who is online

Users browsing this forum: talamh and 16 guests