. . . Posted May 25, 2016 Share Posted May 25, 2016 Like mosslings ? Link to comment Share on other sites More sharing options...
KitcheVadimas Posted May 25, 2016 Share Posted May 25, 2016 I've seen it done to catcoons in <default>'s mod pack, so yeah. Link to comment Share on other sites More sharing options...
. . . Posted May 25, 2016 Author Share Posted May 25, 2016 would anyone know how to add names? because I added STRINGS.MOSSLINGNAMES = { "Lil' Dude", } in the strings.lua and I also added #. STRINGS.MOSSLINGNAMES.1 msgctxt "STRINGS.MOSSLINGNAMES.1" msgid "Lil' Dude" msgstr "" in strings.pot but nothing happens ... I hope somebody can tell me what i'm doing wrong... Link to comment Share on other sites More sharing options...
Muche Posted May 25, 2016 Share Posted May 25, 2016 Adding new strings into STRINGS table does nothing until they are used somewhere. Pigman prefab does (apart some tag optimization): inst:AddComponent("named") inst.components.named.possiblenames = STRINGS.PIGNAMES inst.components.named:PickNewName() Thus, try inst:AddComponent("named") inst.components.named.possiblenames = STRINGS.MOSSLINGNAMES inst.components.named:PickNewName() Link to comment Share on other sites More sharing options...
. . . Posted May 25, 2016 Author Share Posted May 25, 2016 I have this code in my mossling.lua prefab local function fn() local inst = CreateEntity() inst:AddTag("_named") if not TheWorld.ismastersim then return inst end inst:RemoveTag("_named") inst:AddComponent("named") inst.components.named:PickNewName() inst.components.named.possiblenames = STRINGS.MOSSLINGNAMES And still nothing happens. no crash, no nothing ! Also, I copy and pasted strings.lua & strings.pot and put edited versions in my mod folder. Maybe i'm not supposed to that or I put them in wrong place? I put my strings.lua where my mod main is and I made an "language" folder to put my strings.pot in just like actual Don't Starve Together folder... Really hope this is fixable & thanks for helping ! Link to comment Share on other sites More sharing options...
Aquaterion Posted May 25, 2016 Share Posted May 25, 2016 2 minutes ago, SuperDavid said: I have this code in my mossling.lua prefab local function fn() local inst = CreateEntity() inst:AddTag("_named") if not TheWorld.ismastersim then return inst end inst:RemoveTag("_named") inst:AddComponent("named") inst.components.named:PickNewName() inst.components.named.possiblenames = STRINGS.MOSSLINGNAMES And still nothing happens. no crash, no nothing ! Also, I copy and pasted strings.lua & strings.pot and put edited versions in my mod folder. Maybe i'm not supposed to that or I put them in wrong place? I put my strings.lua where my mod main is and I made an "language" folder to put my strings.pot in just like actual Don't Starve Together folder... Really hope this is fixable & thanks for helping ! try putting possiblenames above PickNewName Link to comment Share on other sites More sharing options...
. . . Posted May 25, 2016 Author Share Posted May 25, 2016 4 minutes ago, Aquaterion said: try putting possiblenames above PickNewName Still nothing happens , thanks for help . Link to comment Share on other sites More sharing options...
. . . Posted May 25, 2016 Author Share Posted May 25, 2016 I changed inst.components.named.possiblenames = STRINGS.MOSSLINGNAMES into inst.components.named.possiblenames = STRINGS.PIGNAMES and it immediately works with the pignames but not my custom STRINGS.MOSSLINGNAMES names, maybe it's because I have only 1 name I need over 100 like the pigmen?! Dang, i'm so confused ... Link to comment Share on other sites More sharing options...
Muche Posted May 25, 2016 Share Posted May 25, 2016 Named:PickNewName() should handle only one name in the table just fine. Try entering into the debug console: print(tostring(STRINGS.MOSSLINGNAMES));dumptable(STRINGS.MOSSLINGNAMES); Does it print your names table? If it prints nil, then the table was not assigned properly. If it's set directly from modmain, GLOBAL.STRINGS.MOSSLINGNAMES may be needed. Link to comment Share on other sites More sharing options...
. . . Posted May 25, 2016 Author Share Posted May 25, 2016 When I did print(tostring(STRINGS.MOSSLINGNAMES));dumptable(STRINGS.MOSSLINGNAMES); in game debug console nothing was printed back not even nil & I just added GLOBAL.STRINGS.MOSSLINGNAMES into my modmain and it crashes the game. Link to comment Share on other sites More sharing options...
. . . Posted May 25, 2016 Author Share Posted May 25, 2016 Okay I did print(tostring(STRINGS.MOSSLINGNAMES));dumptable(STRINGS.MOSSLINGNAMES); in game and it returns nil. Link to comment Share on other sites More sharing options...
Muche Posted May 25, 2016 Share Posted May 25, 2016 Could you attach your whole mod? Link to comment Share on other sites More sharing options...
Muche Posted May 25, 2016 Share Posted May 25, 2016 (edited) Files /strings.lua and /languages/strings.pot are ignored, they are not loaded at all. Only files in scripts folder can override game's lua files (and even then it should be used sparingly, to avoid incompatibilities with future versions of the game and other mods). Put into modmain (anywhere after local STRINGS = GLOBAL.STRINGS, but not inside of GLOBAL.TheNet:GetIsMasterSimulation() check): STRINGS.MOSSLINGNAMES = { "Fried Chicken", "Lil' Dude", -- ... } Edited May 25, 2016 by Muche Link to comment Share on other sites More sharing options...
. . . Posted May 25, 2016 Author Share Posted May 25, 2016 Do I delete the strings.lua and pot then and also thanks very much it works ! 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