[Mod] XP [1.0][experience]

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

[Mod] XP [1.0][experience]

by jordan4ibanez » Post

This adds in XP orbs, and rewards from xp.

How does one get xp? Well you have to assign some ores to the group xp=1 for this to work. when you dig an ore with xp=1 group, you get an orb and you just might level up.

a player loses all xp on death.

There is a neat level up sound.

SCREENSHOT
Image

Download

License: dwtfywt
Last edited by jordan4ibanez on Thu Oct 04, 2012 18:09, edited 1 time in total.
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

Yay! We are finaly Minecraft! </ironic>

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

PilzAdam wrote:Yay! We are finaly Minecraft! </ironic>
+1
Last edited by Mito551 on Thu Oct 04, 2012 18:47, edited 1 time in total.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

PilzAdam wrote:Yay! We are finaly Minecraft! </ironic>
your game mode uses the entire minecraft texture pack, why would you even say that?
hello, am program. do language in rust. make computer do. okay i go now.

leo_rockway
Member
Posts: 211
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Post

jordan4ibanez wrote:This adds in XP orbs, and rewards from xp.

How does one get xp? Well you have to assign some ores to the group xp=1 for this to work.
I'm sorry, I don't see where to add this. Can you be more specific? Thank you.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

leo_rockway wrote:
jordan4ibanez wrote:This adds in XP orbs, and rewards from xp.

How does one get xp? Well you have to assign some ores to the group xp=1 for this to work.
I'm sorry, I don't see where to add this. Can you be more specific? Thank you.
in an ore's group, like {cracky=1,chewy=2,xp=1}
hello, am program. do language in rust. make computer do. okay i go now.

leo_rockway
Member
Posts: 211
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Post

jordan4ibanez wrote:
leo_rockway wrote:
jordan4ibanez wrote:This adds in XP orbs, and rewards from xp.

How does one get xp? Well you have to assign some ores to the group xp=1 for this to work.
I'm sorry, I don't see where to add this. Can you be more specific? Thank you.
in an ore's group, like {cracky=1,chewy=2,xp=1}
Oh, gotcha. Thanks a lot.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

is there any particular usage of xp at the moment?

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Mito551 wrote:is there any particular usage of xp at the moment?
you get rewards from it
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

what kind of rewards? how do you use them. i'm not convinced

the mc lacks it as well. proper xp usage.
Last edited by Mito551 on Fri Oct 05, 2012 04:04, edited 1 time in total.

leo_rockway
Member
Posts: 211
Joined: Tue Jul 31, 2012 20:37

by leo_rockway » Post

Mito551 wrote:what kind of rewards?

level1 = 100
level1_drop = "default:steelblock 10"

level2 = 200
level2_drop = "default:steelblock 99"

level3 = 300
level3_drop = "default:mese 1"

level4 = 400
level4_drop = "default:mese 2"

level5 = 500
level5_drop = "default:mese 10"

level6 = 700
level6_drop = "default:mese 20"

level7 = 1000
level7_drop = "default:mese 30"

level8 = 1400
level8_drop = "default:mese 50"

level9 = 1800
level9_drop = "default:mese 70"

level10 = 2500
level10_drop = "default:mese 99"
Try Skyblock for MineClone 2
Listen to this sound and music pack!

User avatar
Mito551
Member
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Post

imo, that's ridiculous. but ok, do it your way. a skill tree would be nice( though i don't think it's possible through lua) with good working skills. like fire ball XD

User avatar
snakevenom
Member
Posts: 119
Joined: Sat Sep 22, 2012 12:56
Location: worthing

by snakevenom » Post

how can you assign ores to give you xp?

tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

Either a) edit init.lua or b) write a mod that redefines the defaults
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

User avatar
SegFault22
Member
Posts: 872
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

Hmm, this could be useful - in the future when an experience system and job system is implemented (RPG forks of minetest), experience can add up as one does something according to their job (knight gives XP for killing mobs/enemies with a sword, giving special abilities like cover and guard as the levels increase; miner gives XP for mining ores and making new pickaxes, could increase drop rate from ores; etc etc etc.), causing them to be able to equip a job and abilities depending on the job (knight/mage gives 1 open slot for abilities and the other is for the default ability of that job; ''bare'' gives 2 free slots for abilities).
Thank you for making this great addition to Minetest.
"All we need it the right major crisis and the nations will accept the new world order."

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

