Bloodmagic [old and crappy]

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [MOD] Blood Magic [bloodmagic]

by Chem871 » Post

What if you added octiron to one of your magic mods? ;P
What is SCP-055?

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [MOD] Blood Magic [bloodmagic]

by PolySaken » Post

Chem871 wrote:What if you added octiron to one of your magic mods? ;P
That's a good idea!
but i'd have to make it invisible..
Only wizards can see Octarine!
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [MOD] Blood Magic [bloodmagic]

by TechNolaByte » Post

perhaps a magic node that spawn in the world (like the fireflies mod)
that is invisible but while wearing a pair of magic glasses/goggles you can see and collect these special nodes and use them in certain magic recipes/sacrifices
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [MOD] Blood Magic [bloodmagic]

by PolySaken » Post

RSLRedstonier wrote:perhaps a magic node that spawn in the world (like the fireflies mod)
that is invisible but while wearing a pair of magic glasses/goggles you can see and collect these special nodes and use them in certain magic recipes/sacrifices
I would have no idea of how to do that.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [MOD] Blood Magic [bloodmagic]

by TechNolaByte » Post

ill see what I can do
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [MOD] Blood Magic [bloodmagic]

by TechNolaByte » Post

Ok I have modified the code from the fireflies mod to get you a basic example

basically any node that has been registered with the group
catchable = 1
and no other groups can not be mined and can only be collected with the item collector only while you are wearing the magic goggles(uses 3d armor)
has no crafting recipes as is just an example for you to modify
I couldn't figure out how to make them visible/invisible while wearing/not wearing the goggles but this is better than nothing
I should be able to figure that part out soon though

Code: Select all

magicexample = {}
magicexample.can_see_magic_nodes = false
-- firefly 
minetest.register_node("magicexample:node_to_collect_1", {
	description = "Node to collect 1",
        tiles = {"clay.png"},
	inventory_image = "fireflies_firefly.png",
	wield_image =  "fireflies_firefly.png",
	groups = {catchable = 1},
})
minetest.register_node("magicexample:node_to_collect_2", {
	description = "Node to collect 2",
        tiles = {"cobble.png"},
	inventory_image = "fireflies_firefly.png",
	wield_image =  "fireflies_firefly.png",
	groups = {catchable = 1},
})
minetest.register_craftitem("magicexample:catching_item", {
	description = "Catching item",
	inventory_image = "fireflies_bugnet.png",
	        stack_max = 1,
	on_use = function(itemstack, player, pointed_thing)
		if not pointed_thing or 
		pointed_thing.type ~= "node" or 
		minetest.is_protected(pointed_thing.under, player:get_player_name()) then
			return
		end
		local node_name = minetest.get_node(pointed_thing.under).name
		local inv = player:get_inventory()
		if minetest.get_item_group(node_name, "catchable") == 1 and magicexample.can_see_magic_nodes == true then
			minetest.set_node(pointed_thing.under, {name = "air"})
			local stack = ItemStack(node_name.." 1")
			local leftover = inv:add_item("main", stack)
			if leftover:get_count() > 0 then
				minetest.add_item(pointed_thing.under, node_name.." 1")
			end	
		end
	end
})
minetest.register_craftitem("magicexample:goggles", {
	description = "Magic goggles\nlets the player interact\nwith magic nodes\nwhile wearing",
	inventory_image = "magicexample_texture.png",
	stack_max = 1,
})
minetest.register_globalstep(function(dtime)
	for _,player in ipairs(minetest.get_connected_players()) do
		local inv = player:get_inventory()
		for i=1, 6 do
			local stack = inv:get_stack("armor", i)
			local item = stack:get_name()
            if item == "magicexample:goggles" then
				local playername = player:get_player_name()
		magicexample.can_see_magic_nodes = true
				return
			else 
				local playername = player:get_player_name()
				magicexample.can_see_magic_nodes = false
end
		end
	end
end)
edit- you will also need to handle oregen/decoration/ how ever they are to appear in the world your self
second edit- this will only work for single player but it probably wouldn't be to hard to switch it to using privs instead of a variable
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [MOD] Blood Magic [bloodmagic]

by Byakuren » Post

You could use particles to show where the node is to goggle-wearers, since particle spawners can be sent to particular players.
Every time a mod API is left undocumented, a koala dies.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [MOD] Blood Magic [bloodmagic]

by TechNolaByte » Post

Byakuren wrote:You could use particles to show where the node is to goggle-wearers, since particle spawners can be sent to particular players.
So have an invisible node that player can walk through and players with the goggles can see particles at the nodes location and interact with the node? sounds doable but how would I specify to only show the particles to players within a certain range who are wearing the goggles?

edit- I'm working on it but first I have to make this multiplayer compatible
edit edit- got it working for interaction with multi player but not sure how to have an active block modifier only show particles to players with the priv can_see_magic_nodes = true
need help with that part
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [MOD] Blood Magic [bloodmagic]

by Byakuren » Post

