Thursday, 08 January 2009
 
  Home arrow Forum  
Main Menu
Home
News
Forum
Documentation
Download
Links
Administrator
Login Form
Welcome, Guest. Please login or register.
January 08, 2009, 01:07:28 PM
Username: Password:
Login with username, password and session length

Forgot your password?
Bug: 01 - Hello.lua
DSLua Community
Welcome, Guest. Please login or register.
January 08, 2009, 01:07:28 PM
1724 Posts in 316 Topics by 10294 Members
Latest Member: glapinaigma
DSLua Community  |  DSLua - Best scripting language for Nintendo DS  |  Bugs & Suggestions  |  Bug: 01 - Hello.lua « previous next »
Pages: [1]
Author Topic: Bug: 01 - Hello.lua  (Read 1685 times)
Öhr GmbH
Waxing Crescent
**
Posts: 64


« on: March 09, 2006, 11:55:48 PM »

mhhh i dont know much about lua, but i think this is a bug.
you first and very basic script was 01 - Hello.lua.
runs fine in dslua v0.1, but shuts down after 1 sec after loading.
bug?
Logged
waruwaru
Administrator
Waxing Crescent
*****
Posts: 94


« Reply #1 on: March 10, 2006, 04:11:55 AM »

Öhr GmbH wrote:
Quote
mhhh i dont know much about lua, but i think this is a bug.
you first and very basic script was 01 - Hello.lua.
runs fine in dslua v0.1, but shuts down after 1 sec after loading.
bug?


Ah, in version 0.1, you had to press START after your script finish to continue.  Alot of people thought the script/DSLua was hanging.  So, I have removed the need to press START and just wait around 1.5 seconds.  If you want a delay at the end of script, you can put in this loop at the end:

Code:

while true do
  if Pads.AnyKey() then
    break
  end
  Screen.WaitForVBL()
end


Some of the new example scripts in the DSLua 0.2 scripts directory uses this trick. Smiley
Logged
Öhr GmbH
Waxing Crescent
**
Posts: 64


« Reply #2 on: March 10, 2006, 04:25:25 AM »

its a stupid change.

how about adding in the next update something like this:
Screen.Waitshutdown(3s)
this means it waits 3sec before the script shuts down and this:
Screen.Waitshutdown(e)
e=endless

and if you say
Code:
Screen.Waitshutdown(e)

if Pads.Start() then
 Screen.Waitshutdown(3s)
end

if Pads.Start() then
 break
end

the script shuts down in 3seconds after you pressed Start

P.S. what the fuck does Screen.WaitForVBL() and VBL is?

Post edited by: Öhr GmbH, at: 2006/03/10 01:26
Logged
waruwaru
Administrator
Waxing Crescent
*****
Posts: 94


« Reply #3 on: March 10, 2006, 06:34:26 AM »

Öhr GmbH wrote:
Quote
how about adding in the next update something like this:
Screen.Waitshutdown(3s)
this means it waits 3sec before the script shuts down and this:
Screen.Waitshutdown(e)
e=endless


That's an interesting idea.  I will think about it.

VBL is "Vertical Blank".  It happens everytime your DS draws a full screen.  This is useful when you do animations, so you won't get graphic glitches.  Also, it also acts as a small delay for the processor to get a chance do some other stuff.  If you don't put a small delay in a tight loop, the code may not be very responsive.
Logged
Öhr GmbH
Waxing Crescent
**
Posts: 64


« Reply #4 on: March 10, 2006, 06:44:06 AM »

thanks for the info Smiley


rescuing data....
Logged
Pages: [1]
« previous next »
    Jump to:  



    (C) 2009 DSLua

    DSLua - Best scripting language for Nintendo DS home-brew!