skittles sour Posted January 15, 2022 Share Posted January 15, 2022 (edited) I wanted to change the name of things, to add a prefix to certain structures, and it seemed that the easiest way to do that is to add the named component. I made it so that when you apply a certain item to the structure it becomes electric, however, when I test it out as a client, I would get this crash that has to do with the highlight component. Is there a specific way you have to add the named component when you're adding it mid-game? [00:21:58]: [string "scripts/componentactions.lua"]:2165: attempt to index a nil value LUA ERROR stack traceback: scripts/componentactions.lua:2165 in (method) UnregisterComponentActions (Lua) <2150-2177> scripts/entityscript.lua:592 in (method) RemoveComponent (Lua) <579-594> scripts/components/highlight.lua:120 in (method) UnHighlight (Lua) <113-122> scripts/components/playercontroller.lua:2076 in (method) OnUpdate (Lua) <1916-2375> scripts/update.lua:256 in () ? (Lua) <218-292> Edited January 15, 2022 by Bad Willow Link to comment https://forums.kleientertainment.com/forums/topic/136926-client-crash-when-adding-named-component/ Share on other sites More sharing options...
Monti18 Posted January 16, 2022 Share Posted January 16, 2022 Could you post a a longer version of the crash, where all the different variables are shown? It seems like the game tries to unregister a component action, but it doesn't exist. So you are adding the named component sometimes during the game? This is probably your problem, as the replica of the named component is probably not properly initialized on the client when the game is already started. It would be better to add the named component with a AddPrefabPostInit to the structures at the beginning of the game and then you only change the name when you need it. 1 Link to comment https://forums.kleientertainment.com/forums/topic/136926-client-crash-when-adding-named-component/#findComment-1533066 Share on other sites More sharing options...
skittles sour Posted January 17, 2022 Author Share Posted January 17, 2022 Yes! that is a solution! I ended up using another one, where I overwrote the get adjective function in entity script. It is a bizarre crash and I'll try to recreate it to figure out where exactly its coming from, I remember that I used to get a similar crash when hovering over flint as were-wilba when using hornet's hamlet characters mod Link to comment https://forums.kleientertainment.com/forums/topic/136926-client-crash-when-adding-named-component/#findComment-1533210 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