christoferlevich wrote:I would like to set up a vote where I can allow players to vote on skipping the night - majority wins... I want to use this in conjunction with the 'bewareofthedark' mod (causes damage to player when in the dark after first draining a sanity hud bar) and it would be an awesome feature on our school server as the kids seem to hate the dark (and will hate it more when they start taking damage by it). I've added 'bewareof the dark' because my school district is heavy on non-violence but the game needed a mechanic to inspire hardcore players.
After all this - all I really need to know are the following things (lol)
1) Are there any tutorials I can review to grasp the concept you've set up better?
2) Is it even possible to do this? Can the VOTE mod skip to the morning?
3) I can envision huge possibilities for this in education. Perhaps I'll figure this out on my own, but I assume if I CAN skip the night with it, I'll be able to reward (or take from) students if I were to use vote for an educational question? (example: 1+1=X, answer options could be 2, 4, 5 (or whatever three options might fit) - if majority votes '2' the whole body of users are given an item - OR - if they vote '5' - they lose something of value (I could take cash, items, etc.)
I hope I am making sense. Every week I spend working in Minetest, then go back and read my posts, I realize I am asking a lot of questions that I end up answering just by trying stuff. Makes me look a little whacked sometimes, but its a great way to learn in the event that I am trying to 're-invent' the wheel. Thank you for your work! You're awesome for MT!
yes, this is a generic API to make voting on things easy.
See here for an example to register a vote which passes if 80% agree:
https://github.com/rubenwardy/vote_kick ... r/init.lua
You'd need to change the onSuccess action from kick to day skip, and change 0.8 to 0.5 to get a 50% pass rate, and also rename it (ie: you don't want it to be called "kick")
If you have any more questions, please ask - I gtg.
The API documentation is in the README, it's more of a reference than a tutorial however:
https://github.com/minetest-mods/vote