Page 1 of 9

[Mod] Awards / Achievements [3.2.0] [awards]

Posted: Fri Feb 22, 2013 19:09
by rubenwardy
Image

This mod adds achievements to Minetest. Use the inventory tab or /awards to see your awards.

Download - Browse the Code

License: MIT
Dependencies: none.
Spoiler
Features
  • Works on multiplayer
  • Counts how time a player has dug, placed, died, joined, chatted, crated.
  • Flexible API, that allows a developer to:
    • register an achievement type
    • Give a single simple trigger when registering an achievement type
    • and/or register a function to determine if the player gets an achievement, on multiple conditions
    • a global give_achievement function that external mods can use to give players achievements
    • register their own triggers externally using register_trigger.
  • Player can use /awards function to see their achievements (use /cawards if you want the old chat response)
Todo
  • Some way of doing time triggers for functions

Posted: Fri Feb 22, 2013 19:26
by PilzAdam
Might be helpful: https://gist.github.com/PilzAdam/4540471
I would also add a function "give_achievement". Mods could use this on every callback, so achievements like "Taking damage" can also be created.

Posted: Fri Feb 22, 2013 19:31
by Likwid H-Craft
Well done rubenwardy, :) now what the Testing start!

Hey you think I can make this work for my Portaltest?

Posted: Fri Feb 22, 2013 21:32
by KingSmarty
So you actually have to do the achievments first right? Because there are no values (? sorry i'm from Germany donn't no how to spell value)

Posted: Fri Feb 22, 2013 21:55
by tom_blue
Achievement Get: Close Call
Go all the way down to half a heart and survive

Posted: Fri Feb 22, 2013 22:46
by Mito551
KingSmarty wrote:So you actually have to do the achievments first right? Because there are no values (? sorry i'm from Germany donn't no how to spell value)
value is the correct spelling
tom_blue wrote:Achievement Get: Close Call
Go all the way down to half a heart and survive
lol

Posted: Fri Feb 22, 2013 23:51
by Josh
Achievment Get: You Hacker You!
Use /giveme air

Posted: Sat Feb 23, 2013 00:25
by Likwid H-Craft
Tested Appove:Sky is the limt. (Minetest Achievment Get title)
Build a house tall as the sky limt.

Posted: Sat Feb 23, 2013 09:30
by rubenwardy
KingSmarty wrote:So you actually have to do the achievments first right? Because there are no values (? sorry i'm from Germany donn't no how to spell value)
There are currently only two achievements:

--> First Mese Find (digging a mesE)

--> Foundations (placing a brick)

Posted: Sat Feb 23, 2013 10:22
by Gambit
Likwid H-Craft wrote:Tested Appove:Sky is the limt. (Minetest Achievment Get title)
Build a house tall as the sky limt.
What constitutes as a house in this mod? Also there is no limit! D;
rubenwardy wrote:There are currently only two achievements:

--> First Mese Find (digging a mesE)

--> Foundations (placing a brick)
Those are kinda easy. Achievements should be challenging like I said. What about those ideas Chinchow and I laid out in the other thread?

My Ideas for Achievements:
  • "Lumber Jack" - Cutting 100 tree blocks.
  • "Light It Up" - Place 100 torches.
  • "Survivalist" - Survive the world without the use of Chest or Furnace for 50 day cycles.

Chinchow's Ideas for Achievements:
  • Lasted 50 days without dying=Living Life
  • Collected 10 lava buckets=Get it while its hot!
  • Mined 10000 stone=Massive miner
  • Mined 1000 stone=Adequate Miner
  • Mined 100 stone=Mini Miner
  • Mined 10 stone=Just entered the mine
A "Foundation" shouldn't be laying down a brick. It should be something like: Flattening a 100x100 of land.

Achievements should make players sweat for once.

Posted: Sat Feb 23, 2013 11:18
by rubenwardy
The ones I created were just for testing if the code works.

I will add all of these eventually.

Posted: Sat Feb 23, 2013 11:53
by Linxx
Gambit wrote:
Likwid H-Craft wrote:Tested Appove:Sky is the limt. (Minetest Achievment Get title)
Build a house tall as the sky limt.
What constitutes as a house in this mod? Also there is no limit! D;
rubenwardy wrote:There are currently only two achievements:

--> First Mese Find (digging a mesE)

--> Foundations (placing a brick)
Those are kinda easy. Achievements should be challenging like I said. What about those ideas Chinchow and I laid out in the other thread?

My Ideas for Achievements:
  • "Lumber Jack" - Cutting 100 tree blocks.
  • "Light It Up" - Place 100 torches.
  • "Survivalist" - Survive the world without the use of Chest or Furnace for 50 day cycles.

Chinchow's Ideas for Achievements:
  • Lasted 50 days without dying=Living Life
  • Collected 10 lava buckets=Get it while its hot!
  • Mined 10000 stone=Massive miner
  • Mined 1000 stone=Adequate Miner
  • Mined 100 stone=Mini Miner
  • Mined 10 stone=Just entered the mine
A "Foundation" shouldn't be laying down a brick. It should be something like: Flattening a 100x100 of land.

