Jump to content

Game crashing question


drarem
 Share

Recommended Posts

self.window = 0

--Create a window/ hide mouse functon at very bottom self.window:HideMouse()

local windowstyle = window.FullScreen

if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end

self.window=Window:Create(self.title,0,0,System:GetProperty("screenwidth","1600"),System:GetProperty("screenheight","900"),windowstyle)

self.window:ShowMouse() --- line 96

Link to comment
Share on other sites

I can nail down the exact reason for the crash but just from snippet you have posted I can already see a few 'unclean' things.

 

1st: Why are you even setting 'self.window=0' at all? There's no need for that and even though Lua isn't strictly typed, this could cause issues more than be helpful. It should actually be hard to even detect window being nil with that in the code. You should be seeing type issues instead.

 

Judging from that I somehow fear that you are setting self.window to nil somewhere in the lines you didn't post.

 

2nd: Setting 'windowstyle = window.FullScreen' will cause issues while keeping if 'System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end' if somebody actually ever uses command line option for fullscreen, as window.FullScreen .titlebar are actually just constant numbers that, when added, give a sum that can be uniquely traced back to the flags that were set. Adding the same constant twice should never happen here.

 

I would strongly recommend pasting the entire App.lua contents unless you are hiding the secret sauce there.

Link to comment
Share on other sites

That's pretty much the window init code, nothing cut out. I do have the self.title="Pump-Action Captain" right above it.

 

I commented out:

self.window = 0

if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end

 

Will see if this helps, but it's almost like the person's pc doesn't support 1600x900 resolution?

 

Thanks.

Link to comment
Share on other sites

That's pretty much the window init code, nothing cut out. I do have the self.title="Pump-Action Captain" right above it.

 

I commented out:

self.window = 0

if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end

 

Will see if this helps, but it's almost like the person's pc doesn't support 1600x900 resolution?

 

Thanks.

 

1600x900 isn't a common resolution.

 

Take a look at http://www.leadwerks.com/werkspace/page/api-reference/_/system/systemcountgraphicsmodes-r857

That will count the resolutions that the computer has.

And this will use one of those numbers to give you the actual resolution: http://www.leadwerks.com/werkspace/page/api-reference/_/system/systemcountgraphicsmodes-r857

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