Genebris Posted January 14, 2017 Share Posted January 14, 2017 Prefab:Load("prefabs/projectiles/arrow.pfb") Prefab:Load("prefabs/projectiles/arrow.pfb",Map.LoadScripts,Prefab.NoStartCall) First function will load prefab correctly, second one will fail to load it. This will be in the log: Loading prefab "C:/Users/Genebris/Desktop/SotKaal/prefabs/projectiles/arrow.pfb"... .. Loading prefab "prefabs/projectiles/arrow.pfb" [32]... Error: Failed to read file "prefabs/projectiles/arrow.pfb". Error: Failed to load prefab "prefabs/projectiles/arrow.pfb". You can see that second call didn't get a correct file path. This happens ONLY in published game (standalone or launcher). Does NOT matter if you included only used files or not. It doesn't happen in the editor or if you launch exe in your project folder. I'm not sure if this is the correct use of loading flags, but if it's not, it should at least give the same error in the editor because I spent 40 minutes thinking that my prefab doesn't get included into the build. Quote Link to comment Share on other sites More sharing options...
macklebee Posted January 26, 2017 Share Posted January 26, 2017 I am confused on this. Should not the flag parameter have the two flags added together instead of separated by a comma? If not, then this is different than all other usage of LE commands that have the ability to stack multiple options together for 1 parameter (eg. the style parameter for Window:Create()). Seems like the reason it is failing to load would be because the engine thinks you are setting the fileid parameter for a workshop item with the variable 'Prefab.NoStartCall'. Syntax static Entity* Load(const std::string& path, int flags=Map::LoadScripts, const uint64_t fileid=0) So it should be: Prefab:Load("prefabs/projectiles/arrow.pfb", Map.LoadScripts+Prefab.NoStartCall) Edit--But yes, I agree that it needs to give an error regarding this when played from the editor if it cannot find that workshop GUID item. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted January 26, 2017 Share Posted January 26, 2017 I am confused on this. Should not the flag parameter have the two flags added together instead of separated by a comma? If not, then this is different than all other usage of LE commands that have the ability to stack multiple options together for 1 parameter (eg. the style parameter for Window:Create()). Seems like the reason it is failing to load would be because the engine thinks you are setting the fileid parameter for a workshop item with the variable 'Prefab.NoStartCall'. Syntax static Entity* Load(const std::string& path, int flags=Map::LoadScripts, const uint64_t fileid=0) So it should be: Prefab:Load("prefabs/projectiles/arrow.pfb", Map.LoadScripts+Prefab.NoStartCall) Edit--But yes, I agree that it needs to give an error regarding this when played from the editor if it cannot find that workshop GUID item. Yes, those should be added together. The fileID is an old system that is no longer used. I just left the parameter in so old code will still compile. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 27, 2017 Share Posted January 27, 2017 Can you confirm this was the problem? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Genebris Posted January 28, 2017 Author Share Posted January 28, 2017 Yes, it works now. This should be mentioned here: http://www.leadwerks.com/werkspace/page/api-reference/_/prefab/prefabload-r622 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.