Page 1 of 1

[fixed][14.21]Error: Unit prototype required but missing.

Posted: Wed Dec 21, 2016 7:18 pm
by matjojo
Still working on a base replacement, and an error has popped up I can't figure out.

Code: Select all

Error: Unit prototype required but missing.
Unit prototype? I have literally no idea what this might mean, I'm in the process of indexing all the game files to allow me to search through them, but that is taking ages, so I hope anyone of you guys has done that, or can help me with the error.
For now I have been manually opening all the prototype files and using CTRL-F to look for 'unit'. But I have not been able to find it.

The error message ingame:
Image

Re: [14.21]Error: Unit prototype required but missing.

Posted: Wed Dec 21, 2016 7:34 pm
by Nexela
Look in demo-entities.lua

Unit is the biters/etc


You can usually open a whole directory up in your editor and make use of its find in files features to search that way.

Re: [14.21]Error: Unit prototype required but missing.

Posted: Wed Dec 21, 2016 8:43 pm
by matjojo
demo-entities only found this line which is not it:

Code: Select all

function make_unit_melee_ammo_type(damagevalue)
but your idea is a smart one, I'll see how NPP likes opening all those files. I really should have thought about that on my own instead of opening the files one by one.

as for the enemies, I can find the entity that has as it's type "unit", being the small-biter, adding this to the prototypes worked, although the error message did not say small-biter prototype. Kinda weird, but I guess that nobody should actually be reading these.

Re: [fixed][14.21]Error: Unit prototype required but missing.

Posted: Wed Dec 21, 2016 8:52 pm
by Nexela
small-biter is just the name for "unit"

Also NPP has an open folder option. Still might be worth moving to an editor or IDE that supports linting though :)

Re: [fixed][14.21]Error: Unit prototype required but missing.

Posted: Wed Dec 21, 2016 9:57 pm
by daniel34
It is the biter/spitter units. Removing both files demo-enemies.lua and enemies.lua, removing their references from data.lua and the steamrolled achievement that requires the type unit-spawner will result in that exact error message.
You can then actually continue to the main menu, but on creating a new map it will give the same error and quit.

As Nexela already mentioned it is a unit prototype:

Code: Select all

    type = "unit",
    name = "small-biter",
You are probably required to create a unit prototype, even if it's just a dummy. As long as you don't also require a unit-spawner prototype there shouldn't be a way to actually spawn them, or you disable them in your scenario.