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

Post Reply
User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

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
Last edited by rubenwardy on Mon Aug 01, 2016 23:42, edited 26 times in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

by PilzAdam » Post

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.

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

Well done rubenwardy, :) now what the Testing start!

Hey you think I can make this work for my Portaltest?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

User avatar
KingSmarty
Member
Posts: 85
Joined: Wed Jan 02, 2013 12:06
GitHub: FsxShader2012
In-game: FsxShader2012
Location: Germany

by KingSmarty » Post

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)
Last edited by KingSmarty on Fri Feb 22, 2013 21:33, edited 1 time in total.

tom_blue
New member
Posts: 1
Joined: Fri Feb 22, 2013 21:51

by tom_blue » Post

Achievement Get: Close Call
Go all the way down to half a heart and survive

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

by Mito551 » Post

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

Josh
Member
Posts: 1146
Joined: Fri Jun 29, 2012 23:11
Location: Victoria, Australia

by Josh » Post

Achievment Get: You Hacker You!
Use /giveme air

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

Tested Appove:Sky is the limt. (Minetest Achievment Get title)
Build a house tall as the sky limt.
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

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)
Last edited by rubenwardy on Sat Feb 23, 2013 11:19, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Gambit
Member
Posts: 453
Joined: Sat Oct 29, 2011 19:31
Location: United States

by Gambit » Post

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.
Current Projects: MineToon | PixelBOX
Gambit's Checkmate Server - 43.65.296.232 - port: 30001

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

The ones I created were just for testing if the code works.

I will add all of these eventually.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Linxx
Member
Posts: 406
Joined: Wed May 16, 2012 00:37

by Linxx » Post

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...

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

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
     },
})
Last edited by rubenwardy on Sat Feb 23, 2013 12:06, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

BZab
Member
Posts: 126
Joined: Mon Jan 28, 2013 10:04
Location: Poland

by BZab » Post

Maybe sb could build website, on which player's achivements could be... collected(?)/showed(?)

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

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

I think that a cool idea BZab, but having a site, keep track of everything, it will need a custom html and all.
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

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.
Last edited by rubenwardy on Sat Feb 23, 2013 12:56, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

So what I program ruben to make my own, or change?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

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
     },
})
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

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
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

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
     },
})
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

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
Last edited by rubenwardy on Sat Feb 23, 2013 13:15, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

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.
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

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.
Last edited by Likwid H-Craft on Sat Feb 23, 2013 15:42, edited 1 time in total.
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests