icantevenname Posted June 23, 2021 Share Posted June 23, 2021 I wanna give an uploaded character a totally new speech script, but feel like people would want an option to keep using the old one. How do I set things up so that the mod can be configured to select one of the two speech files? 1 Link to comment Share on other sites More sharing options...
Monti18 Posted June 24, 2021 Share Posted June 24, 2021 You could try if adding something like this to you modmain works: if GetModConfig("which_speechfile") == 1 then GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_your_character1" else GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_your_character2" end 1 Link to comment Share on other sites More sharing options...
AkaiNight Posted June 25, 2021 Share Posted June 25, 2021 2 hours ago, Monti18 said: You could try if adding something like this to you modmain works: if GetModConfig("which_speechfile") == 1 then GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_your_character1" else GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_your_character2" end quick question is it possible to change it in game? like when its fullmoon character uses speech_1 and if its new moon character uses speech_2 and if its not any of them the character uses speech_3) Link to comment Share on other sites More sharing options...
Monti18 Posted June 25, 2021 Share Posted June 25, 2021 I don't know, I have never tried it. Just try it and see if it works, I think that should be possible. Listen to the event of full moon and new moon and run a function that changes the strings. 1 Link to comment Share on other sites More sharing options...
icantevenname Posted June 26, 2021 Author Share Posted June 26, 2021 On 6/24/2021 at 5:30 PM, Monti18 said: You could try if adding something like this to you modmain works: if GetModConfig("which_speechfile") == 1 then GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_your_character1" else GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_your_character2" end Wait, I thought that kinda stuff was supposed to go in Modinfo? Link to comment Share on other sites More sharing options...
Monti18 Posted June 26, 2021 Share Posted June 26, 2021 As far as I know, the STRINGS go into the modmain, modinfo is just for the configuration and so on. 2 Link to comment Share on other sites More sharing options...
icantevenname Posted June 27, 2021 Author Share Posted June 27, 2021 11 hours ago, Monti18 said: As far as I know, the STRINGS go into the modmain, modinfo is just for the configuration and so on. Ah. But how do I set up the configuration then? Link to comment Share on other sites More sharing options...
Monti18 Posted June 27, 2021 Share Posted June 27, 2021 Look at this post by Ultroman, it has all the necessary information: 1 Link to comment Share on other sites More sharing options...
icantevenname Posted June 28, 2021 Author Share Posted June 28, 2021 So there's a problem. My modmain has if GetModConfig("which_speechfile") == 1 then GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_inky1" else GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_inky2" end and in my modinfo has configuration_options = { { name = "which_speechfile", label = "Personality", options = { {description = "Speech 1", data = 1}, {description = "Speech 2", data = 2}, }, default = 2, } } but the game hard crashes. I looked at the log and at the line of GetModConfig it says "attempt to call global 'GetModConfig' (a nil value)". I have no idea what to do next. Link to comment Share on other sites More sharing options...
Monti18 Posted June 29, 2021 Share Posted June 29, 2021 It's GetModConfigData and not GetModConfig, that's why it's nil 1 Link to comment Share on other sites More sharing options...
icantevenname Posted June 29, 2021 Author Share Posted June 29, 2021 The crashing stopped, but it seems like nothin's happening. I switch to the other option, but it stays at the default. I've tried to remove the lone require speech, but that only makes it that Wilson's speech is used... Link to comment Share on other sites More sharing options...
Monti18 Posted June 30, 2021 Share Posted June 30, 2021 I just tried it, it works on my side. Did you change YOUR_CHARACTER in the code if GetModConfig("which_speechfile") == 1 then GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_inky1" else GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_inky2" end to the name of your character in upper case? Did you remove the line in the modmain that selects the speechfile that you had in there before ? GLOBAL.STRINGS.CHARACTERS.YOUR_CHARACTER = require "speech_inky" If you did all of this, post your modmain so I can have a look. 1 1 Link to comment Share on other sites More sharing options...
icantevenname Posted July 1, 2021 Author Share Posted July 1, 2021 Okay... So... I never claim to be a smart man. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now