Page 1 of 1

[Mod] Vote Block [vote]

PostPosted: Tue Feb 14, 2017 18:20
by JoshMars
Ten minutes of googling got me nothing, so I stitched this nice little mod together. This mod adds a vote block. It can be configured to have 5 options, and one question. After submitting, anyone can vote (including the owner) howbeit only once.

Edit: Options left empty are removed when the form is submitted for voting.

Depends: None.
GitHub: https://github.com/joshuamars/minetest-mod-vote
Download: https://github.com/joshuamars/minetest-mod-vote/archive/master.zip

Re: [mod] Vote Block [vote]

PostPosted: Tue Feb 14, 2017 18:33
by rubenwardy
A mod with this mod name already exists - please rename to voteblock

viewtopic.php?t=12829

Re: [mod] Vote Block [vote]

PostPosted: Tue Feb 14, 2017 19:13
by JoshMars
Lol ok

Re: [Mod] Vote Block [vote]

PostPosted: Tue Feb 14, 2017 22:12
by Tmanyo
I made something like this for a server I host around election time.

Re: [Mod] Vote Block [vote]

PostPosted: Wed Feb 15, 2017 17:37
by rubenwardy
It appears you changed the name back

Re: [Mod] Vote Block [vote]

PostPosted: Wed Feb 15, 2017 19:05
by Peppy
Hi,
Very interesting mod !

A few few suggestions :
- Calling this mod "Poll" or "Simple Poll", would avoid confusion.
- Unused answers in the poll (blank or left to default) should not appear in the list when voting.
- intllib support (I already did this localy, i might help...)
- Maybe an expiry time.

Thanks.

Re: [Mod] Vote Block [vote]

PostPosted: Wed Feb 22, 2017 00:36
by BBmine
Nice mod for my birthday :D (My BD is on Feb 14)

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 10, 2017 21:24
by JoshMars
Updated: empty options are removed on poll submit.

Re: [Mod] Vote Block [vote]

PostPosted: Sat Mar 11, 2017 15:27
by Peppy
This mod seems to be broken now :(
I can fill the form but I can't vote, black form is shown.

luacheck utility throws more errors than previous version, complaining about unused variables.
I'll try to give more information later.

Anyway, I made replacement images for the poll and wield image (Licence CC BY).
It needs this code to display properly :

Code: Select all
node_box = {type="fixed",fixed={-0.5,-0.5,0.5,0.5,0.5,0.45}},

Re: [Mod] Vote Block [vote]

PostPosted: Sat Mar 11, 2017 15:31
by rubenwardy
You still need to rename this mod

Using the same name breaks the dependency system - no longer does depending on "vote" mean your depending on the API provided by my mod.
It also leads to user confusion, by having two mods that work drastically differently called the same thing. For example, a user may look in depends.txt and then install the wrong mod.
It also leads to potentially confusing conflicts, for example one of our mods overriding the other in load order eg: if one is in the subgame, and the other is in the mod folder.

To change your mod's name, change [vote] to something else such as [voteblock], then replace all instances of vote in your mod to the new name. This includes node names and variable names.

Re: [Mod] Vote Block [vote]

PostPosted: Sat Mar 11, 2017 20:38
by JoshMars
lol too much work. Do it yourself and Ill pull it.

Re: [Mod] Vote Block [vote]

PostPosted: Sat Mar 11, 2017 20:39
by JoshMars
Fixed the blank dropdown issue

Re: [Mod] Vote Block [vote]

PostPosted: Thu Mar 16, 2017 09:00
by Peppy
The Options won't accept comas anymore, this is a problem for me.

Need mod name change too...

Thanks.

Re: [Mod] Vote Block [vote]

PostPosted: Thu Mar 16, 2017 12:14
by JoshMars
I need a function to escape out characters like that.

Re: [Mod] Vote Block [vote]

PostPosted: Thu Mar 16, 2017 15:41
by bell07
Code: Select all
minetest.formspec_escape(text)

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 17, 2017 01:32
by JoshMars
Wow lol. I rlly should read that methods page on the wiki

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 17, 2017 19:48
by JoshMars
Added minetest.formspec_escape -- thanks bell07

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 17, 2017 20:47
by Wuzzy
@rubenwardy: We definitely should make it a requirement for mods to have an unique name before they are allowed to be moved to Mod Releases, unless there is a VERY good reason for using a duplicate name.
Ignorant modders refusing to use an unique name should not be rewarded by moving their mods to Mod Releases.

Ten minutes of googling got me nothing

Google is useless for finding Minetest mods. Use this search engine instead:
http://krock-works.16mb.com/MTstuff/modSearch.php

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 17, 2017 21:03
by JoshMars
lol wuzzy that search engine is useless too. I actually try that first.

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 17, 2017 21:04
by JoshMars
Ooh, btw, rubenwardy should change his mod name to [votekick], because it is misleading.

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 17, 2017 22:31
by Wuzzy
JoshMars wrote:lol wuzzy that search engine is useless too. I actually try that first.

What are you talking about? Typing in “vote” yields the correct result:

http://krock-works.16mb.com/MTstuff/mod ... t=0&q=vote

Both rubenwardy's and your mod appear.

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 17, 2017 23:35
by Peppy
JoshMars wrote:Ooh, btw, rubenwardy should change his mod name to [votekick], because it is misleading.

Rubenwardy's mod thread title says :
[Mod] Vote (with Kick voting) [0.1] [vote] - an API

What is misleading ?

Re: [Mod] Vote Block [vote]

PostPosted: Fri Mar 17, 2017 23:45
by rubenwardy
JoshMars wrote:Ooh, btw, rubenwardy should change his mod name to [votekick], because it is misleading.


Kick is an example, the main part of the mod is the vote api
Like how awards provides default awards

Re: [Mod] Vote Block [vote]

PostPosted: Sat Mar 18, 2017 15:40
by JoshMars
wuzzy I meant I was looking for a mod that was a block that you could vote from, and I couldn't find one. Obviously rubenwardys [vote] is not what I was looking for.

Re: [Mod] Vote Block [vote]

PostPosted: Mon Aug 20, 2018 15:57
by Isja Krass
like this mod so mutch! :-)

Image