Page 4 of 6

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Mon May 05, 2014 20:42
by minermoder27
I have some code that can display awards in a tree, and can find that code for you if you like

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Tue May 06, 2014 09:21
by Calinou
Carbone implemented this mod, with added achievements and fixes, feel free to take the changes.

https://github.com/Calinou/carbone/tree ... ods/awards

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Tue May 06, 2014 22:11
by 4aiman
rubenwardy wrote:
4aiman wrote:Neat :)
Any chance prerequisites would be shown?


A progress bar will be added in the next version, but the description should explain what to do.


What I've meant is a way to show a map of achievements of some sort. Like in my version one have to have "Upgrade2" to be able to receive "Upgrade3".

rubenwardy wrote:
kaeza wrote:Request: Use HUD instead of Formspecs.
Suppose you are struggling with a vombie, or worse, a DM, and you place your 100th torch...


When I made this mod, there were no such things as HUD elements. But I will add them soon.

Noooo!!! That'll ruin my fork!!!....
Just kidding, I owe you big time.
I'll be glad to see this develop.

Does your custom triggers support timer-triggered events?
What I mean is the ability to create achievement that'll be unlocked ANYTIME a modder want. Say, I pick up an uranium lump. I't MY duty to start the timer. But is it possible to give an award for a player when MY timer hits some time I have chosen?
Can I use smth like give_award(player, 'Hulk SmAaAAaaaSh!!!')?
Like having some item in the inventory, say, uranium, would)

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Wed May 07, 2014 07:56
by rubenwardy
4aiman wrote:What I've meant is a way to show a map of achievements of some sort. Like in my version one have to have "Upgrade2" to be able to receive "Upgrade3".


Oh, I see. That is an interesting idea. Currently, you can unlock any achievement as long as you fullfil the requirements. I can functionality that only unlocks an award when a specified set of awards are all unlocked.

For example:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
awards.register_achievement("award_mine3",{
   title = S("Hardened Miner"),
   description = S("You have dug 1000 stone blocks"),
   icon = "miniminer.png",
   background = "bg_mining.png",
   requires = {"award_mine1", "award_mine2"},
   trigger = {
      type = "dig",
      node = "default:stone",
      target = 1000
   }
})


As for displaying this, the awards could be grouped together and only the newest/best awards shown. Or it could be in a tree view like the mod manager. Or it could be in a graphical tree, but that would be hard to do.

4aiman wrote:Does your custom triggers support timer-triggered events?
What I mean is the ability to create achievement that'll be unlocked ANYTIME a modder want. Say, I pick up an uranium lump. I't MY duty to start the timer. But is it possible to give an award for a player when MY timer hits some time I have chosen?
Can I use smth like give_award(player, 'Hulk SmAaAAaaaSh!!!')?
Like having some item in the inventory, say, uranium, would)


You can use:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
awards.give_achievement(name, award)


Where name is the player name, and award is the achievement name. This allows you to register your own triggers.

Also, in order to register table triggers, you can use this: https://github.com/rubenwardy/awards/bl ... pi.lua#L76
The code explains it in a comment.

A table trigger:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
trigger = {
   type = "place",
   node = "default:torch",
   target = 100
}

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Wed May 07, 2014 10:49
by 4aiman
Aha.. Thanks!
Now I can throw my version away :)

Showing the last one achieved sounds good for me. This way achievements may be not just a list of, well, achievements, but some sort of help to distinguish different ranks:
killed 1 mob = awarded "Soldier"
killed 10 mobs = awarded "Lieutenant"
killed 100 mobs = you're a "General"
killed 1000 mobs = you're a "Commander-in-Chief"
Or smth like this.

Just one more little question: I've looked through the code and feel unsure about this:
Say, I want to add on_craft trigger...
There's no such type of triggers. So, table ones won't do. Am I to use awards.give_achievement() wrapped by my code in my mod?

Other than this, I have to try this new version to be able to ask the right questions for anything else I'm not sure about, I guess.
Great work, rubenwardy! Regards!

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Sat May 17, 2014 21:42
by Amaz
Have you thought about adding support for groups in various awards? For group:wood for one maybe?
And also, what about a craft award? And is their a way to add a way for killing mobs?
I could try to implement the first myself... Sorry for all of the requests!

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Sun May 18, 2014 15:46
by rubenwardy
Amaz wrote:Have you thought about adding support for groups in various awards? For group:wood for one maybe?
And also, what about a craft award? And is their a way to add a way for killing mobs?
I could try to implement the first myself... Sorry for all of the requests!


I could do that. It would complicate the code. I might have to add a function like:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
awards.watch_node( group or itemname )


