Skip to content

New Contributor Guide Professions

Mark Langsdorf edited this page Nov 13, 2020 · 2 revisions

Creating new professions is not that difficult. Professions should be located at data/json/professions.json.

  {
    "type": "profession",
    "id": "skaterkid",
    "name": { "male": "Skater Boy", "female": "Skater Girl" },
    "description": "You love to skate!  At least now the grown-ups aren't telling you where you can't roll.",
    "points": 1,
    "skills": [ { "level": 1, "name": "dodge" } ],
    "traits": [ "PROF_SKATER" ],
    "items": {
      "both": [
        "tshirt",
        "hoodie",
        "jeans",
        "socks",
        "elbow_pads",
        "knee_pads",
        "gloves_fingerless",
        "helmet_skid",
        "roller_blades",
        "sports_drink"
      ],
      "male": [ "briefs" ],
      "female": [ "boy_shorts" ]
    }
  },

Things to remember:

"type" must be set to "profession" as we intend to make a new profession.

"id" is the id of the profession. Must be a single word, use underscores if necessary.

"name" defines the name of the profession. Accepts either a single gender neutral noun or, as in the example above, an object with the keys "male" and "female" for different names determined by the player’s gender.

"desciption" is the ingame description of the profession. Try not to make it unnecessarily long or else all of the text might not fit in the description window. One or two sentences should be enough.

"points" determine the amount of points a profession costs at player gen. Positive values take points and negative values give points. You'll need to estimate the value and there's no good guidelines at this time.

"skills" determine the skills the player starts with. Must use the "id" of the skills from data/json/skills.json, not the ingame name of the skill.

"traits" is an optional field and forces the profession to start with certain traits or mutations. The id for traits and mutations can be found at data/json/mutations.json.

"addiction" is another optional field that makes the player start addicted. It should look like this: "addictions": [ { "intensity": 30, "type": "amphetamine" } ] where "intensity" is the intensity of the addiction and "type" is the type of addiction which must match an "addiction_type" in an item's JSON definition. "addiction_type" is a reference to some C++ code, so you can't add new ones solely through JSON yet.

"items" is the list of items the profession starts with. The player will start with items in the "both" category no matter what gender they choose, while items in the "male" and "female" category are only added to the list of the player plays as the respective gender.

Lets go into some more detail on special cases of adding items:

    "entries": [
      { "item": "ear_plugs", "custom-flags": [ "no_auto_equip" ] },
      { "item": "usp_45", "ammo-item": "45_acp", "charges": 12, "container-item": "holster" },
      { "item": "45_acp", "charges": 18 }
    ]

"entries" lets us define special cases for items we start with. By default the player starts with all clothes equipped. In the above example we use custom-flags to add the [ "no_auto_equip" ] flag to our earplugs so that wen the player spawns in the game they will have their earplugs in their pocket instead of in their ears.

{ "item": "usp_45", "ammo-item": "45_acp", "charges": 12, "container-item": "holster" }, means that we start with a USP .45 in a holster loaded with 12 rounds of .45 ACP FMJ. We could simply add "usp_45" to the list of "items" but that would spawn an empty USP .45 in our inventory.

And lastly, { "item": "45_acp", "charges": 18 } means that we start with 18 rounds of .45 ACP FMJ in our inventory.

The last thing worth noting is that if you want a profession to be only available for certain scenarios you must add "flags": [ "SCEN_ONLY" ] to it. This disables it from being available outside of specific scenarios. To enable the profession for specific scenarios you must add its id to the list of professions enabled in the respective scenarios at data/json/scenarios/scenarios.json.

Clone this wiki locally