Port Synthetic Voicebox from The Den/ImpStation/CD #871
No reviewers
Labels
No labels
Area/Accessibility
Area/Admin Tooling
Area/Art
Area/Atmospherics
Area/Cargo
Area/Character / Species
Area/Chat
Area/Combat
Area/Command
Area/Database
Area/Engineering
Area/Graphics
Area/Guidebook
Area/Mapping
Area/Medical
Area/Preferences / Options
Area/Roleplay / Lore
Area/Roundflow / Antag
Area/Rules
Area/Salvage
Area/Science
Area/Security
Area/Service
Area/Silicons
bug
Changes: Audio
Changes: Map
Changes: No C#
Changes: Sprites
Changes: UI
documentation
DON'T MERGE
duplicate
good first issue
help wanted
holding to vote
Note/Port
Note/Upstream
Priority
Critical
Priority
High
Priority
Low
Priority
Normal
size/L
size/M
size/S
size/XL
size/XS
State/Approved
State/invalid
State/Merge Conflict
State/Needs Changes
State/Needs Discussion
State/Untriaged
Type/Balance Change
Type/Bugfix
Type/Documentation
Type/Enhancement
Type/Feature
Type/Question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Byrd-Station/Byrd!871
Loading…
Reference in a new issue
No description provided.
Delete branch "OrionTheOreooo/Byrd:synth-accents-fixed-20260825"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Short description
!! IMPORTANT !!: This is a "fixed" pr for Byrd-Station/Byrd!866 (aka I didn't just auto pilot on the PR page and Rebase onto the wrong damn branch)
Add Synthetic Voicebox and a passive Malfunctioning addon which applies a light glitch effect on all speech as well as when damaged.
Why we need to add this
No balance changes, just plain roleplay fun
Media (Video/Screenshots)
Checklist
Breaking changes
Ingame Changelog
🆑
I don't think damaged borgs speech should be reduced to nothing at low damage, even at high damage.

Steps to reproduce: Play as a cyborg, get damaged (above 30, but even below 30 it sometimes just doesn't send the message, but does the speak sound) say a long message but get nothing (might need a few attempts).
@ -122,4 +116,0 @@damageAtMaxCorruption = _destructibleSystem.DestroyedAt(ent, destructible);}Why?
@ -56,3 +56,3 @@}// Corrupt due to damage (drop, repeat, replace with symbols)args.Message = CorruptDamage(args.Message, damage, ent);args.Message = CorruptDamage(args.Message, damage, ref ent.Comp);Changes to non-Byrd code should be marked with
// Byrd, you can also add an optional comment like so// Byrd - [comment]@ -0,0 +49,4 @@return outMsg.ToString();}private string CorruptLetter(char letter)This is basically a copy and paste of
CorruptLetterDamageinDamagedSiliconAccentSystem. I would prefer to avoid copy and pasted code.@ -12,2 +12,3 @@/// </summary>[DataField][DataField("enableDamageCorruption")][ViewVariables(VVAccess.ReadWrite)]This changes nothing. Just makes it more verbose, which I do not like.
Apologies, this was a leftover from trying to get the YAML config to be used (as for some reason the YAML was/is not being used for to fill those values, resulting in NULL (and the system not doing anything))
@ -34,1 +36,3 @@public FixedPoint2? DamageAtMaxCorruption;[DataField("damageAtMaxCorruption")][ViewVariables(VVAccess.ReadWrite)]public FixedPoint2 DamageAtMaxCorruption = 100;Why?
@ -0,0 +11,4 @@/// Determines if text should be corrupted, regardless of damage or power./// </summary>[DataField("enablePassiveCorruption")][ViewVariables(VVAccess.ReadWrite)]Just put
[DataField], no need to make it overly verbose.@ -60,3 +60,3 @@}public string CorruptPower(string message, float chargeLevel, DamagedSiliconAccentComponent comp)public string CorruptPower(string message, float chargeLevel, ref DamagedSiliconAccentComponent comp) // Byrd - Only a component reference is neededWhy
ref?@ -113,3 +117,4 @@{var outMsg = new StringBuilder();// Linear interpolation of character damage probabilityWhy did this comment jump up to here?
@ -127,2 +132,2 @@var damagePercent = Math.Clamp((float)totalDamage / (float)damageAtMaxCorruption, 0, 1);var chanceToCorruptLetter = damagePercent * ent.Comp.MaxDamageCorruption;var damagePercent = Math.Clamp((float) totalDamage / (float) damageAtMaxCorruption, 0, 1);var chanceToCorruptLetter = damagePercent * damageAtMaxCorruption;Why did you change
MaxDamageCorruptiontodamageAtMaxCorruption?@ -32,3 +32,3 @@/// </summary>[DataField]public FixedPoint2? DamageAtMaxCorruption;public FixedPoint2 DamageAtMaxCorruption = 100; // Byrd - Set to Non Null Value, YAML wasn't reading at timeI don't really see a good reason to make it non-nullable. I don't have any issues with yaml reading it and I never had. Are you sure you didn't make any types in yaml?
@ -0,0 +18,4 @@/// </summary>[DataField]public float PassiveCorruptionChance = 0.1f;}Have you considered adding a new field to
DamagedSiliconAccentComponentlikeminCorruptionor something similar?@ -79,1 +79,4 @@trait-british-desc = You speak proper, unlike those bloody yanks.trait-syntheticvb-name = Synthetic Voiceboxtrait-syntheticvb-desc = Your vocal apparatus is itself synthetic, and starts to malfunction when you are injured.This if for a
_CDtrait.@ -80,0 +82,4 @@trait-syntheticvb-desc = Your vocal apparatus is itself synthetic, and starts to malfunction when you are injured.trait-damagedsyntheticvb-name = Malfunctioning Synthetic Voiceboxtrait-damagedsyntheticvb-desc = Your Synthetic Voicebox, either through time or damage, has started to malfunction.trait-damagedsyntheticvb-nameis forDamagedSyntheticVoiceboxwhich is located inResources/Prototypes/_Byrd/Traits/speech.yml, meaning you should put those under_Byrdsince this is for a Byrd specific trait.90513b23d94440ae3015@ -129,3 +156,3 @@foreach (var letter in message){if (_random.Prob(chanceToCorruptLetter)) // Corrupt!if (_random.Prob((float) chanceToCorruptLetter)) // Corrupt!(float)here is redundant.@ -126,3 +153,3 @@// Linear interpolation of character damage probabilityvar damagePercent = Math.Clamp((float)totalDamage / (float)damageAtMaxCorruption, 0, 1);var damagePercent = Math.Clamp((float) totalDamage / (float) damageAtMaxCorruption, 0, 1);var chanceToCorruptLetter = damagePercent * ent.Comp.MaxDamageCorruption;You can do something like this:
This is just how the default system for borgs did it, and I assumed it working, the passive corruption chances should be different to the active methods I believe
Both work, depends on what effect you want to achieve.
@ -81,0 +89,4 @@/// The likely hood a character will be corrupted passively/// </summary>[DataField]public float PassiveCorruptionChance = 0.1f;PassiveCorruptionChancecan be null or default to 0 by default and then be set by the trait when needed (optionally can also rename this toMinCorruptionChance). This approach will makeEnablePassiveCorruptionno longer needed.@ -10,0 +20,4 @@components:- type: DamagedSiliconAccentenablePassiveCorruption: trueenableChargeCorruption: falseThis will overwrite
DamagedSiliconAccentdefined bySyntheticVoicebox.Please explain, I'm unfamiliar as to why this would overwrite like this! I believed it would make its own instance and attach it on top, allowing for both effects to stack.
SyntheticVoiceboxtrait will initialize, add its version ofDamagedSiliconAccentcomponent to the entity. ThenDamagedSyntheticVoiceboxwill initialize and replaceDamagedSiliconAccentwith its version. That's just how traits are currently implemented. The issue you are experiencing comes from the fact thatDamagedSyntheticVoiceboxdoesn't havedamageAtMaxCorruption, meaning it will be set to null whenDamagedSyntheticVoiceboxinitializes.@ -10,0 +21,4 @@- type: DamagedSiliconAccentenablePassiveCorruption: trueenableChargeCorruption: falsecountsTowardsMaxTraits: false # Omustation - Don't count accents towards max traits# [Fork name]is added when you are making change to code that originates from a different fork (port). In this case you are adding new code and not modifying existing code, so I don't see where# Omustation - Don't count accents towards max traitswould come from.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.