FurryEskimo Posted May 1, 2024 Share Posted May 1, 2024 Does anyone have any idea how to use this component? I've only found a few mods that seem to use it, but can't understand their code.. I thought it would be really simple, but I think I'm missing code related to UI elements. Basically, I'm just trying to add the writeable component to a custom tent. Link to comment https://forums.kleientertainment.com/forums/topic/155857-writeable-component/ Share on other sites More sharing options...
Rickzzs Posted May 1, 2024 Share Posted May 1, 2024 It is similar to container. It is a component plus a definition(you require it and add a param). 1 Link to comment https://forums.kleientertainment.com/forums/topic/155857-writeable-component/#findComment-1712022 Share on other sites More sharing options...
FurryEskimo Posted May 1, 2024 Author Share Posted May 1, 2024 3 minutes ago, Rickzzs said: It is similar to container. It is a component plus a definition(you require it and add a param). Wonderful, can you tell me more, or provide an example? I could provide my current code, but it's currently very messy.. Basically I just wanted a placid structure to place and name, so I took a tent, stripped it of everything tent related, and tried adding the writable component. Link to comment https://forums.kleientertainment.com/forums/topic/155857-writeable-component/#findComment-1712023 Share on other sites More sharing options...
Rickzzs Posted May 3, 2024 Share Posted May 3, 2024 --1.Add Writeable component --inst.entity:SetPristine() --if not TheWorld.ismastersim then -- return inst --end inst:AddComponent("writeable") -- config the component -- inst.components.writeable:SetDefaultWriteable(false) -- inst.components.writeable:SetAutomaticDescriptionEnabled(false) --... --2.Add Params local writeables=require("writeables") writeables.AddLayout(prefab,{ prompt = STRINGS.SIGNS.MENU.PROMPT_BEEFALO,--the name animbank = "ui_board_5x3",--the background animbuild = "ui_board_5x3", menuoffset = Vector3(6, -70, 0),--the position maxcharacters = TUNING.BEEFALO_NAMING_MAX_LENGTH,--max length defaulttext = function(inst, doer)--default text return subfmt(STRINGS.NAMES.BEEFALO_BUDDY_NAME, { buddy = doer.name }) end, cancelbtn = {--mostly cancel button text = STRINGS.BEEFALONAMING.MENU.CANCEL, cb = nil,--callback control = CONTROL_CANCEL --keybind }, middlebtn = {--mostly something else text = STRINGS.BEEFALONAMING.MENU.RANDOM, cb = function(inst, doer, widget) local name_index = math.random(#STRINGS.BEEFALONAMING.BEEFNAMES) widget:OverrideText( STRINGS.BEEFALONAMING.BEEFNAMES[name_index] ) end, control = CONTROL_MENU_MISC_2 }, acceptbtn = {--mostly accept button text = STRINGS.BEEFALONAMING.MENU.ACCEPT, cb = nil, control = CONTROL_ACCEPT }, }) 1 Link to comment https://forums.kleientertainment.com/forums/topic/155857-writeable-component/#findComment-1712423 Share on other sites More sharing options...
FurryEskimo Posted May 11, 2024 Author Share Posted May 11, 2024 (edited) Thanks, but for some reason that hasn't worked. I can see that you've defined 'maxcharacters', but it seems to cause the writeablewidget code to crash, because 'config.maxcharacters' claims 'config' is nil. ice_den.lua Edited May 11, 2024 by FurryEskimo Link to comment https://forums.kleientertainment.com/forums/topic/155857-writeable-component/#findComment-1713504 Share on other sites More sharing options...
Mr.CrazyPotato Posted December 10, 2024 Share Posted December 10, 2024 On 5/3/2024 at 4:52 PM, Rickzzs said: --2.Add Params I don't know what I have done not right. It's driving me crazy. For some reason code doesn't work for clients. It says: [01:04:57]: Invalid LeftClick RPC from (KU_voGjEE4r) kristal_milton or [01:05:00]: Invalid UseItemFromInvTile RPC from (KU_voGjEE4r) kristal_milton Everytime client tryied to perform action, this traceback appears. And it's same with homesigns so it's SOMETHING wrong with action, right? I think so, the problem is not replica writeable or not replica writeable. I don't even know what that error message suppose to mean. I don't even know what is the LeftClick RPC and where the hell it is, why is it invalid. I've been trying for 5 days and I know that it's bad to ask people you don't know to do stuff you're supposed to do but please. Here's my files: modmain.lua, written_papyrus.lua. Link to comment https://forums.kleientertainment.com/forums/topic/155857-writeable-component/#findComment-1773050 Share on other sites More sharing options...
Rickzzs Posted December 13, 2024 Share Posted December 13, 2024 (edited) On 12/11/2024 at 12:47 AM, Mr.CrazyPotato said: I don't know what I have done not right. It's driving me crazy. For some reason code doesn't work for clients. It says: [01:04:57]: Invalid LeftClick RPC from (KU_voGjEE4r) kristal_milton or [01:05:00]: Invalid UseItemFromInvTile RPC from (KU_voGjEE4r) kristal_milton Everytime client tryied to perform action, this traceback appears. And it's same with homesigns so it's SOMETHING wrong with action, right? I think so, the problem is not replica writeable or not replica writeable. I don't even know what that error message suppose to mean. I don't even know what is the LeftClick RPC and where the hell it is, why is it invalid. I've been trying for 5 days and I know that it's bad to ask people you don't know to do stuff you're supposed to do but please. Here's my files: modmain.lua, written_papyrus.lua. I don't know why ur adding another write action but RPC can be traced by GLOBAL.HandleRPC (to trace it simply insert a print when this function is called). The error comes from GLOBAL.RPC.LeftClick, which is located in scripts/networkingrpc.lua(maybe I remember the names wrongly) where there's a server-side check on every param of the action sent by client. And your action failed on that check. Edited December 13, 2024 by Rickzzs 1 Link to comment https://forums.kleientertainment.com/forums/topic/155857-writeable-component/#findComment-1775068 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