. . . Posted January 1, 2017 Share Posted January 1, 2017 Hello, If somebody can help me with this I would really appreciate it, since I dunno what to do .. So, basically is there a way I can enable & disable "inst.components.talker.mod_str_fn = Umlautify" on certain actions? From what I tried it only works when in the common_postinit & I don't know how to enable & disable it or if it's even possible . So, if anyone knows how that would be great !! Link to comment Share on other sites More sharing options...
zUsername Posted January 2, 2017 Share Posted January 2, 2017 _G = GLOBAL local ACTIONS = _G.ACTIONS local ActionHandler = _G.ActionHandler AddStategraphPostInit("wilson", function(sg) sg.actionhandlers[ACTIONS.PICKUP] = ActionHandler(ACTIONS.PICKUP, function(inst, action) if inst.components.talker then inst.components.talker.mod_str_fn = "UmlautifyON" end return "doshortaction" end) sg.actionhandlers[ACTIONS.DROP] = ActionHandler(ACTIONS.DROP, function(inst, action) if inst.components.talker then inst.components.talker.mod_str_fn = "UmlautifyOFF" end return "doshortaction" end) end) Link to comment Share on other sites More sharing options...
zUsername Posted January 2, 2017 Share Posted January 2, 2017 On 1/1/2017 at 1:53 PM, SuperDavid said: Link to comment Share on other sites More sharing options...
. . . Posted January 3, 2017 Author Share Posted January 3, 2017 (edited) 23 hours ago, zUsername said: _G = GLOBAL local ACTIONS = _G.ACTIONS local ActionHandler = _G.ActionHandler AddStategraphPostInit("wilson", function(sg) sg.actionhandlers[ACTIONS.PICKUP] = ActionHandler(ACTIONS.PICKUP, function(inst, action) if inst.components.talker then inst.components.talker.mod_str_fn = "UmlautifyON" end return "doshortaction" end) sg.actionhandlers[ACTIONS.DROP] = ActionHandler(ACTIONS.DROP, function(inst, action) if inst.components.talker then inst.components.talker.mod_str_fn = "UmlautifyOFF" end return "doshortaction" end) end) I put it in my modmain.lua & it didn't seem to work, unfortunately.. I also tried putting "inst.components.talker.mod_str_fn = "UmlautifyON"" in common_postinit but it just crashed the game, but thanks very much for helping !! Edited January 3, 2017 by SuperDavid Link to comment Share on other sites More sharing options...
zUsername Posted January 3, 2017 Share Posted January 3, 2017 Did you tried my code on dedicated server ? Link to comment Share on other sites More sharing options...
. . . Posted January 3, 2017 Author Share Posted January 3, 2017 (edited) 35 minutes ago, zUsername said: Did you tried my code on dedicated server ? I tried it on world with caves enabled. Edited January 3, 2017 by SuperDavid Link to comment Share on other sites More sharing options...
zUsername Posted January 3, 2017 Share Posted January 3, 2017 (edited) Edit. Edited January 3, 2017 by zUsername Link to comment Share on other sites More sharing options...
. . . Posted January 3, 2017 Author Share Posted January 3, 2017 2 minutes ago, zUsername said: _G = GLOBAL local ACTIONS = _G.ACTIONS local ActionHandler = _G.ActionHandler local IsServer = _G.TheNet:GetIsServer() local state = "wilson_client" if IsServer then state = "wilson" end AddStategraphPostInit(state, function(sg) sg.actionhandlers[ACTIONS.PICKUP] = ActionHandler(ACTIONS.PICKUP, function(inst, action) if inst.components.talker then inst.components.talker.mod_str_fn = "UmlautifyON" end return "doshortaction" end) sg.actionhandlers[ACTIONS.DROP] = ActionHandler(ACTIONS.DROP, function(inst, action) if inst.components.talker then inst.components.talker.mod_str_fn = "UmlautifyOFF" end return "doshortaction" end) end) Is is supposed to become umlautified when picking up a item? If yes then it didn't work..but thanks so much for your help ! I appreciate it !! Link to comment Share on other sites More sharing options...
zUsername Posted January 3, 2017 Share Posted January 3, 2017 (edited) Have you enabled the mods on both server and client? You must remove ON and OFF follow Umlautify. _G = GLOBAL local ACTIONS = _G.ACTIONS local ActionHandler = _G.ActionHandler local IsServer = _G.TheNet:GetIsServer() local state = "wilson_client" if IsServer then state = "wilson" end AddStategraphPostInit(state, function(sg) sg.actionhandlers[ACTIONS.PICKUP] = ActionHandler(ACTIONS.PICKUP, function(inst, action) if inst.components.talker then inst.components.talker.mod_str_fn = "Umlautify" end return "doshortaction" end) sg.actionhandlers[ACTIONS.DROP] = ActionHandler(ACTIONS.DROP, function(inst, action) if inst.components.talker then inst.components.talker.mod_str_fn = nil end return "doshortaction" end) end) Edited January 3, 2017 by zUsername Link to comment Share on other sites More sharing options...
. . . Posted January 3, 2017 Author Share Posted January 3, 2017 I put that code in modmain.lua & I picked up/dropped items but it seemed it never worked? I also tried using it in my own function but it didn't work either? Spoiler local function activate_wathgrithr(act) if act.target.lord_mode == true then return end if act.target.wathgrithr_mode == nil then swap_mode(act) act.target.wathgrithr_mode = true act.target.components.talker.mod_str_fn = "Umlautify" act.target.components.eater:SetDiet({ FOODGROUP.OMNI }, { FOODTYPE.MEAT, FOODTYPE.GOODIES }) elseif act.target.wathgrithr_mode == true then swap_mode(act) act.target.battleborn = 0 act.target.wathgrithr_mode = nil act.target.components.talker.mod_str_fn = nil act.target.components.eater:SetDiet({ FOODGROUP.OMNI }, { FOODGROUP.OMNI }) end end Maybe it's impossible to toggle it off or on ...but I really appreciate all the effort you put into helping me, really thank you very much !!!! Link to comment Share on other sites More sharing options...
zUsername Posted January 3, 2017 Share Posted January 3, 2017 Wait you want everytime you picked up something, wathgrith will say "Wigfrid's umlauts..." right? Because I'm don't know "Umlautify" mean. Link to comment Share on other sites More sharing options...
. . . Posted January 3, 2017 Author Share Posted January 3, 2017 (edited) 12 hours ago, zUsername said: Wait you want everytime you picked up something, wathgrith will say "Wigfrid's umlauts..." right? Because I'm don't know "Umlautify" mean. No, what I want is on the function I show above I want to be able to turn " inst.components.talker.mod_str_fn = Umlautify " on & off, what " inst.components.talker.mod_str_fn = Umlautify " does is it makes the character say "ö" instead of "o" ! Edited January 3, 2017 by SuperDavid Link to comment Share on other sites More sharing options...
. . . Posted January 8, 2017 Author Share Posted January 8, 2017 (edited) Does anyone know how to do this ? Because I really don't want to have to make a double of my 5 speech files with "ö" instead of "o" ..but if nobody knows then I guess that's the only choice... Edited January 8, 2017 by SuperDavid Link to comment Share on other sites More sharing options...
zUsername Posted January 8, 2017 Share Posted January 8, 2017 Upload zip file here. Link to comment Share on other sites More sharing options...
zUsername Posted January 8, 2017 Share Posted January 8, 2017 (edited) @SuperDavid local function activate_wathgrithr(act) f act.target.lord_mode == true then return end if act.target.wathgrithr_mode == nil then -- Add Valkyrie. swap_mode(act) act.target.wathgrithr_mode = true GLOBAL.Profile:SetWathgrithrFontEnabled(true) act.target.components.talker.mod_str_fn = GLOBAL.Umlautify act.target.components.eater:SetDiet({ FOODGROUP.OMNI }, { FOODTYPE.MEAT, FOODTYPE.GOODIES }) elseif act.target.wathgrithr_mode == true then -- Remove Valkyrie. swap_mode(act) act.target.battleborn = 0 act.target.wathgrithr_mode = nil GLOBAL.Profile:SetWathgrithrFontEnabled(false) act.target.components.talker.mod_str_fn = nil act.target.components.eater:SetDiet({ FOODGROUP.OMNI }, { FOODGROUP.OMNI }) end end Tested works. Make sure you save Wathgrithr Font on save and load Wathgrithr Font on load. Edited January 8, 2017 by zUsername Link to comment Share on other sites More sharing options...
. . . Posted January 9, 2017 Author Share Posted January 9, 2017 @zUsername I used the "activate_wathgrithr" you made like this in my modmain Spoiler local function activate_wathgrithr(act) if act.target.lord_mode == true then return end if act.target.wathgrithr_mode == nil then -- Add Valkyrie. swap_mode(act) act.target.wathgrithr_mode = true GLOBAL.Profile:SetWathgrithrFontEnabled(true) act.target.components.talker.mod_str_fn = GLOBAL.Umlautify act.target.components.eater:SetDiet({ FOODGROUP.OMNI }, { FOODTYPE.MEAT, FOODTYPE.GOODIES }) elseif act.target.wathgrithr_mode == true then -- Remove Valkyrie. swap_mode(act) act.target.battleborn = 0 act.target.wathgrithr_mode = nil GLOBAL.Profile:SetWathgrithrFontEnabled(false) act.target.components.talker.mod_str_fn = nil act.target.components.eater:SetDiet({ FOODGROUP.OMNI }, { FOODGROUP.OMNI }) end end and my character when activating this code in a world with caves still does not talk like Wigfrid (I haven't tested on world with no caves)? ...Am I doing something wrong cause you said it worked, right ? 20 hours ago, zUsername said: Make sure you save Wathgrithr Font on save and load Wathgrithr Font on load. Maybe this is what I did wrong? How do I do this, sorry i'm dumb ...and thanks very much for your help man !!! Link to comment Share on other sites More sharing options...
zUsername Posted January 9, 2017 Share Posted January 9, 2017 @SuperDavid Sorry. My old laptop can't creating world with caves server. But it's works on world with no caves. Link to comment Share on other sites More sharing options...
. . . Posted January 9, 2017 Author Share Posted January 9, 2017 15 hours ago, zUsername said: Sorry. My old laptop can't creating world with caves server. But it's works on world with no caves. Oh, okay! Thanks a lot for your help !!! Shame that it doesn't work on world with caves but whatevs !! Link to comment Share on other sites More sharing options...
zUsername Posted January 10, 2017 Share Posted January 10, 2017 @SuperDavid You can create caves server and put me in to admin list. And let me check your mod. 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