RSLRedstonier wrote:
Byakuren wrote:You could use particles to show where the node is to goggle-wearers, since particle spawners can be sent to particular players.
So have an invisible node that player can walk through and players with the goggles can see particles at the nodes location and interact with the node? sounds doable but how would I specify to only show the particles to players within a certain range who are wearing the goggles?

edit- I'm working on it but first I have to make this multiplayer compatible
edit edit- got it working for interaction with multi player but not sure how to have an active block modifier only show particles to players with the priv can_see_magic_nodes = true
need help with that part
Create a globalstep (not ABM) that creates a particle spawner for each close player-node pair while the players have the goggles on, and delete the spawner for the players that take the goggles off or go too far away.
Every time a mod API is left undocumented, a koala dies.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Blood Magic [bloodmagic]

by TechNolaByte » Post

I am not very good with particles or lua in general so ima just lay down what I have so far and let polysaken either use it, modifie and use it, or just ignore it

so far what I have I is a system of registering nodes with a group
all nodes with the group can only be obtained with the collection item being used by players with the can see magic nodes priv
the special priv is granted to anybody wearing the goggles as 3d armor
the special priv is revoked of anybody not wearing the goggles as 3d armor

Code: Select all

minetest.register_privilege("can_see_magic_nodes", {
	description = "Allows player to see and interact with magic nodes",
	give_to_singleplayer = false
})
-- firefly 
minetest.register_node("magicexample:node_to_collect_1", {
	description = "Node to collect 1",
        tiles = {"clay.png"},
	inventory_image = "fireflies_firefly.png",
	wield_image =  "fireflies_firefly.png",
	groups = {catchable = 1},
})
minetest.register_node("magicexample:node_to_collect_2", {
	description = "Node to collect 2",
        tiles = {"cobble.png"},
	inventory_image = "fireflies_firefly.png",
	wield_image =  "fireflies_firefly.png",
	groups = {catchable = 1},
})
minetest.register_craftitem("magicexample:catching_item", {
	description = "Catching item",
	inventory_image = "fireflies_bugnet.png",
	        stack_max = 1,
	on_use = function(itemstack, player, pointed_thing)
		if not pointed_thing or 
		pointed_thing.type ~= "node" or 
		minetest.is_protected(pointed_thing.under, player:get_player_name()) then
			return
		end
		local node_name = minetest.get_node(pointed_thing.under).name
		local inv = player:get_inventory()
		if minetest.get_item_group(node_name, "catchable") == 1 and minetest.check_player_privs(player:get_player_name(), {can_see_magic_nodes=true}) then
			minetest.set_node(pointed_thing.under, {name = "air"})
			local stack = ItemStack(node_name.." 1")
			local leftover = inv:add_item("main", stack)
			if leftover:get_count() > 0 then
				minetest.add_item(pointed_thing.under, node_name.." 1")
			end	
		end
	end
})
minetest.register_craftitem("magicexample:goggles", {
	description = "Magic goggles\nlets the player interact\nwith magic nodes\nwhile wearing",
	inventory_image = "magicexample_texture.png",
	stack_max = 1,
})
minetest.register_globalstep(function(dtime)
	for _,player in ipairs(minetest.get_connected_players()) do
		local inv = player:get_inventory()
		for i=1, 6 do
			local stack = inv:get_stack("armor", i)
			local item = stack:get_name()
            if item == "magicexample:goggles" then
				local playername = player:get_player_name()
				local privs = minetest.get_player_privs(playername)
				privs.can_see_magic_nodes = true
				minetest.set_player_privs(playername, privs)
				for key, value in pairs(minetest.registered_nodes) do
				if minetest.get_item_group(key, "catchable") == 1 then
	minetest.add_particlespawner({
			amount = 20,
			time = 0.2,
			minpos = key.pos,
			maxpos = key.pos,
			minvel = {x = -1.5, y = 2, z = -1.5},
			maxvel = {x = 1.5,  y = 4, z = 1.5},
			minacc = {x = 0, y = -8, z = 0},
			maxacc = {x = 0, y = -4, z = 0},
			minexptime = 1,
			maxexptime = 1.5,
			minsize = 1,
			maxsize = 2.5,
			collisiondetection = true,
			vertical = false,
			texture = "fireflies_firefly.png",
			player = playername,
		})
				end
		end
				return
			else 
				local playername = player:get_player_name()
				local privs = minetest.get_player_privs(playername)
		privs.can_see_magic_nodes = nil
		minetest.set_player_privs(playername, privs)
end
		end
	end
end)
--[[
minetest.register_abm({
nodenames = {"group:catchable"},
interval = 5,
chance = 1,
action = function(pos, node)
		minetest.add_particlespawner({
			amount = 20,
			time = 0.2,
			minpos = pos,
			maxpos = pos,
			minvel = {x = -1.5, y = 2, z = -1.5},
			maxvel = {x = 1.5,  y = 4, z = 1.5},
			minacc = {x = 0, y = -8, z = 0},
			maxacc = {x = 0, y = -4, z = 0},
			minexptime = 1,
			maxexptime = 1.5,
			minsize = 1,
			maxsize = 2.5,
			collisiondetection = true,
			vertical = false,
			texture = "fireflies_firefly.png",
		})
end,
})
]]--
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Blood Magic [bloodmagic]

