Is it me? scripted_ents.Register and ENT.Spawnable
5 replies, posted
So I have a base and am registering a new ENT via scripted_ents.Register with a base and for some reason it just doesn't appear in the spawn menu entities>category etc. I have specified. Would appreciate if anyone could give me the reason why xD
Method of adding within "InitPostEntity" hook in the shared of the base.
[CODE]
scripted_ents.Register( {
Type = "anim",
Base = "drinkable_alcohol",
PrintName = alc_data.name,
Author = "16 Bytes",
Contact = "N/A",
Category = "Alcohol",
Spawnable = true,
AdminSpawnable = true
}, alc_class )
[/CODE]
And the base drinkable_alcohol
[CODE]
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Alcohol"
ENT.Author = "16 Bytes"
ENT.Category = "Alcohol"
ENT.Spawnable = true
ENT.AdminSpawnable = true
[/CODE]
I thought maybe the entities are being registered after the spawn menu was being created and due to lack of refresh but I did change the hook to "PopulateToolMenu" just to see. Appreciate any responses.
Can you see the entity after reloading the spawnmenu with 'spawnmenu_reload'?
no it doesnt sadly :(
alc_class is a string?
scripted_ents.Register is an internal function. You should not be using it unless you know what you are doing.
I mean the entities do register and they are within scripted_ents.GetSpawnable(). I am just not sure how I can register them in as well get the spawnmenu to process them too.
[editline]19th April 2017[/editline]
It was just the hook that it was registering in, I just added a delay to sorta hack it.
Sorry, you need to Log In to post a reply to this thread.