Jump to content

Recommended Posts

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 by Bad Willow

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.

  • Like 1

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...