A way to replace unknown entities with known entities when a map loads?
2 replies, posted
Is there a way to tell the engine via Lua to use another entity class for deprecated/removed ones? All I get is this message:
"Attempted to create unknown entity type <entity class>!
Can't init <entity class>"
I don't really want to clutter the entities folder with entities named similar to the removed ones whose only purpose it is to spawn the actual entities (:GetPos and :GetAngles -> ents.Create and keyvalues stuff). It's only a hacky and performance draining way to do it, especially if it's about more than 100 completely different weapons and entities.
I don't think there's any other way than creating those entities like you said, using the entities folder, because when an entity class doesn't exist in the "factory", it isn't created at all (I think, seems the most logical). Also, it's hardly hacky or performance draining. It's the correct way to do it. All major gamemodes do it, for example, TTT.
I "solved" it by creating my own entity subfolders via include for better organization. That way I won't mind the mess for backwards compatibility. Thank you though.
Sorry, you need to Log In to post a reply to this thread.