[Script] [Multiplayer] Monarchy
Monarchy is a hedgewars minigame intended for a group of 4 or more players. The rules are based on classic card games.
Abilities
On game's first round, players are asked to choose 1 out of 2 randomly given abilities. The chosen abilities are displayed next to the health bar of the corresponding teams. The description of the abilities can be read during the selection phase and later in the mission text, either by pressing Esc or holding M. Two teams can't have the same ability.
Weapons
At the end of your turn, you get 2 random weapons. Weapons are retained between turns. Teams are limited to 5 weapons.
Room host can set which weapons are available during the game through the weapon settings. A weapon with 2 bullets will be twice as likely than a weapon with 1 bullet, and so on. Delay of weapons and content of crates can be customized as usual in the corresponding tabs.
Roles
If there are 4 or more players, Monarchy is played with roles.
Each player receives a secret role at the start of the game. Players only know their role and who is the monarch. The goal of the game is determined by your role.
- Monarch: Eliminate all the assassins and traitors.
- Assassins: Eliminate the monarch.
- Guards: Same goal as the monarch.
- Traitors: Become the last standing player, eliminating the monarch at last.
Players get an extra turn for eliminating an assassin.
The monarch loses all weapons for eliminating a guard.
Parameters
Parameters can be separated by comma, space, comma and space, or anything really.
- ffa: Free-for-all variant. No roles. The last standing player wins.
- multi: Multiple abilities. Get 3 options choose 2.
License
MIT.
Download
v18 is here https://hedgewars.org/content.html. Ask THX1138 for v19. SHA512 checksum of v19 is 893d7313c8569f7dc619de5cfdd04ca742d37df76f8304ccd091237d507478e07403f237d9956eb2888a846df700b01895481f24b99243305bde2287daff1671.
Awesome! Thanks for posting it here.
It was fun playing this with you.
The ability name “karma” is misleading because in Hedgewars, karma normally means that the attacker gets damage by attacking any hog. Karma is something negative for the attacker if it has it.
The type of karma used in your script can be more seen as a defensive/revenge measure because its not hog with karma which gets damaged by attacking others. I would rename it to “Anti Karma”, “Revenge”, “Revenge Karma” or whatever.
I suggest you to add version numbers of the form “_v”, e.g. “Monarchy_v1”.
To avoid future confusion with future version. I do not believe in the concept of “final“ versions. :P
By posting this on hh.unit22.org, this script would theoretically automatically appear in DLC (indirectly) as well because there's a link to hh.unit22.org in DLC at the moment.
However, since bender doesn't seem to review regularily review anything, it is not visible. Probably poke bender about this.
I am currently still unable to add anything on DLC, sorry.
Maybe I'll write a full review about this script later. No promises, however.
Hi, I am a Hedgewars developer.
My themes / Theme Editor / Code contributions /
Dank
Nemo pointed me to a questionable coding practice you used in the Monarchy script. First I quote the chat log:
So basically the problem nemo (and I) have about this script is that you are using non-standard gear states and check against them. This is a bad idea because we reserve the possibility to later add new gear states into Hedgewars. As soon we release a new HW version with a new gear state, your script will almost certainly break.
In other words, your script is not forwards-compatible.
Also note it is NEVER neccessary to add fake gear states like you do.
I suggest to remove all “custom” gear states. To save and read values for gears, I suggest you use the Lua library “Tracker.lua” included in Hedgewars. Please read this:
https://hedgewars.org/kb/LuaLibraries#Tracker
So instead of saving the fake gear state “gstHHTJump”, you can use a gear value using this library instead, which you could just set to 1 or 0 (on or off). The same applies for the other fake states, of course.
Hi, I am a Hedgewars developer.
I link here to the script without custom gear states. It also uses SetAmmoTexts() and GetAmmoName().
Edit This post had an old pastebin link that's no longer active.
Nice.
There's a small bug, however: The bottom part of the ammo panel still shows “Air Attack”, etc.
Sorry, there was incomplete documentation on SetAmmoTexts. I have updated it accordingly.
It is not allowed to call SetAmmoTexts before onGameStart has been fired. You can either call SetAmmoTexts in onGameStart, or at any later point. But not before.
In your case, simply move all SetAmmoTexts stuff into onGameStart and the bug is fixed.
I would also slightly rewrite the texts. First, add punctation / use complete sentences.
Second, write the ammo description it in this form to make it (hopefully) a bit clearer to the user:
Annoyingly, there is still this “unavailable” message at the bottom but currently there is not much you can do about it.
I think we can both agree that using this ammo menu to display the player's role is a hack. A clever hack, but still a hack.
In the long future, I should probably look into ways to display information in a way so only one player can see it. But this is pretty low priority for me right now.
Hi, I am a Hedgewars developer.
The problem are the sentences that should be localized but have a subject that varies. Example "hedgehog1 has killed an anarchist clan". It could be hedgehog1 or hedgehog2 or Crosby. That line has become "An anarchist clan died". Analogously the knights line.
The sentences in the end screen were like "Team_name (clan chosen) was royalty". It has become now "Team_name (clan): role" to avoid the loc("was") in the middle.
The former sentences in the mission were split in two lines, which makes them impossible to localize in some languages. They now lay in a single line.
Edit This post had an old pastebin link that's no longer active.
String concatenation is the translator's worst enemy.
string.format
is your friend. This solves all problems related to string ordering.I used this function extensively in many of my own scripts, and used it to fix translation issues in the official scripts.
Hi, I am a Hedgewars developer.
We tried today.
Was nice
Got some LUA ERROR a few turn before the end of game.
Here you can get game log, demo and even chat text.
https://envoi.zaclys.com/remise/795ae6620ee1017374e1fce4b53ea350/2019-01-29_game0_log_and_chat_text_and_demo.zip
Why can't we wrap the border?
The error was due to an attempt to check if dead hogs with amphibious were in water during water rise on sudden death. This is done comparing coordinate Y of hogs: if it is below water line, it relocates the hog on land. Since dead hogs have no Y coordinate, Lua interpreter whines. Already fixed.
I noticed in this demo that I overlooked switcher + ice coat. Fixed that too. I will upload the next version within a few days.
With regard to border, it was set to none in the scheme according to game log, line 154.
It should say:
Just change it to wrap, should work.
Thanks for the report. And glad you like the mode.
Thanks, about wrap border I wasn't host and didn't check before telling you what host told me, sorry.
Monarchy is fun, thanks to you Tiotimolina.
Waiting to play it again, maybe with you.
AC and I complain about the lack of fine tuning advices:
[19:22] plarf: gimme your "Mona" scheme settings
[19:22] AC: pas encore!
[19:22] AC: oh
[19:23] AC: i dont know
[19:23] plarf: thx
[19:23] AC: they are probably original
[19:23] AC: timolina has not been very good on teaching out how to set this game up
Thanks bro
Done. New version will suggest Default as the scheme and One of Everything as the weapons. Balanced Random Weapons and Highlander are good options too.
After in game chat yesterday.
We randomly get 2 weapons, sometimes get 2 utilities. Then if we didn't stock older weapons, we won't be able to do anything next turn. As in BRW, it would be nice to be sure to get at least on attack weapon every turn.
For example yesterday, after a turn I used all my stuff, I get low gravity (x2). At this really moment, I didn't know if I wanted to ragequit or cry (so I did both).
Miiip Miiip
New thing: irregular thorns damage spotted.
Testing 1.0.0 alpha, the attacking hog get damaged because thorns, and he dies right when his life came to 0, without any direct damage and before the end of turn time.
I don't think it's a purpose thorns behaviour.
at 3mn30s, when apple attack with melon.
https://envoi.zaclys.com/remise/3b6801eb4784e46036322169922f8ea4/2019-06-29_14972.zip
yo,
Monarch AC get an error at 17mn40. Idk if it is Monarchy related bug...
Other players were able to end the game.
https://envoi.zaclys.com/remise/20127e4b2895e9f531ed61c0fc2cd1c5/2019-07-04_error.zip
It is now ensured at least one damaging weapon. Also, vampires will not receive the vampiric tool and switch-hedgehogs will not receive switches.
Seems that's how karma works in hedgewars 1. The classic behavior can be hardcoded in mona if you all prefer it.
I am used, when I have to fight against a thorns team, to wait until I have many and/or powerful weapons. I then sacrifice a hedgehog to do as much damage as possible.
I therefore prefer the 0.9.25 way (more balanced).
Wait for more opinion.
you can DL last version here:
https://hh.unit22.org/addons/Script/Monarchy_v15/
New v16
https://hh.unit22.org/addons/download/addon/1469/Script_Monarchy_v16.hwp
I have a bug. Traitor wins after killing 2 assassins and all but 1 monarch hog.
Demo file.
New v17
https://hh.unit22.org/addons/Script/Monarchy_v17/
Are we getting to point of a stable release monarchy?
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
https://hh.unit22.org/addons/Script/Monarchy_v18/
Picking ice and puppetry at the same time breaks puppetry (you can't change the puppeted hog).
Also feature request: would be nice if Monarch would be opt-in, not opt-out, so the game is not ruined for everyone every time a noob gets to choose.
I wish collecting HP boxes would revive an eliminated Pick Up player, as Pick Up is kinda underwhelming now even with boxes spawning every other turn.
Hey!
unit22 seems down and as this script is somewhat popular, we made v18 available on the official DLC.
(Thank you mpan for your assist in IRC chat)
Under the assumption that's okay with you guys. (If not, let us know!)
I wasn't sure about the DLC info for this script (creators/license/etc.), so please let us know how we can improve that.
Cheers!
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
Thanks a lot sheepluva.
I'm not involved in the monarchy creation nor development, so you may remove my name.
Ask Tiotimolina for license
Notes for script parameters:
ffa = no role
creeper = Easter egg weapon (since v20, it was "duck" for v18/19)
multi = two abilities each
friendlyfire (only for v19)
Thank you for your response Plarf!
I added some of the info to the DLC.
With regards to license I'll hope to be able to get into touch with Tiotimolina soon.
Cheers
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
Fixed.
It goes back and forth.
Fixed.
Not doing.
Maybe next version.
It's ok.
I updated OP.
Tiotimolina? I thought you died. Most of these recent version were published by other people (most notably Libera Monarchists who seem to act a little... off for their humanity). Thank god you actually have proven that you're alive.
v19 is now available for download on the official DLC page.
Cheers!
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
L29Ah has reported a bug in IRC:
Hi, I am a Hedgewars developer.
Be aware: Timolina is sharing v20