Files
Paradise/code/modules/mod/adding_new_mod.md
Qwertytoforty 76a845d380 Modsuits. Ready for review, sorry for the ammount of files changed 👉 👈 (#21147)
* biting off more than I can chew, but I feel like hurting myself

* more shit

* progress continues, moral stays sameish

* bite of 2587

* mod_theme down, but probably broken

* 385 errors, 16 warnings, zero tgui interactions

* 292 19

* final strech to buggy mess, break time

* it compiles. It almost fucking certainly doesnt work, but it compiles

* fudhsciffubgsbgpgb actions not working as should for modules

* fuck it we'll just open the pr as we work on it

* icons work now

* tgui stuff

* more progress

* JUDGEMENT

* IT LIVES. TGUI LIVES. Special thanks to Sirryan and my brother.

* jetpacks, gps, and go do what exo-suits yourself

* almost ready

* sorry to whoever has to review this

* should work™️

* should be good now

* pushing changes so I can do reviews next

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* lore™️ Adds illegals level to modsuit parts from syndicate.

* early returns

* and these illegals

* no uplink reference idiot

* mod inhands are a good idea

* this is needed for inhands nerd

* Bomb detector working, modsutis cover ears. skin things

* overslotting removal, cyborg charging, ert loadout for gamma

* duplicated signal

* modsuit themes, removes broken mister / bad base type module, 2 cores in robotics.

* tether module, orb module, holster stuff

* built in no slip, cheaper 87

* removes modules already installed, engineer ert get jetpack, equip into modsuit storage

* comments spaces and duplicate flags

* Some adjustments and thoughts on armor, heads get guns because they are cool like that / looting command members armor

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* Compile TGUI, slowdown adjustment, Modsuit to MODsuit

* sonar, do after, more equipment, acid handling

* overlay bugs / ERT / DS suits autodeploy

* middle click action buttons

* traders, sec modsuit energy nerf

* surplus weighting

* Kinesis module.

* Pathfinder module, kinesis balance, blueprint for pathfinder and kinesis

* more power / unused module removed

* name, ds fix, pre equipped to cc suit

* depot / grammer

* ok should be good™️

* overslot, dupe gun, missing suit storage

* stealth nerf, new kit

* gun stuff  / ds theme

* bio armor is gone

* let me push changes please thank you

* makes shocks work right

* copies over some changes TG made to module prices after porting

* Merge remote-tracking branch 'upstream/master' into Because-I-hate-myself-and-someone-has-to-try-it-

* sirryans changes

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* Update code/modules/telesci/gps.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* Update code/modules/telesci/gps.dm

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* Control define, ERT / DS have gloves / boots again.

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

* More changes

* god I hate tgui. Why do all the bundles live underground, instead of in my basement?

* she updates my master till I testmerge

* modsuits can recharge again

* fixes a lot of shit

* Ready for TM probably

* sure fuck it whatever that makes sense I guess

* the pinpointer works better™️

* Another storage module bug fix

* hair and medical stuff

* fuck fuck fuck

* fixes sonar

* Bag exploit fixes / plasma runtimes / ear nerf

* dna lock improvement / cryostorage

* whoops

* Ball form second cooldown wasn't helping, no more infinite cores

* she springs my lock till I ***SNAP***

* plasmaman no longer die

* fixes modsuit emp issues

* atmos no longer fucking dies

* Fixes, module printing, and a restriction on newly constructed modsuits

* Inventory code my hated

* WOOO PREFERENCE CODE WOOOOO

* icons my hated

* fix for mods / spaceproof shit

* holy shit whhhyyyyy

* backpack first

* Update mod_theme.dm

* prevent infinite gun arms / infinite modsuit cores / syndicate modules

* fixes tm error

* scream loudly if species sprites break. They shouldn't, but, you know.

* deconflicted with luck

* converts to refit for species

* fix pathfinder

* fixes modsuits being funky power wise

* lockboxes :gatto: , as well as DN-MP shield lock, and slight nerf to atmos modsuit

* nerfs the atmos modsuit

* magboots for ds / CC modsuit

* downside of autosave: typing in wrong window saves bad stuff

* Gamma ERT have internal cameras again.

* spellcheck when

* ah fuck

* yes delete the null that works

* whoops

* fixes error / description

* un vulps your cannon

* fixes tails disapeering on base modsuits

* space to underscore

* tgui fix / tajaran

* springlock buff, cryopod fix

* u helps

* WHO PUTS A GUN IN ITEMS

* tgui moment

* mining modsuit nerf / hidden holster module

* PAIN

* UNATHI TIDE STATION WIDE

* I love special code

* slightly dense

* shark jumpscare

* fixes ghost item, fixes springlock being bad

* YIPPEEEE IT WORKED

* she decons my flict

* pain

* ebbas days are numbered :^)

