Depends on the issue, No one reads the whole topic so i bet the issue you had is just a flipping blender, or as i stated later that you needed to save first then try the new changes to the libload, or you where adding at the same time of libloading.
i found out (in this topic)that adding and libloading does not work together.
But atm my problem exist out of libload that loads assets that are not even mentioned in the blend.
I do not want to llink, i’m not using libload for nothing.
it’s pretty simple (my setup)
libload is the main blend,
directory levels contains blends that libloads blends from the assets folder.
so libload loads in level and level loads in assets, libload will put up a loading screen that waits till all assets are loaded.
in every level file you find an libload script(slightly other script then in libload blend), this goes trough a list with preset blends/assets to load.
but at this point i can open libload, and load a level, and anylevel will just load in the same blends/assets. and that is strange due to every blend has it own assets list to load.
I need to look at it again when i get home, but i bet nothing changed.
Lots of problems with libload. One big one is if you have any objects, meshes, materials or textures with the same name. Blender can get mixed up about which data belongs to which entity.
Another thing that can cause a problem is loading and freeing data on the same tic. Always add a little countdown timer (maybe 5 tics) between each operation.
Lastly there’s the problem of render texture being applied to loaded data. If you use render to texture or video texture or any thing like that on a loaded asset and then don’t unload that texture, blender will crash on exit.
It’s good practice to have a terminate() function in your code which goes through and manually ends objects, unlinks textures and frees libloaded data when you exit the game or switch to a different level. If you do that then the game should run smoothly no matter how many times you switch levels.
I’m an idiot lol, after hours of trying to get it fixed, i fixed it.
the solution was so simple, it didn’t even come up to me. The libload scripts in the level blends had the same name, this caused an issue (scripts don’t get freed???). So giving every load script an unique name per blend solved my issue.
Yes, it’s important that everything has a unique name, even materials, textures and scripts.
I usually handle my scripts externally to avoid problem like these… since I know they are all in the same place.
I do as well, but not when i build something and testing it, easier to make adjustments on the fly.
Once done i save it in the scripts directory and blender can load it from there.
But Libload stays strange, atm i builded a house.
Libload the house all is good, libload next level, and next, perfect, load previous, and again to get back to the house level, then everything seems to choke up, from 60+ fps it drops to a steady 12 fps and stays there, can take forever(chocking movement/mouse look etc.) or like 10 seconds before it becomes free and act normal again, very strange, no idea what causes this either. At this point everything is unique and no errors reported to console), strange it is for sure