Skip to content

Lesson: Jester Role

DillyzThe1 edited this page Dec 26, 2022 · 7 revisions

Warning: This document is unfinished! Abrupt endings may occur.

Warning: This tutorial was written for a Windows 10 user who has among us on Steam! You'll be able to mod with other desktop builds, but I may need testing done from volunteers!

Lesson - Jester

Summary

In this lesson, you will learn how to make a high quality recreation of the Jester role in Among Us using DillyzRoleApi.
To begin, first make sure you've read and followed the basic setup instructions to get your mod started.

Creating The Jester Role

First, we need to create role to load it. (no, really?!)
We should look at the DillyzUtil class, which contains a lot of useful functionality.
What we need is the function DillyzUtil.createRole(String name, String subtext, bool nameColor, bool nameColorPublic, Color32 roleColor, bool canSeeTeam, CustomRoleSide side, VentPrivilege ventPrivilege, bool canKill, bool showEjectText), which will automatically inject the role for us and make it compatible with other DillyzRoleApi roles.

First, let's add an empty call 2 lines below Log.LogInfo("The role package has loaded!");.

DillyzUtil.createRole(); // this is gonna error until we put arguments.

Now, we need some arguments.
The first two arguments are as follows: String name & String subtext.
I will choose the name "Jester", followed by the description "Get voted out to win.".

DillyzUtil.createRole("Jester", "Get voted out to win."); // this is gonna error until we put all of the arguments.

Great! Now we just need to select the next two options: bool nameColor & bool nameColorPublic.
I want the Jester's name color to change on the UI from white to purple, but I only want the jester to see it

DillyzUtil.createRole("Jester", "Get voted out to win.", true, false);

Perfect! Now let's make a color.
Before the function call, I'm going to add a Color32 variable called jesterColor & I'm going to use it.
The color arguments must be in the order of red, green, blue, & alpha, so I'll pass a purple I made.
Now let's pass it as an argument.

Color32 jesterColor = new Color32(90, 50, 200, 255);
DillyzUtil.createRole("Jester", "Get voted out to win.", true, false, jesterColor);

Now for some team arguments: bool canSeeTeam & CustomRoleSide side.
canSeeTeam means that the team they're on can see each other and know who they are. I'll just set this to false for the reasons below.

A CustomRoleSide is a custom enum which can be Impostor, Crewmate, Independent, or LoneWolf.
Impostor/Crewmate means they work on that side of the ship, while Independent means it's it own team while LoneWolf is on none with no teammates.
Even if there are multiple Jesters, I do not wish for them to work together. I will use LoneWolf.

Color32 jesterColor = new Color32(90, 50, 200, 255);
DillyzUtil.createRole("Jester", "Get voted out to win.", true, false, jesterColor, false, CustomRoleSide.LoneWolf);

We're almost there! Two more abilities, though: VentPrivilege ventPrivilege & bool canKill.
A VentPrivilege is the access to a vent oneself is allowed.
Currently, the two usable values are None & Impostor, as Engineer is unfinished and causes an error to prevent you from using it.
I do not want my Jester to vent, so I will set it to None.

bool canKill is exactly what it sounds like; it means that the role can use the default kill button built into Among Us.
For information on how to recreate the default kill button, there may be a code sample within the Code Samples part of your sidebar.
I, however, do not want the Jester to kill, so I will pass false.
Finally, we have another argument called bool showEjectText.
When the Jester is ejected, I do actually want it to say Player was The Jester, rather than Player was not The Impostor, so I will set this to true.

Color32 jesterColor = new Color32(90, 50, 200, 255);
DillyzUtil.createRole("Jester", "Get voted out to win.", true, false, jesterColor, false, CustomRoleSide.LoneWolf, VentPrivilege.None, false, true);

You may notice that the grammar is a little off, so here's a fixed variant!

Color32 jesterColor = new Color32(90, 50, 200, 255);
CustomRole jesterRole = DillyzUtil.createRole("Jester", "Get voted out to win.", true, false, jesterColor, false, CustomRoleSide.LoneWolf, VentPrivilege.None, false, true);
jesterRole.a_or_an = "a";

You may now hit Build > Build Solution and test out your gameplay!

Making the Jester win

TODO: Role winning instructions here.

Clone this wiki locally