Hodor88 Posted November 21, 2015 Posted November 21, 2015 Hi there, having to trouble with my Scripts. I'm using an Spawn Script for Zombies. This works finde in Editor Mode and Debug. No Problems so far. After Publishing the Game. On first spawn i get following Error Message: Error: Failed to read file "C:/Users/Marco/Desktop/ZombieZ-Starter/GameStarter/G ameStarter/bin/Debug/Data/Horde/offshore/AddOns/Zombie Character Pack/zombie1.pfb". Error: Failed to load prefab "C:/Users/Marco/Desktop/ZombieZ-Starter/GameStarter /GameStarter/bin/Debug/Data/Horde/offshore/AddOns/Zombie Character Pack/zombie1.pfb". Lua Error: [string "C:/Users/Marco/Desktop/ZombieZ-Starter/GameStarter/GameStart er/bin/Debug/Data/Horde/offshore/scripts/gamecontroller.lua"]:99: attempt to index local 'zombie' (a nil value) I guess the problem is that the script wants to load the file from this path: C:/Users/Marco/Desktop/ZombieZ-Starter/GameStarter /GameStarter/bin/Debug/Data/Horde/offshore/AddOns/Zombie Character Pack/zombie1.pfb This can not work, because all of the Game Data is zipped in the Data directory. Any idea how to fix this issue? 1 Quote
Rick Posted November 21, 2015 Posted November 21, 2015 If you are using Prefab:Load() and passing in a relative path it should be fine. One thing we run into is when publishing make sure to do ALL files not just used files. If your prefab is NOT in the editor and ONLY loaded in code then the publish won't include it in the build because I don't think the publisher goes through the code to see what's used, but instead just looks at the map file to see what's used and what to include in the zip files. Your other way around this is to place the prefab in the scene somewhere as a precache. Just disable it. 2 Quote
Hodor88 Posted November 21, 2015 Author Posted November 21, 2015 Thanks for the quick answer... That was the problem Had checked the option "Only include used files". Thanks very much. Best Regards Marco Quote
Josh Posted November 21, 2015 Posted November 21, 2015 Publish it so I can play it on my Steam Machine! 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
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.