SegFault22 wrote:Hmm, this could be useful - in the future when an experience system and job system is implemented (RPG forks of minetest), experience can add up as one does something according to their job (knight gives XP for killing mobs/enemies with a sword, giving special abilities like cover and guard as the levels increase; miner gives XP for mining ores and making new pickaxes, could increase drop rate from ores; etc etc etc.), causing them to be able to equip a job and abilities depending on the job (knight/mage gives 1 open slot for abilities and the other is for the default ability of that job; ''bare'' gives 2 free slots for abilities).
Thank you for making this great addition to Minetest.
no problem bud, i wrote a better one, i will release it later though
hello, am program. do language in rust. make computer do. okay i go now.

Spirosxk
New member
Posts: 4
Joined: Sun Oct 26, 2014 10:13

Re: [Mod] XP [1.0]

by Spirosxk » Post

Hi
I get this error and the server crashes when i activate the mod in my server. In singleplayer mode is working. I use Minetest version 4.10.

Code: Select all

terminate called after throwing an instance of 'ServerError'
  what():  /home/spiros/.minetest/mods/experience/init.lua:68: attempt to index global 'xp' (a nil value)
stack traceback:
	/home/spiros/.minetest/mods/experience/init.lua:68: in function '?'
	/usr/share/minetest/builtin/game/register.lua:348: in function </usr/share/minetest/builtin/game/register.lua:336>
Aborted

User avatar
DevilRomeoAPLUS
Member
Posts: 38
Joined: Sun Dec 14, 2014 10:53
In-game: DevilRomeo2
Location: Malaysia

Re: [Mod] XP [1.0]

by DevilRomeoAPLUS » Post

Nice Mod
Bananana Banananana *Nom*

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] XP [1.0]

by burli » Post

Is this mod not compatible with better hud and hunger? I tried it and the xp bar is not shown

User avatar
TailsTheFoxDoes MT
Member
Posts: 415
Joined: Mon Jan 18, 2016 20:50
In-game: TailsTheFox
Location: Mobius

Re: [Mod] XP [1.0]

by TailsTheFoxDoes MT » Post

jordan4ibanez wrote:This adds in XP orbs, and rewards from xp.

How does one get xp? Well you have to assign some ores to the group xp=1 for this to work. when you dig an ore with xp=1 group, you get an orb and you just might level up.

a player loses all xp on death.

There is a neat level up sound.

SCREENSHOT
Image

Download

License: dwtfywt
Can u make it work for mobs upon death?
I'm the TailsTMM of minetest, in other words, i rock.
BRAAAAAZZZZAAAA!!!!!!!!!!!!!!!!!!!!!!!!!!!
BTW it means TailsTheMeseMinecart, but that isn't my name, it's just a way of saying that i basically do the same thing Dantdm does but i do it with minetest And you problably can't see the invisible ink.
My mods:
My first mod:tails_boss

Mob_pack now has voice acting! Do you want YOUR VOICE included? Look in my posts for the thread!

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [Mod] XP [1.0]

by D00Med » Post

Really nice mod!
I made some changes, which might be useful.
I made the texture much smaller(to be closer to the default textures) and added a hudbar. Fewer xp is required to gain levels but some of the rewards aren't as valuable(in my opinion).
Also, if anyone wants mobs from mobs_redo to drop experience when they die, add this to line 287 of api.lua in the mobs folder:

Code: Select all

minetest.env:add_entity(pos, "experience:orb")
Attachments
experience(with hudbar).zip
(49.85 KiB) Downloaded 159 times
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
TailsTheFoxDoes MT
Member
Posts: 415
Joined: Mon Jan 18, 2016 20:50
In-game: TailsTheFox
Location: Mobius

Re: [Mod] XP [1.0]

by TailsTheFoxDoes MT » Post

D00Med wrote:Really nice mod!
I made some changes, which might be useful.
I made the texture much smaller(to be closer to the default textures) and added a hudbar. Fewer xp is required to gain levels but some of the rewards aren't as valuable(in my opinion).
Also, if anyone wants mobs from mobs_redo to drop experience when they die, add this to line 287 of api.lua in the mobs folder:

Code: Select all

minetest.env:add_entity(pos, "experience:orb")
ONLY mobs_redo?
I'm the TailsTMM of minetest, in other words, i rock.
BRAAAAAZZZZAAAA!!!!!!!!!!!!!!!!!!!!!!!!!!!
BTW it means TailsTheMeseMinecart, but that isn't my name, it's just a way of saying that i basically do the same thing Dantdm does but i do it with minetest And you problably can't see the invisible ink.
My mods:
My first mod:tails_boss

Mob_pack now has voice acting! Do you want YOUR VOICE included? Look in my posts for the thread!

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [Mod] XP [1.0]

by D00Med » Post

It would have to be placed somewhere else for other mob mods. For creatures, I think you would need to add this into the code for each monster/animal:

Code: Select all

if self.object:get_hp() < 1 then
minetest.env:add_entity(pos, "experience:orb")
end
I haven't tried it though.
For other mob mods it would be similar -just look for the effects after a mobs death and add the code there.
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

MykieDoesStuff
Member
Posts: 136
Joined: Sat Aug 16, 2014 02:44

Re: [Mod] XP [1.0]

by MykieDoesStuff » Post

I got errors...

Code: Select all

2016-06-16 10:35:46: [Main]: Using world specified by --worldname on the command line
2016-06-16 10:35:46: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
2016-06-16 10:35:46: ACTION[Server]: Announcing to servers.minetest.net
2016-06-16 10:35:46: ACTION[Main]: Announcing to servers.minetest.net        .__               __                   __   
2016-06-16 10:35:46: ACTION[Main]:   _____ |__| ____   _____/  |_  ____   _______/  |_ 
2016-06-16 10:35:46: ACTION[Main]:  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
2016-06-16 10:35:46: ACTION[Main]: |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  |  
2016-06-16 10:35:46: ACTION[Main]: |__|_|  /__|___|  /\___  >__|  \___  >____  > |__|  
2016-06-16 10:35:46: ACTION[Main]:       \/        \/     \/          \/     \/        
2016-06-16 10:35:46: ACTION[Main]: World at [C:\Users\Mykhaylo\Desktop\Server\minetest-0.4.14-win64\minetest-0.4.14\bin\..\worlds\Mykie]
2016-06-16 10:35:46: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:30000.
2016-06-16 10:35:57: ACTION[Server]: MykieDoesStuff [192.168.1.1] joins game. 
2016-06-16 10:35:57: ACTION[Server]: MykieDoesStuff joins game. List of players: MykieDoesStuff
2016-06-16 10:35:57: WARNING[Server]: Assignment to undeclared global "xp" inside a function at ...14-win64\minetest-0.4.14\bin\..\mods\experience\init.lua:56.
2016-06-16 10:35:58: ERROR[Main]: Access denied. Reason: This server has experienced an internal error. You will now be disconnected.
2016-06-16 10:35:58: ERROR[Main]: ServerError: Runtime error from mod 'experience' in callback environment_Step(): ...14-win64\minetest-0.4.14\bin\..\mods\experience\init.lua:85: attempt to index global 'xp' (a nil value)
2016-06-16 10:35:58: ERROR[Main]: stack traceback:
2016-06-16 10:35:58: ERROR[Main]: 	...14-win64\minetest-0.4.14\bin\..\mods\experience\init.lua:85: in function <...14-win64\minetest-0.4.14\bin\..\mods\experience\init.lua:82>
2016-06-16 10:35:58: ERROR[Main]: 	...4-win64\minetest-0.4.14\bin\..\builtin\game\register.lua:369: in function <...4-win64\minetest-0.4.14\bin\..\builtin\game\register.lua:349>

Code: Select all

--hudbar
minetest.register_on_joinplayer(function(player)
xp = io.open(minetest.get_worldpath().."/"..player:get_player_name().."_experience", "r")
				experience = xp:read("*l")
				xp:close()
local playername = player:get_player_name()
player:hud_add({
			hud_elem_type = "statbar",
			position = {x=0.5,y=1},
			size = {x=24, y=24},
			text = "experience_hud_bg.png",
			number = 50,
			alignment = {x=0,y=1},
			offset = {x=-300, y=-10},
			}
		)
xp_hud = player:hud_add({
			hud_elem_type = "statbar",
			position = {x=0.5,y=1},
			size = {x=24, y=24},
			text = "experience_hud.png",
			number = experience/20,
			alignment = {x=0,y=1},
			offset = {x=-300, y=-10},
			}
		)
end)

Any fix?
For fast response... send me a PM

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [Mod] XP [1.0]

by D00Med » Post

Aaah serves me right for only testing on my subgame.
I had a quick look, and I don't really know how to fix it, I'll work on it though
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests