How To Make Mafia Themes (V 3.0)

Discussion in 'Theme Development' started by Shazan, May 15, 2014.

  1. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    Can evadeChance be used to evade specific daykillers?
     
  2. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    No, it can't. If what you need is a role that evade only specific daykillers and make them waste their daykill, use this:
    That "expend" property defines if the daykill is used or not when evaded by those roles.
     
  3. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    Ah, okay, thanks. I couldn't find anything about it. The guide is messy :(
     
  4. Shazan

    Shazan Obey to Kyubey

    Joined:
    Jan 21, 2013
    Messages:
    591
    Likes Received:
    14
    PO Trainer Name:
    Obey to Kyubey
    Yeah I understand your point, I didn't even added the descriptions of some features into the opening post.
    Right now the QC is working to add the lacking one and for now we added all the lacking features described into the How To Code a Mafia theme V2 and we'll add slowly all the one scatterend inside this thread.
    Anyway there is a huge amount of coding features for mafia themes and maybe the old cataloguing system is not enough anymore, so I was wondering if we should divide at least the roles' features into more categories and spoiler tags like this one:
    Night Actions:
    Commands:
    All the abilities that a player could use during the night like /inspect or /kill and all the features that modify this precise actions like killmsg.
    Properties:
    Here we insert all that features that modify the general effects of the night commands, like Silent: true or Charges
    Day Actions:
    Commands:
    All the abilities that a player could use during the standby phase like /expose or /daykill.
    Properties:
    Here we insert all that features that modify the general effects of the day commands, like Revealchance or Charges
    Passive Actions:
    Vote Phase:
    All the passive abilities related to the vote phase, like vote multiplier or vote bombs
    Defensive:
    All the passive abilities used to counter the active actions, for exemple Ignore, evadeChance and active actions bombs.
    Others:
    All the other passive abilities without categories like: Ondeath, InitialCondition and TeamTalk.
    But I am unsure about it, so I wanted to know if you prefer to keep only the old cataloguing system or if it should be improved.
     
  5. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Anything is better than the current format. There's no logic to the way the current guide is organized, things are just added there chronologically, which is not really useful to new authors.
     
  6. Shazan

    Shazan Obey to Kyubey

    Joined:
    Jan 21, 2013
    Messages:
    591
    Likes Received:
    14
    PO Trainer Name:
    Obey to Kyubey
    Ok, I modified the part Advanced Features of the opening post, Now it's divided into categories with each of them with a table of content for a faster research and all the various features ordered partially in alphabetical order and partially by how they are related with each others, for exemple Watch is near to Stalk because they are both ability for investigation.
    I tried to add any lacking feature I could Find out inside the version 2 and 3 of the How to Make A theme Thread, but if you find some feature lacking let me know.
    Also because the features are more then 150 I made a little program with ansi C to help me order them and eliminate some features that were enlist more then once inside the opening post, but because ansi C is not the best program language to work with strings there could be some problems that I didn't noticed, so let me know if you notice something wrong.

    P.S.
    Basic actions like Protect and Distract were inside the basics group of the opening post even when @Hobbes2 was the author of this thread, so I leaved them there because I was unsure if I should move them, leave them or make a copy of them for the Advanced Features part.
     
  7. Hobbes2

    Hobbes2 Aren't I dead or something

    Joined:
    May 21, 2011
    Messages:
    1,168
    Likes Received:
    2
    PO Trainer Name:
    Hobbes2
    Sorry about the garbo guide, I made it in a time when I was pretty young and didn't really know how to write properly.
     
  8. Shazan

    Shazan Obey to Kyubey

    Joined:
    Jan 21, 2013
    Messages:
    591
    Likes Received:
    14
    PO Trainer Name:
    Obey to Kyubey
    You have no motive to say sorry, when you made this guide there weren't so much features as now, so there was no need for a more ordered guide until some extra feature happeared.
     
  9. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    At least you made a guide :)
    That's more than what anyone else did at the time.
     
    Shazan likes this.
  10. Whereabouts Unknown

    Whereabouts Unknown Absolutely Stunning Forum Moderator Channel Leader Forum Moderator Channel Leader

    Joined:
    Aug 17, 2010
    Messages:
    1,008
    Likes Received:
    538
    PO Trainer Name:
    Miki Sayaka
    Oh no, my subforum is getting all dusty :(

    (07:07:02) Updating Mafia Script...
    (07:07:09) Update Complete!

    Let's start off with a holiday classic, shall we?

    Silent Night in theme: This is a feature you can add to themes to make it so you can't talk during the night. It's useful if you want to discourage central claiming and connecting, and can be added to introduce a flavor of suspense. It's not for all themes, but it's an option now, especially for themes going for the more "classic" feel.

    You put this in your theme next to the author and summary and stuff to enable it:
    Code (text):
    1.  
    2. "silentNight": true,
    3.  
    /Whisper (or /w): Thought silent night would make PM communication too stressful? Well good news, because PMs are more or less obsolete now. Type /whisper [name]:[message] to send someone a message that only they can see. It's like teamtalk, but any 2 players can use it to communicate. It can be used during silent night. It has also been added to /commands mafia.

    /Votecount (or /vc): Another utility command, this one just gives you a stash of info regarding who has been voted by whom in past nights. The format is /votecount [name]:[day]. You can omit the name to see everyone who has been voted for that particular day, and omit the day to see the votecount for only the most recent vote phase.
    Code (text):
    1.  
    2. /votecount -- Tells you everyone who was voted and by whom during the current or most recent vote phase.
    3. /votecount kyousuke -- Tells you everyone who voted kyousuke during the current or most recent vote phase.
    4. /votecount kyousuke:2 -- Tells you everyone who voted kyousuke during day 2.
    5. /votecount :2 -- Tells you everyone who was voted and by whom during day 2.
    6.  
    Alright, enough small updates, here come the real new features:

    Pinpoint in Action: This is a new feature you can add inside of an action in your json code. You put it in the area where "target" and "common" go. What it does is require you to guess the target's role for it to work. The input is /[action] [player]:[role]. If your action has this, it will force you to guess a role when you input the action, and it will fail if you guess their role incorrectly. BTW, this won't work with compulsory commands, so don't do that.

    This also includes pinpointFailMsg and pinpointBroadcastFailMsg. You can guess what those do.
    Code (text):
    1.  
    2. "command": ["distract"],
    3. "target": "AnyButSelf",
    4. "common": "Self",
    5. "priority": 2,
    6. "pinpoint": true,
    7. "pinpointFailMsg": "Your ~Command~ didn't work because ~Target~'s wasn't ~GuessedRole~!",
    8. "pinpointBroadcastFailMsg": "The ~Role~ tried to ~Command~ ~Target~, but it failed because they weren't the ~GuessedRole~!"
    9.  
    Redirect: A new night action which is a lot like distract but much more powerful. What it does is change the target of your target to whomever you choose. It works like this:
    Code (text):
    1.  
    2. Kallen used /kill Suzaku.
    3. Lelouch used /redirect Kallen@Schneizel
    4. Schneizel dies.
    5.  
    Note: this action only takes existing targets and changes them to the new target. That means, even if a role, e.g., Mafia, can kill, even if someone redirects the Mafia, if they didn't submit a kill that night, no one will die. Also, redirect changes all targets for all actions. So if your role has multiple actions, like Aerith in FF, the targets of all of the actions will be changed to whoever the user of redirect chooses.

    redirect requires the following argument inside of the action code.
    Code (text):
    1.  
    2. "redirectTarget": "Any"
    3.  
    Instead of Any, you can have AnyButSelf (you can redirect the target onto anyone but yourself), AnyButTarget (onto anyone but the target of your redirect - so you can't make them target themselves), as well as OnlySelf or OnlyTarget.

    Once again, this doesn't work with compulsory night actions. Sorry.

    onlyUser on distract: Not a new action, but a much needed update to an old one. You can now make it so distract only works if you distract the user who input the action. For example, if they Pretty Lady distract Player A who is Mafia, if their partner, Player B, submitted the kill action, the kill will not be blocked by the Pretty Lady. Just add the following piece of code to your distract action to enable this:
    Code (text):
    1.  
    2. "onlyUser": true
    3.  
    I was thinking about adding this for Stalk/Watch, so let me know if any of you active mafia theme coders would like to use that :)

    botName in theme: You can now set the default name for the bot in all instances for your theme. This might cause some unexpected things to happen since it will replace the ±Game everywhere, so be careful when using it. You can set it with
    Code (text):
    1.  
    2. "botName": "Adele"
    3.  
    and get
    Code (text):
    1.  
    2. (13:37:40) Well, Not Enough Players! :
    3. (13:37:40) ±Adele: You need at least 3 players to join (Current: 1).
    4.  
    It's powerful, so set it to something that makes sense or your theme will get removed.
    You should still be able to overwrite it in most instances, so if you specify a bot for a specific message, it'll choose that over the one you set for default.

    closedSetup: Also not new, but now it can be set to "full" as well as "team", the former meaning that you don't get to see the roles of anyone in the theme! Remember to use /spawn to check what possible roles could spawn at the start of the game for themes that have this feature.

    Ignore.broadcastMsg: You can now make things send broadcast messages if they are hit by an action they're supposed to ignore. I mainly coded this because I needed this for a theme, but maybe you can find a use for it in your theme!
    Code (text):
    1.  
    2.                 "kill": {
    3.                     "mode": "ignore",
    4.                     "broadcastMsg": "~Target~ was found dead! ...huh? Never mind, that's just the possum playing dead again.",
    5.                     "msg": ""
    6.                 },
    7.  
    ~TargetRole~ and ~Role~ in day revenge: Certain people can now use these arguments in their messages and Miki Productions won't happen.

    Be sure to check out /commands mafia when you get a chance and review the new commands!
     
    Fate Testarossa likes this.
  11. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    Do you type the player's name or the role's name?
     
  12. Fate Testarossa

    Fate Testarossa Unbreakable Bond

    Joined:
    Jul 7, 2012
    Messages:
    527
    Likes Received:
    563
    PO Trainer Name:
    Fate Testarossa
    I assume it's the player's name.
     
    Whereabouts Unknown likes this.
  13. Whereabouts Unknown

    Whereabouts Unknown Absolutely Stunning Forum Moderator Channel Leader Forum Moderator Channel Leader

    Joined:
    Aug 17, 2010
    Messages:
    1,008
    Likes Received:
    538
    PO Trainer Name:
    Miki Sayaka
    Correct.

    redirectActions for Redirect: You can now use redirectActions (an array) to only redirect certain actions. It will still redirect all of the actions in redirectActions from the target onto the same person. It also still can't be used to redirect any actions that weren't submitted by the target and probably won't ever.
    Code (text):
    1.  
    2. "night": {
    3. "redirect": {
    4. "common": "Self",
    5. "target": "AnyButSelf",
    6. "redirectTarget": "AnyButSelf",
    7. "redirectActions": ["protect", "distract", "bop"],
    8. "priority": 99
    9. }
    10. }
    11.  
    This will redirect only actions whose flavor for input is protect, distract, or bop.
     
    Last edited: Jan 3, 2016
    Fate Testarossa likes this.
  14. Yentero

    Yentero So na Voadora

    Joined:
    Feb 9, 2014
    Messages:
    80
    Likes Received:
    1
    PO Trainer Name:
    ME and So na Voadora
    Hi all, it is me again, long time, anyway, maybe next or 2 week i will return for my theme project, WB3, if someone find this theme please comment, i need opinions :)
     
  15. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    The theme property "botName" has been removed, it has been replaced with the object "bot"
    Code (text):
    1.  
    2. "bot": {
    3.    "name": "Adele",
    4.    "color": "pink"
    5. }
    6.  
    From there you can customize a bot name/color for you theme.

    Also there is now a "borderColor" property for themes, which lets you customize the theme border's color (default is magenta)
     
  16. Whereabouts Unknown

    Whereabouts Unknown Absolutely Stunning Forum Moderator Channel Leader Forum Moderator Channel Leader

    Joined:
    Aug 17, 2010
    Messages:
    1,008
    Likes Received:
    538
    PO Trainer Name:
    Miki Sayaka
    New features!

    1. Dummy ignore msg as an object.
    This is a pretty minor change. Now you can put an object like the one below instead of a string in order to get random responses. The key is a string, followed by a number to indicate its likeliness. I'm sure some theme makers can figure out how to use this creatively...

    msg: {
    "Leave me alone": 1,
    "Go away!": 2,
    "baka": 0.02
    }

    2. Distracted defense mode
    You can now put "distracted" as a mode for an action to make it simulate being distracted by an action that is not distract. For instance:

    "protect": {
    "mode": "distracted",
    "msg": "The Bodyguard came to protect me last night, but we got caught up talking and I forgot to do my actions!"
    }

    3. Day protect (and revenging protect)
    Probably the coolest new feature today.


    "defend": {
    "command": ["dayprotect"],
    "dayProtectMsg": "You couldn't kill ~Target~! Someone defended them!",
    "dayProtectType": "protect",
    "target": "AnyButSelf",
    "common": "Self",
    "priority": 100
    }

    But wait, there's more! You can also make the target not only evade, but counter daykills. You do this by setting the "dayProtectType" to "revenge" instead of "protect".

    "cover": {
    "command": ["dayprotect"],
    "dayProtectMsg": "~Self~ tried to kill ~Target~, but it was all a trap! Someone killed ~Self~ when their back was turned!",
    "dayProtectType": "revenge",
    "target": "AnyButSelf",
    "common": "Self",
    "priority": 100
    }

    Also, which ever dayProtect has lower priority overrides any previous one. So if you get a "protect" day-BG then get a "revenge" day-BG, the revenge day-BG will be in place during standby.

    4. Change side (Indocrinate)
    So you can change roles' sides now without actually changing the role itself. Useful for very simple convering roles that want to simply clone someone onto their side without having to create a duplicate copy of every role in the game. The command for this is Indoctrinate.
     
    Last edited: Sep 20, 2016
    Fate Testarossa likes this.
  17. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    How is this meant to work for shared roles (e.g.: Vaati's Minion)? From the code, it looks like you target a player, but all of them would end changing sides. And even worse, unless I'm missing something, the changed side could even end getting carried to the next game, since it seems you are changing the theme object directly :x
     
  18. Whereabouts Unknown

    Whereabouts Unknown Absolutely Stunning Forum Moderator Channel Leader Forum Moderator Channel Leader

    Joined:
    Aug 17, 2010
    Messages:
    1,008
    Likes Received:
    538
    PO Trainer Name:
    Miki Sayaka
    Standby Actions are out of control!

    actions.standby.compulsory

    Standby actions can be compulsory now. The syntax for this is something like this:
    "kill": {
    "target": "AnyButTeam",
    "compulsory": [10, 15],
    "killmsg": "~Self~ runs around crazily and accidentally knocks ~Target~ onto a pile of tick-tacks!"
    }

    This will make the user automatically submit the kill action between 10 and 15 seconds into the standby phase. If you want to make it so that the player cannot submit the action before then, just put a capital letter or something into the command's flavor name.

    Compulsory can be either a number or an array of 2 numbers. If it's an array, the first number has to be smaller. Compulsory works with limit as well.

    actions.night.Daydistract

    Another night action that blocks day actions. It works much the same as Dayprotect, and like Dayprotect, it can be used as a block or as a counter. If "type": "revenge" is added to your Daydistract action, the target will die if they try to daykill. Otherwise, it will simply block the action.

    bypass in standby

    You can now put "bypass": [] in standby Actions. This allows daykills to bypass evade, protect, or distract. Those are the only arguments it accepts atm.

    And some new vote features:

    The way extravote works is entirely changed. You can now change someone's vote or voteshield by adding the argument "addVote" or "addVoteshield" to the night action. In addition, addVoteDuration and addVoteshieldDuration are arguments that can be used to change how long this lasts. If the duration is set to -1, it will be permanent until overridden by another action which includes addVote. For example,

    {
    "command": ["dummy"],
    "target": "AnyButSelf",
    "common": "Self",
    "addVote": 2,
    "addVoteDuration": 1,
    "priority": 30
    }

    this action can be said to give the target a vote of 2 for the following day, regardless of what their role's standard vote is. This means Moogle or Kuja, if targeted by this, would both have a vote of 2. addVoteshield works the same way.

    actions.night.voteBlock

    Blocking vote works a little differently, and it has its own command, but it's the same in terms of application.

    {
    "command": ["voteblock"],
    "common": "Role",
    "target": "AnyButTeam",
    "priority": "20",
    "broadcast": "team",
    "voteBlockDuration": 1,
    "voteBlockMsg": "You've been muted! You cannot vote!"
    }

    voteBlockMsg is what you put for when they try to vote but can't. Otherwise, use dummy to send a message to the player if you want them to know they can't vote the following vote phase.

    voteHax

    A minor feature. You can now have roles hax who voted for who in the vote phase. You can leave it blank, or "voteHax": {}, if you want to leave it with the default message and a 100% chance to hax. Otherwise, you can set msg and chance.

    "voteHax": {
    "msg": "~Player~ was the one who voted for ~Target~!",
    "chance": 0.27
    }

    Feature is only good for themes with silent vote obviously.

    rechargeMsg

    You can set the rechargeMsg in actions which have recharge now. ~Recharge~ is replaced with how long until you can use the action again.

    onlyActions in distract

    You can put an array "onlyActions": [] in distract actions now. This means it will only block actions that have the flavor text, not the action, in that array.
     
    Fate Testarossa likes this.
  19. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    Night actions can now have the optional "alternateTargets" attribute. When set to true, the player must target different users with the action on consecutive nights.

    For example:
    Code (text):
    1. {
    2.     "role": "hooker",
    3.     "translation": "Pretty Lady",
    4.     "side": "werewolf",
    5.     "help": "Type /Distract [name] to distract someone! Vote to remove people in the day!",
    6.     "actions": {
    7.         "night": {
    8.             "distract": {
    9.                 "target": "AnyButSelf",
    10.                 "common": "Self",
    11.                 "priority": 1,
    12.                 "alternateTargets": true
    13.             }
    14.         }
    15.     }
    16. }
    If this Pretty Lady uses /distract on PlayerA during Night 1, she cannot use /distract on PlayerA again during Night 2. However, she can /distract PlayerA during Night 3.

    I figure this feature will be most useful for forcing distracters to switch targets to prevent stalling. Another idea could be using it with protect if say you want a user to be able to protect themselves or anyone else but not the same person every night.

    Also, killattacker now kills the player who inputted the kill command on the target instead of an arbitrary player.