MetalAZ Posted July 23, 2014 Share Posted July 23, 2014 Is this the expected behavior? I got the C++ DLC on Steam and created a new project using C++. I added the awesome water prefab to the map using and the game crashed when I tried to run it. It crashed because App is nil in Script:Start(). Quote Link to comment Share on other sites More sharing options...
Admin Posted July 23, 2014 Share Posted July 23, 2014 C++ projects do not use an "App" table in Lua. For this reason entity scripts should not expect it to be there. Quote Link to comment Share on other sites More sharing options...
Rick Posted July 23, 2014 Share Posted July 23, 2014 Basically the water prefab seems like it will only work with a Lua project at this time because it must be using the App logic somewhere. This is actually an interesting thing which I haven't thought of. I always advocated to just use App.context/window/camera in entity scripts but I see now why that is wrong. I didn't make this water prefab but the person who did probably thought the same thing when they made it. Since Leadwerks for Lua was the first one out everything was working fine, but now that C++ is out these will be broken. Find in Script:Start() of the prefab what variable it's trying to access of App (App.?). There are other functions you can use that won't rely on App to get things like World::GetCurrent(), Context:GetCurrent(), etc. If it's the camera that it's trying to get from App then you'll have to do that another way. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 23, 2014 Share Posted July 23, 2014 You can use Context:GetCurrent() instead. 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...
shadmar Posted July 23, 2014 Share Posted July 23, 2014 The waterprefab is kind of outdated and hard to use I will remove it. I was suppose to make a new one, but was kind of hoping klepto to put his in the workshop instead. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted July 23, 2014 Share Posted July 23, 2014 If it's in the Workshop I would not remove it. It's okay to rename it like "Water Prefab [Legacy]" or something like that. 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...
Rick Posted July 23, 2014 Share Posted July 23, 2014 Just say Lua version or something because it'll work with that still. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted July 24, 2014 Share Posted July 24, 2014 Or combine it. Water Prefab [Luacy] 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.