to save space in the recording tables. (Don't count if no awards use it).


About the mobs, you could add it. Not sure about the simple mobs or mobf side of it, though.

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Tue May 20, 2014 06:06
by Pitriss
Maybe you can add archivements based on time online?

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Tue May 20, 2014 07:46
by 4aiman
Pitriss wrote:Maybe you can add archivements based on time online?

I think the best way is to depend on Rubenwardy's awards to do things like that.
How 'bout separating API from all achievements? I mean 2 separate mods in a single modpack.
Then the part with achievements only could use a few github pushes.

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Mon May 26, 2014 12:09
by Thedarksoldier
fix this its not working

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Mon May 26, 2014 12:24
by Thedarksoldier
pls fix this

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Mon May 26, 2014 13:21
by Evergreen
Thedarksoldier wrote:fix this its not working

Listen, how do you expect someone to fix something if you give no information as to what is wrong. Give us some info as to what is not working.

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Mon May 26, 2014 15:22
by rubenwardy
Thedarksoldier wrote:fix this its not working


I can't fix anything if I do not know what is wrong

  • Does it crash?
    • Copy the last 20 lines of debug.txt into this topic
    • Explain what you were doing at the time
  • Does it just not work, no crashes?
    • Type /mods in to the chat, and look for "awards". If it is not there, then you have not installed it correctly.
    • If it is there, explain what it is not doing properly.

Re: [Mod] Achievements [0.4] [awards] - awards menu

PostPosted: Wed May 28, 2014 08:05
by 4aiman
Thedarksoldier wrote:fix this its not working

You're probably new here.
Please, post the console output after "Error from lua".
Also describe what isn't working in particular.
Regards!

Edit: How can I delete my message? Firefox's cache fooled me into thinking there were no answers...

0.5 Released!

PostPosted: Fri Sep 26, 2014 18:58
by rubenwardy

0.5 Released!


License has changed to GPL 3.0 or later.
  • Use HUD instead of formspec
  • Back port awards from Calinou's Carbone/Awards
  • Remove pointlessly easy awards or make them harder
  • Add API support for players receiving prizes, such as blocks and items, when unlocking awards (not currently used by any awards)

Image

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Fri Sep 26, 2014 19:27
by MaxPower
Cool I was just mentioning it earlier today :D
https://forum.minetest.net/viewtopic.php?f=15&t=9033&start=100#p155616

Cheers

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Fri Sep 26, 2014 19:32
by rubenwardy
Calinou brought it to my attention, which is why I updated it.

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sat Sep 27, 2014 10:06
by MaxPower
Work perfectly, thank you

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sat Sep 27, 2014 18:27
by jp
Just an idea : a gift added in the invo on each achievement reached.

Examples :

- Dug 1.000 stones ("Miner Beginner") -> Mese Pickaxe.
- Dug 10.000 stones ("Pro Miner") -> Diamond Pickaxe.
- Dug 50.000 stones ("Legendary Miner") -> Diamond Block.

etc.

EDIT : already in the TODO, sorry.

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sat Sep 27, 2014 20:52
by rubenwardy
Gift support has been added in 0.5. It is called prizes. No awards give prizes ATM, but it as simple as adding this to an award definition:

prizes = {"default:stone 99"}

Giving tools is quite a good idea.

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sat Sep 27, 2014 21:52
by MTDad
Thank you for this!
I think my kids are going to love this one. I'm already plugging in prizes for them to win.

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sun Sep 28, 2014 12:20
by Minetestforfun
Hi rubenwardy,

Thank you for your mod and for your work with HUD,
i meet a syntax problem with the "prizes = {"default:stone 99"}" line,
Can you give me an example for a full award ?
Can i give other prizes like :
- "prizes = {"moreblocks:super_glow_glass"}
- "prizes = {"maptools:superapple"}
- etc...
?

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sun Sep 28, 2014 18:20
by MTDad
minetestforfun, don't forget the comma. I always forget the comma and have to go back after it fails to load.

For example I plugged " prizes = {"homedecor:trophy 1"}, " into the "dying spree" award. I think you can use anything you want from any mod you run, only trouble would come if you later disable a mod that had an item as a prize.

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sun Sep 28, 2014 18:41
by rubenwardy
You can also give multiple items

prizes = {"default:stone 99", "default:mese", "default:nyancat"},

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sun Sep 28, 2014 19:26
by Minetestforfun
Thank you for your answers, i had forget one comma, my bad :/...

for prizes, Items from other mods are possible ? (maptools / moreblocks / etc ?)

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sun Sep 28, 2014 19:28
by rubenwardy
Any items can be used. It is just an item string/code.

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sun Sep 28, 2014 20:50
by Minetestforfun
After many try, everything work for "default" prizes, but with prizes from this mods :
- prizes = {"moreblocks:super_glow_glass 5"},
- prizes = {"maptools:superapple"}
- prizes = {"maptools:superapple 2"}
- prizes = {"maptools:superapple 10"}
- prizes = {"bucket:bucket_water"}

It doesn't work, maybe my code isn't good ? Please, can you check ?

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sun Sep 28, 2014 22:09
by rubenwardy
It uses the code copied from /giveme to do the prices. if you can do /giveme to those items, it should work.

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Sun Sep 28, 2014 22:31
by Minetestforfun
i can giveme this items but, it doesn't work with the mod awards...
"/giveme maptools:superapple 10" work fine...

Re: [Mod] Achievements [0.5] [awards] – HUD

PostPosted: Tue Dec 22, 2015 19:07
by im-poke
noob
place 100000 blocks of leaf