Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access "Story Text" in a Say command by editing the Say command script? #1039

Open
holzfella opened this issue Nov 8, 2021 · 2 comments
Open
Labels
bug Doing something it's not meant to, or not doing something it's meant to.

Comments

@holzfella
Copy link

Hey guys,

I want to create a method which looks for certain keywords within a "Say-text" and then change that word to something else.
So far I came up with the idea to edit the "base scripts" and add methods in there which do that automatically before the Say dialogue is typed out.
Is that even possible? Can I modify the base scripts at all?

I already tried something similar in the Character script: I added a string variable called "Character Pronoun" but it won't show up in the inspector (and yes, it's a Serialize Field already).

I'm not a coding pro. I know there are certain types of classes/scripts which can only be edited via some code words and methods. So my guess is the same applies to the Fungus scripts/classes.

Does anyone have any idea on how to do that?
Or perhaps another idea on how to search the Story Text field within the Say command for certain words?

@holzfella holzfella added the bug Doing something it's not meant to, or not doing something it's meant to. label Nov 8, 2021
@breadnone
Copy link
Contributor

Hi, you can do that by exposing the text field in the Say command to public, then recursively pool every Say commands in a single block or even multiple blocks then SubString your way from there. Good luck!

@holzfella
Copy link
Author

Hi, you can do that by exposing the text field in the Say command to public, then recursively pool every Say commands in a single block or even multiple blocks then SubString your way from there. Good luck!

Hey, thanks for the reply! I think I figured out an easier approach to this: you can actually access/use variables in a Say text itself by using {$VarName} where a variable should get replaced by one that is set "beforehand" (like the main character's name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Doing something it's not meant to, or not doing something it's meant to.
Projects
None yet
Development

No branches or pull requests

2 participants