Achievements should make players sweat for once.
the achivements sounds nice and al but aren't they a bit... too much they look more like a chore they require a lot and not a really good reward... i mean completionists might like it but the rest might not since it asks too much...

Posted: Sat Feb 23, 2013 12:05
by rubenwardy

Version 0.1 Release

I have done enough to release it as 0.1

To register an achievement, a mod can call:

Code: Select all

awards.register_achievement("award_mesefind",{
     title = "First Mese Find",
     description = "Found some Mese!",
     trigger={
          type="dig",  --award is given when
          node="default:mese", --this type of node has been dug
          target=1, --this number of times
     },
})

Posted: Sat Feb 23, 2013 12:30
by BZab
Maybe sb could build website, on which player's achivements could be... collected(?)/showed(?)

"Ace of spades" - dig 6666 dirt nodes using wooden spade

Posted: Sat Feb 23, 2013 12:51
by Likwid H-Craft
I think that a cool idea BZab, but having a site, keep track of everything, it will need a custom html and all.

Posted: Sat Feb 23, 2013 12:56
by rubenwardy
BZab wrote:Maybe sb could build website, on which player's achivements could be... collected(?)/showed(?)
I might do something like this in the near future, but I think it would be better if I just worked on the mod for now, and make it perfect. Plus I have "minetest extensions" to work on
Likwid H-Craft wrote:I think that a cool idea BZab, but having a site, keep track of everything, it will need a custom html and all.
"custom html" is not that hard, when making Minetest websites I use minetest.net's html.

It is the server side php that is the problem.

Posted: Sat Feb 23, 2013 13:01
by Likwid H-Craft
So what I program ruben to make my own, or change?

Posted: Sat Feb 23, 2013 13:04
by rubenwardy
Likwid H-Craft wrote:So what I program ruben to make my own, or change?
All the current achievements are coded in init.lua

Code: Select all

awards.register_achievement("award_mesefind",{
     title = "First Mese Find",
     description = "Found some Mese!",
     trigger={
          type="dig",  --award is given when
          node="default:mese", --this type of node has been dug
          target=1, --this number of times
     },
})

Posted: Sat Feb 23, 2013 13:09
by Likwid H-Craft
what about the other file? or is it fine how is...Well ok then use init.

Oh and next there should be imgs... maybe for 0.2 or 0.5

Posted: Sat Feb 23, 2013 13:11
by jojoa1997
I just had an awsome idea

Code: Select all

awards.register_achievement("award_mesefind",{
     title = "First Mese Find",
     description = "Cheater!",
     trigger={
          type="dig",  --award is given when
          node="air", --this type of node has been dug
          target=1, --this number of times
     },
})

Posted: Sat Feb 23, 2013 13:15
by rubenwardy
Likwid H-Craft wrote:what about the other file? or is it fine how is...Well ok then use init.

Oh and next there should be imgs... maybe for 0.2 or 0.5
If you want to add an image, add

Code: Select all

image = "name",
after

Code: Select all

description = "Found some Mese!",
There is no way to render the images on the screen, but when there is, image="name" will be used.

http://forum.minetest.net/viewtopic.php?id=4168

Posted: Sat Feb 23, 2013 14:47
by rubenwardy
I have added some "real" achievements
  • "Lumber Jack" - Cutting 100 tree blocks.
  • "Light It Up" - Place 100 torches.
  • "Master Miner" - Mined 10000 stone
  • "Hardened Miner" - Mined 1000 stone
  • "Mini Miner" - Mined 100 stone
  • "Just entered the mine" - Mined 10 stone
and deleted the foundation achievement

Posted: Sat Feb 23, 2013 15:06
by Likwid H-Craft
Yeah only if we, can make a hidden craft achievement, form making a item, that don't show in list, but I think we can't yet.

Posted: Sat Feb 23, 2013 15:15
by rubenwardy

Version 0.2 Released

API additions
  • onDeath counter
Added achievements:
  • "Lumber Jack" - Cutting 100 tree blocks.
  • "Light It Up" - Place 100 torches.
  • "Master Miner" - Mined 10000 stone
  • "Hardened Miner" - Mined 1000 stone
  • "Mini Miner" - Mined 100 stone
  • "Just entered the mine" - Mined 10 stone
  • "First death" - die once

Posted: Sat Feb 23, 2013 15:36
by Likwid H-Craft
Some I did :)

Fire Achievements 0.1

Code: Select all

-- First Fire
awards.register_achievement("award_fire1",{
    title = "First Fire",
    description = "You have start yours first fire.",
    trigger={
        type="place",
        node="fire:basic_flame",
        target=1,
    },
})

-- 100 Fire Starter
awards.register_achievement("award_fire2",{
    title = "100 Fire Starter",
    description = "You have started 100 fires...BURN!",
    trigger={
        type="place",
        node="fire:basic_flame",
        target=100,
    },
})

-- Set the world on Fire.
awards.register_achievement("award_fire3",{
    title = "Set the world on Fire.",
    description = "You have started 1000000000 fires...BURN BABY BURN!",
    trigger={
        type="place",
        node="fire:basic_flame",
        target=1000000000,
    },
})
Only if there was way, can make it when water placed and take out fire, will give you a Achievement.