Jump to content

Purpose of declaring prefabs?


Recommended Posts

Hello

In some mobs or character files sometimes various prefabs or effects are declared at the start of the file

image.png.54ecfa8ec939039f5d609fd475bc5b4c.png

I do not understand the purpose of this, as everything seems to work fine even without that

Pls explain someone thnx

Link to comment
Share on other sites

I believe correct me if I am wrong that its for asset preloading.

Any prefabs in the file of another file will have their assets also loaded so that there is less delay when the prefab is spawned.

Its part of the dynamic asset loading system.

  • Like 2
Link to comment
Share on other sites

In addition it also serves as dependencies so things can load in the proper order for like post inits and such, you can also see a lot in the forest prefab since it spawns off a lot of different prefabs for worldgen.

Prefab = Class( function(self, name, fn, assets, deps, force_path_search)
return Prefab(name, fn, customassets, worldprefabs)

 

  • Like 1
  • Sanity 3
Link to comment
Share on other sites

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
 Share

×
  • Create New...