[Mod] Christmas [1.0] [christmas]

Post Reply
User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

[Mod] Christmas [1.0] [christmas]

by Extex » Post

My Third mod!

Image

Christmas themed mod

Currently adds:
  • Candy canes
  • Gingerbread man
  • Mince pie
  • Eggnog
  • Stocking (Gives rewards every 1.5 hours)
  • Tree
  • Present
  • Red Bauble
  • Christmas lights
  • Star (Tree topper)
  • Sugar (To make your favorite sweets)
Spoiler
  • Christmas crackers
  • Christmas wreath
  • Robot Christmas Caroler
  • Multi-Coloured ornaments
    (Help with hardware coloring wanted)
  • Santa Costume (3d_armor)
  • Tree lights
  • More topper variety
  • Holly (Maybe not)
  • Mistletoe (Maybe not)
  • Disable itself after Christmas season
Any other ideas are welcome
License: Code (MIT), Textures (CC BY-SA 3.0)

Optional dependencies: default, farming, wool, dye.

Browse code: https://github.com/Extex101/christmas

Download: https://github.com/Extex101/christmas/a ... master.zip
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] Christmas [1.0] [christmas]

by Nathan.S » Post

Looks promising. You're missing recipes for a handful of items though.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Some items aren't craftable their only obtainable as a reward in the stocking
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] Christmas [1.0] [christmas]

by Nathan.S » Post

Does that include the sugar? because it's needed to crate a few things, but has no craft for itself.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Yes it's also a reward
Look at the end of init.lua
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] Christmas [1.0] [christmas]

by Nathan.S » Post

Okay, will check that out and see about recording a video today or tomorrow. :)
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] Christmas [1.0] [christmas]

by Nathan.S » Post

Okay, this time I think I found an actual bug. I can right click on the stocking as much as I want after it's filled and I keep adding the items to my inventory. Also if my active item in the hotbar is the same as what is in the stocking it won't add anything, or if the hotbar slot is empty, it will not get filled. Looking at the code it doesn't look like the inventory of the stocking is ever cleared.
This code snippet seems to fix the problem. I don't know what the leftover locals were for, and removing them and calling playerinv:add_item seemed to work just fine.

Code: Select all

		elseif not inv:is_empty("main") then --stocking has something in it.
			local item1 = inv:get_stack("main", 1)
			local item2 = inv:get_stack("main", 2)
			local item3 = inv:get_stack("main", 3)
            playerinv:add_item("main", item1)
            playerinv:add_item("main", item2)
            playerinv:add_item("main", item3)
            inv:set_stack("main", 1 ,'')
            inv:set_stack("main", 2 ,'')
            inv:set_stack("main", 3 ,'')
			timer:start(5400)
This code doesn't check if the player inventory is full, but neither did the original. If the player inventory is full the items are lost and the clock is still restarted. There is a way to check if the items will fit in inventory, and if they don't they could either be dropped in world, or you could opt to not set the inventory empty. However if a player had two empty slots they could keep right clicking on the stocking and fill those two slots to 99 items because the stocking keeps giving items.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Oh...
I'll look into it
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Ok fixed.
Sorry for the long delay
Been busy...
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

mase
Member
Posts: 91
Joined: Tue Feb 21, 2017 20:16
In-game: mase

Re: [Mod] Christmas [1.0] [christmas]

by mase » Post

I get the message, that christmas_present_top.png is missing. It is not there indeed.

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Christmas [1.0] [christmas]

by Extex » Post

Sorry for the very late reply but it's fixed now mase
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
Lupercus
Member
Posts: 30
Joined: Tue Jan 03, 2017 02:08
GitHub: lupercus13
IRC: Lupercus-Server
In-game: Lupercus

Re: [Mod] Christmas [1.0] [christmas]

by Lupercus » Post

Hello, love the mod, but latest version on ContentDB throws this error when loaded on new map, minetest version 5.4.1
Attachments
Screenshot from 2021-09-17 20-22-14.png
Screenshot from 2021-09-17 20-22-14.png (94.33 KiB) Viewed 1310 times

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests