Jump to content

C++ Lua Script:Start() App Is Nil


MetalAZ
 Share

Recommended Posts

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().

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...