by PolySaken » Post

Like i said, I dont know know to integrate this (gameplay-wise.)
What would be the use of this node?
You have enough material here to make your own mod out of this.
but if you really want me to use it i will.
This would mean me modifying/rewriting parts of the code and making my own textures.
Are you okay with this?
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Blood Magic [bloodmagic]

by PolySaken » Post

RSLRedstonier wrote: so far what I have I is a system of registering nodes with a group
all nodes with the group can only be obtained with the collection item being used by players with the can see magic nodes priv
the special priv is granted to anybody wearing the goggles as 3d armor
the special priv is revoked of anybody not wearing the goggles as 3d armor
Does this mean all of this code is working?
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Blood Magic [bloodmagic]

by TechNolaByte » Post

PolySaken wrote: This would mean me modifying/rewriting parts of the code and making my own textures.
Are you okay with this?
Yes!
that was the whole reason why I created this(well I never really start from scratch I used a little code from the fire flies mod)
it was just to give you the basic principle of having world gen nodes (ex. magic spirits)that could be collected with a certain item(ex. magic bottle) but they could only be collected if the player was wearing a certain item(ex. magic goggles)
this does depend of 3d armor though for the goggles

edit- just don't be a plagiarist and give credit to me and the fireflies mod if you chose to use or derive any code from above ;)
Last edited by TechNolaByte on Sun Jan 28, 2018 03:33, edited 1 time in total.
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Blood Magic [bloodmagic]

by TechNolaByte » Post

PolySaken wrote: Does this mean all of this code is working?
yes all I listed is fully functioning
any node that has been resisted with the group tag of catchable = 1
can be collected by any player wearing the magic goggles and using a collection item
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Blood Magic [bloodmagic]

by PolySaken » Post

I dont want to discourage you or anything but I don't really like the idea of a privs system.
If you make a full mod out of this, i will gladly add it to the magic modpack,
with your permission of course.
but i wont do anything with it myself.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
JNEITRONS
Member
Posts: 39
Joined: Wed Nov 08, 2017 14:32
GitHub: JNEITRONS
IRC: NEITRON
In-game: NEITRON
Location: Minetest

Re: [Mod] Blood Magic [bloodmagic]

by JNEITRONS » Post

One Word : Nice...

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Blood Magic [bloodmagic]

by TechNolaByte » Post

PolySaken wrote:I dont want to discourage you or anything but I don't really like the idea of a privs system.
If you make a full mod out of this, i will gladly add it to the magic modpack,
with your permission of course.
but i wont do anything with it myself.
ok seams fare
I just used privs as that was the easiest way I could think of to make it multiplayer compatible
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
Andrey01
Member
Posts: 2576
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [Mod] Blood Magic [bloodmagic]

by Andrey01 » Post

Why is blood used for production of tools and other things? Really is it probably to do something from blood?

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Blood Magic [bloodmagic]

by TechNolaByte » Post

Andrey01 wrote:Why is blood used for production of tools and other things? Really is it probably to do something from blood?
here is a link to the minecraft blood magic wiki
It explains the whole concept of blood magic very well
http://www.9minecraft.net/blood-magic-mod/
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Blood Magic [bloodmagic]

by Byakuren » Post

If this is like MC blood magic, are you intending to have a similar progression?
Every time a mod API is left undocumented, a koala dies.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Blood Magic [bloodmagic]

by PolySaken » Post

Byakuren wrote:If this is like MC blood magic, are you intending to have a similar progression?
no, I just like the idea. I'm not making a clone.
Last edited by PolySaken on Mon Jan 29, 2018 01:31, edited 1 time in total.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Blood Magic [bloodmagic]

by PolySaken » Post

Announcement!
the versions of the mods in the upcoming modpack will rely Directly on each other, therefore cannot be used outside of the modpack.
the individual versions will still be standalone, however.
this means i can have depends that require the other parts of the modpack while the individual mods do not.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Blood Magic [bloodmagic]

by TechNolaByte » Post

Byakuren wrote:If this is like MC blood magic, are you intending to have a similar progression?
This isn't supposed to clone the blood magic mod I just set the link because it has a nice lore to blood magic in general
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Blood Magic [bloodmagic]

by PolySaken » Post

RSLRedstonier wrote:
Byakuren wrote:If this is like MC blood magic, are you intending to have a similar progression?
This isn't supposed to clone the blood magic mod I just set the link because it has a nice lore to blood magic in general
Exactly. This has nothing to do with MC bloodmagic, and I didn't even know that existed when i came up with this concept for the first time.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Blood Magic [bloodmagic]

by PolySaken » Post

Updated To Do list
- soul binding
- modpack
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], ROllerozxa, Semrush [Bot] and 3 guests