* hidden

* r-r-r-ebuild

* fixes more bugs

* qwerty, you are dense

* fixes gps

* fix mulebot crate

* level fix

* adds back icon

* moving storage, fix bug, modules activate / deactivate message

* yeah

* yeah

* yeah™️

* steels requests

* windoors no longer make pathfinder module explode

* chat spam

* oil slicks + modsuits

* whoops

* bag check

* ofc

* Update code/modules/mod/mod_control.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/datums/uplink_items/uplink_nuclear.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/modules/mod/mod_control.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/modules/mod/modules/module_pathfinder.dm

Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>

---------

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
2023-08-19 15:36:13 -05:00

325 lines
13 KiB
Markdown

## Introduction
This is a step by step guide for creating a MODsuit theme, skin and module.
## Theme
This is pretty simple, we go [here](./mod_theme.dm) and add a new definition, let's go with a Psychologist theme as an example. \
Their names should be like model names or use similar adjectives, like "magnate" or simply "engineering", so we'll go with "psychological". \
After that, it's good to decide what company is manufacturing the suit, and a basic description of what it offers, we'll write that down in the desc. \
So, let's our suit should be a low-power usage with lowered module capacity. We'd go with something like this.
```dm
/datum/mod_theme/psychological
name = "psychological"
desc = "A DeForest Medical Corporation power-saving psychological suit, limiting its' module capacity."
```
For people that want to see additional stuff, we add an extended description with some more insight into what the suit does. We also set the default skin to usually the theme name, like so.
```dm
/datum/mod_theme/psychological
name = "psychological"
desc = "A DeForest Medical Corporation power-saving psychological suit, limiting its' module capacity."
extended_desc = "DeForest Medical Corporation's prototype suit, based off the work of \
Nakamura Engineering. The suit has been modified to save power compared to regular suits, \
for operating at lower power levels, keeping people sane. As consequence, the capacity \
of the suit has decreased, not being able to fit many modules at all."
default_skin = "psychological"
```
Next we want to set the statistics, you can view them all in the theme file, so let's just grab our relevant ones, armor, charge and capacity and set them to what we establilished. \
Currently crew MODsuits should be lightly armored in combat relevant stats.
```dm
/datum/mod_theme/psychological
name = "psychological"
desc = "A DeForest Medical Corporation power-saving psychological suit, limiting its' module capacity."
extended_desc = "DeForest Medical Corporation's prototype suit, based off the work of \
Nakamura Engineering. The suit has been modified to save power compared to regular suits, \
for operating at lower power levels, keeping people sane. As consequence, the capacity \
of the suit has decreased, not being able to fit many modules at all."
default_skin = "psychological"
armor_type = /datum/armor/modtheme_psychological
complexity_max = DEFAULT_MAX_COMPLEXITY - 7
charge_drain = DEFAULT_CHARGE_DRAIN * 0.5
```
Now we have a basic theme, it lacks a skin which will be covered in the next section, and an item, which we will add right now. \
Let's go into [here](./mod_types.dm). It's as simple as adding a new suit type with the appropriate modules you want.
```dm
/obj/item/mod/control/pre_equipped/psychological
theme = /datum/mod_theme/psychological
initial_modules = list(
/obj/item/mod/module/storage,
/obj/item/mod/module/flashlight,
)
```
This will create our psychological suit, equipped with a storage and flashlight modules by default. We might also want to make it craftable, in which case we go [here](./mod_construction.dm) and set this.
```dm
/obj/item/mod/construction/armor/psychological
theme = /datum/mod_theme/psychological
```
After that we put it in the techweb or whatever other source we want. Now our suit is almost ready, it just needs a skin.
## Skin
So, now that we have our theme, we want to add a skin to it (or another theme of our choosing). Let's start with a basis.
```dm
/datum/mod_theme/psychological
name = "psychological"
desc = "A DeForest Medical Corporation power-saving psychological suit, limiting its' module capacity."
extended_desc = "DeForest Medical Corporation's prototype suit, based off the work of \
Nakamura Engineering. The suit has been modified to save power compared to regular suits, \
for operating at lower power levels, keeping people sane. As consequence, the capacity \
of the suit has decreased, not being able to fit many modules at all."
default_skin = "psychological"
armor_type = /datum/armor/modtheme_psychological
complexity_max = DEFAULT_MAX_COMPLEXITY - 7
charge_drain = DEFAULT_CHARGE_DRAIN * 0.5
skins = list(
"psychological" = list(
HELMET_LAYER = null,
HELMET_FLAGS = list(
),
CHESTPLATE_FLAGS = list(
),
GAUNTLETS_FLAGS = list(
),
BOOTS_FLAGS = list(
),
),
)
```
We now have a psychological skin, this will apply the psychological icons to every part of the suit. Next we'll be looking at the flags. Boots, gauntlets and the chestplate are usually very standard, we set their thickmaterial and pressureproofness while hiding the jumpsuit on the chestplate. On the helmet however, we'll actually look at its' icon. \
For example, if our helmet's icon covers the full head (like the research skin), we want to do something like this.
```dm
HELMET_LAYER = null,
HELMET_FLAGS = list(
UNSEALED_CLOTHING = SNUG_FIT|THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE|BLOCK_GAS_SMOKE_EFFECT,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR|HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
UNSEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
```
Otherwise, with an open helmet that becomes closed (like the engineering skin), we'd do this.
```dm
HELMET_LAYER = NECK_LAYER,
HELMET_FLAGS = list(
UNSEALED_CLOTHING = SNUG_FIT,
SEALED_CLOTHING = THICKMATERIAL|STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR,
SEALED_INVISIBILITY = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
SEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
```
There are specific cases of helmets that semi-cover the head, like the cosmohonk, apocryphal and whatnot. You can look at these for more specific suits. So let's say our suit is an open helmet design, and also add an alternate skin with a closed helmet called psychotherapeutic. It'd look something like this.
```dm
/datum/mod_theme/psychological
name = "psychological"
desc = "A DeForest Medical Corporation power-saving psychological suit, limiting its' module capacity."
extended_desc = "DeForest Medical Corporation's prototype suit, based off the work of \
Nakamura Engineering. The suit has been modified to save power compared to regular suits, \
for operating at lower power levels, keeping people sane. As consequence, the capacity \
of the suit has decreased, not being able to fit many modules at all."
default_skin = "psychological"
armor_type = /datum/armor/modtheme_psychological
complexity_max = DEFAULT_MAX_COMPLEXITY - 7
charge_drain = DEFAULT_CHARGE_DRAIN * 0.5
skins = list(
"psychological" = list(
HELMET_LAYER = NECK_LAYER,
HELMET_FLAGS = list(
UNSEALED_CLOTHING = SNUG_FIT,
SEALED_CLOTHING = THICKMATERIAL|STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR,
SEALED_INVISIBILITY = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
SEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
BOOTS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
"psychotherapeutic" = list(
HELMET_LAYER = null,
HELMET_FLAGS = list(
UNSEALED_CLOTHING = SNUG_FIT|THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR|HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
UNSEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
BOOTS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
),
)
```
Thus we finished our codeside. Now we go to the icon files for the suits and simply add our new skin's icons. \
Now our suit is finished. But let's say we want to give it an unique module.
## Module
So, for our psychological suit, let's say we want a module that heals the brain damage of everyone in range. \
As it's a medical module, we'll put it [here](modules/modules_medical.dm). Let's start with the object definition.
```dm
/obj/item/mod/module/neuron_healer
name = "MOD neuron healer module"
desc = "A module made experimentally by DeForest Medical Corporation. On demand it releases waves \
that heal neuron damage of everyone nearby, getting their brains to a better state."
icon_state = "neuron_healer"
```
As we want this effect to be on demand, we probably want this to be an usable module. There are four types of modules:
- Passive: These have a passive effect.
- Togglable: You can turn these on and off.
- Usable: You can use these for a one time effect.
- Active: You can only have one selected at a time. It gives you a special click effect.
As we have an usable module, we want to set a cooldown time. All modules are also incompatible with themselves, have a specific power cost and complexity varying on how powerful they are, so let's update our definition, and also add a new variable for how much brain damage we'll heal.
```dm
/obj/item/mod/module/neuron_healer
name = "MOD neuron healer module"
desc = "A module made experimentally by DeForest Medical Corporation. On demand it releases waves \
that heal neuron damage of everyone nearby, getting their brains to a better state."
icon_state = "neuron_healer"
module_type = MODULE_USABLE
complexity = 3
use_power_cost = DEFAULT_CHARGE_DRAIN
incompatible_modules = list(/obj/item/mod/module/neuron_healer)
cooldown_time = 15 SECONDS
var/brain_damage_healed = 25
```
Now, we want to override the on_use proc for our new effect. We want to make sure the use checks passed from parent. You can read about most procs and variables by reading [this](modules/_module.dm)
```dm
/obj/item/mod/module/neuron_healer/on_use()
. = ..()
if(!.)
return
```
After this, we want to put our special code, a basic effect of healing all mobs nearby for their brain damage and creating a beam to them.
```dm
/obj/item/mod/module/neuron_healer/on_use()
. = ..()
if(!.)
return
for(var/mob/living/carbon/carbon_mob in range(5, src))
if(carbon_mob == mod.wearer)
continue
carbon_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -brain_damage_healed)
mod.wearer.Beam(carbon_mob, icon_state = "plasmabeam", time = 1.5 SECONDS)
playsound(src, 'sound/effects/magic.ogg', 100, TRUE)
drain_power(use_power_cost)
```
We now have a basic module, we can add it to the techwebs to make it printable ingame, and we can add an inbuilt, advanced version of it for our psychological suit. We'll give it more healing power, no complexity and make it unremovable.
```dm
/obj/item/mod/module/neuron_healer/advanced
name = "MOD advanced neuron healer module"
complexity = 0
brain_damage_healed = 50
```
Now we want to add it to the psychological theme, which is very simple, finishing with this:
```dm
/datum/mod_theme/psychological
name = "psychological"
desc = "A DeForest Medical Corporation power-saving psychological suit, limiting its' module capacity."
extended_desc = "DeForest Medical Corporation's prototype suit, based off the work of \
Nakamura Engineering. The suit has been modified to save power compared to regular suits, \
for operating at lower power levels, keeping people sane. As consequence, the capacity \
of the suit has decreased, not being able to fit many modules at all."
default_skin = "psychological"
armor_type = /datum/armor/modtheme_psychological
complexity_max = DEFAULT_MAX_COMPLEXITY - 7
charge_drain = DEFAULT_CHARGE_DRAIN * 0.5
inbuilt_modules = list(/obj/item/mod/module/neuron_healer/advanced)
skins = list(
"psychological" = list(
HELMET_LAYER = NECK_LAYER,
HELMET_FLAGS = list(
UNSEALED_CLOTHING = SNUG_FIT,
SEALED_CLOTHING = THICKMATERIAL|STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR,
SEALED_INVISIBILITY = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
SEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
BOOTS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
"psychotherapeutic" = list(
HELMET_LAYER = null,
HELMET_FLAGS = list(
UNSEALED_CLOTHING = SNUG_FIT|THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
UNSEALED_INVISIBILITY = HIDEFACIALHAIR|HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDESNOUT,
UNSEALED_COVER = HEADCOVERSMOUTH|HEADCOVERSEYES|PEPPERPROOF,
),
CHESTPLATE_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
SEALED_INVISIBILITY = HIDEJUMPSUIT,
),
GAUNTLETS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
BOOTS_FLAGS = list(
UNSEALED_CLOTHING = THICKMATERIAL,
SEALED_CLOTHING = STOPSPRESSUREDAMAGE,
),
),
)
```
## Ending
This finishes this hopefully easy to follow along tutorial. You should now know how to make a basic theme, a skin for it, and a module.