dofile("")

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

dofile("")

Post by the underminer »

I'm having a problem with this function. When you press cross on the Open Icon to select a file to open and press cross again to select a file, the fileselector.lua script seems to start over again. how can I return to the original script? The fileselector quits normally to lowser when running it stand-alone.

I did it like this:
dofile("fileselector.lua")
Behold! The Underminer got hold of a PSP
soulphalanx
Posts: 35
Joined: Mon Aug 22, 2005 7:48 am

Post by soulphalanx »

in fileselector.lua, create a function, and in the main script, when you want to file select, refer back to that function and it should work
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Post by the underminer »

thnx I fixed it already
Behold! The Underminer got hold of a PSP
Mechanical
Posts: 4
Joined: Mon Feb 06, 2006 9:13 am

Post by Mechanical »

Hi. I need help. I have a problem with "dofile"...
Dofile starts new file script, how to break previous script?
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

Post by the underminer »

There is no command to terminate a script.
You use

Code: Select all

break
to exit loops. When luaplayer has gone trough all the loops and reached the end of the script, it exits the script and goes back to the script you started it from
Behold! The Underminer got hold of a PSP
Mechanical
Posts: 4
Joined: Mon Feb 06, 2006 9:13 am

Post by Mechanical »

yeah, i know, but it's not a solution :/

in my game one level = one file. When You reach 20th level then will be 20 opened files. :/
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

What about levelfile:close()?
Geo Massar
Retired Engineer
Post Reply