Skip to content

Expanding language keys and adding mixed-language speech.#5271

Open
MistakeNot4892 wants to merge 1 commit into
NebulaSS13:devfrom
MistakeNot4892:tweak/langkeys
Open

Expanding language keys and adding mixed-language speech.#5271
MistakeNot4892 wants to merge 1 commit into
NebulaSS13:devfrom
MistakeNot4892:tweak/langkeys

Conversation

@MistakeNot4892

@MistakeNot4892 MistakeNot4892 commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Description of changes

This was just supposed to be the keys stuff but I kinda spiralled.

  • Languages can have keys of any length.
  • Language keys must be text.
  • Language keys in speech must be followed by a space.
  • Using a numerical key for speech will look for that language sequentially in your language list. ie. ,1 is your first known language.
  • Partial keys will use the first matching language in your language list. ,h will match ,human.
  • You can use a language key in the middle of a sentence to switch language.
  • Rewrote holopads to handle message passing in a better/more coherent way with less code.
image

Why and what will this PR improve

Mixing languages in speech is good fun for RP, and the backend changes have cleaned up, centralized a fair wodge of logic.

TODO

  • Rewrite holopads to handle phrases properly. Oh god oh fuck.
  • Sort out why the MC is soft resetting after speech (probably a blocking loop somewhere).
  • Test basic speech (no language, one language, multiple languages)
  • Test basic speech over radio.
  • Test basic speech over broadcast (binary).
  • Test basic speech over holopad.
  • Test mixed broadcast (binary) and spoken.
  • Test mixed sign/nonvocal and spoken.

Issues

  • Overhead text not offset high enough.
  • Animal noises are not scrambled. Type understands type, intentional.
  • Sign language not transmitted over holopad.
  • Cannot speak plain binary (gives 'you cannot mix non-spoken and spoken' error).

Authorship

Myself.

Changelog

TBD

@MistakeNot4892 MistakeNot4892 added the work in progress This PR is under development and shouldn't be merged. label Jan 11, 2026
@MistakeNot4892
MistakeNot4892 force-pushed the tweak/langkeys branch 7 times, most recently from 6ea8321 to 1c17b68 Compare January 12, 2026 05:37
Comment thread code/modules/mob/living/say.dm Outdated
@MistakeNot4892
MistakeNot4892 force-pushed the tweak/langkeys branch 2 times, most recently from 1fe1556 to 3b090d3 Compare January 14, 2026 20:10
@MistakeNot4892 MistakeNot4892 added ready for review This PR is ready for review and merge. and removed work in progress This PR is under development and shouldn't be merged. labels Jan 14, 2026
@MistakeNot4892

Copy link
Copy Markdown
Contributor Author

I need to do some more exhaustive testing before merge, but I think this is good for review now.

@MistakeNot4892
MistakeNot4892 force-pushed the tweak/langkeys branch 2 times, most recently from ce8b024 to f63c163 Compare February 21, 2026 01:51
@MistakeNot4892
MistakeNot4892 force-pushed the tweak/langkeys branch 3 times, most recently from 72f4a9f to 7df06a5 Compare May 7, 2026 04:52
@MistakeNot4892

MistakeNot4892 commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

Binary radio headset does allow you to send different languages over binary, but that is a niche enough case that I don't want to fix it for this PR.

@MistakeNot4892
MistakeNot4892 force-pushed the tweak/langkeys branch 2 times, most recently from c919795 to 2d92651 Compare May 23, 2026 02:26
Rewriting/organising holopad code.
Debugging/further work on mixed language speech.
@MistakeNot4892

Copy link
Copy Markdown
Contributor Author

Last issue is that overhead text flickers and is out of place for 1 tick immediately after creation. I have no idea why, logic looks straightforward.

@MistakeNot4892
MistakeNot4892 marked this pull request as ready for review May 23, 2026 02:34

@out-of-phaze out-of-phaze left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stopped reviewing at holopad because that's gonna take a while to get through. will look into the text over head issue in the meantime

Comment thread code/_helpers/game.dm
Comment on lines 205 to 210
FOR_DVIEW(var/turf/T, range, center, INVISIBILITY_MAXIMUM)
hearturfs[T] = TRUE
for(var/mob/M in T)
mobs += M
if(islist(mobs))
for(var/mob/M in T)
mobs += M
END_FOR_DVIEW

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit of code duplication but for things as hot as this it might be worth it to move the islist(mobs) check all the way out of the loop and instead have two different ones

	if(islist(mobs))
		FOR_DVIEW(var/turf/T, range, center, INVISIBILITY_MAXIMUM)
			hearturfs[T] = TRUE
			for(var/mob/M in T)
				mobs += M
		END_FOR_DVIEW
	if(else)
		FOR_DVIEW(var/turf/T, range, center, INVISIBILITY_MAXIMUM)
			hearturfs[T] = TRUE
		END_FOR_DVIEW

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This will mean we're doing two full separate dviews.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i must have been sleep deprived when i wrote that, else instead of if(else). only one will run at a time, we're just hoisting the check out of the loop

Comment thread code/_helpers/game.dm
Comment on lines +216 to +217
else if(hearturfs[get_turf(M)])
mobs |= M

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hold on, won't this always be redundant because we added the mobs earlier when we set hearturfs? or is this for recursive contents given the get_turf? because in that case the virtual mobs system may work better for that kind of thing, idk

Comment thread code/_helpers/game.dm
mobs |= M

if(islist(objs))
for(var/obj/O in global.listening_objects)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: global.listening_objects_by_z could be a really good optimization here

Comment thread code/_helpers/text.dm
return trim_left(trim_right(text))

/// Adds punctuation to an emote or speech message automatically.
/proc/handle_autopunctuation(message)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: moved from code/modules/mob/say.dm

@out-of-phaze out-of-phaze added the awaiting author This PR is awaiting action from the author before it can be merged. label Jul 9, 2026
@out-of-phaze out-of-phaze removed the ready for review This PR is ready for review and merge. label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting author This PR is awaiting action from the author before it can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants