forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

io.open() bug?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
cgruber



Joined: 06 Sep 2005
Posts: 36

PostPosted: Wed Sep 21, 2005 6:58 am    Post subject: io.open() bug? Reply with quote

Code:

function LoadLevel()

num_moves=0
levelnum = tostring(level)
map=string.format("%s%s", "./levels/", levelnum)
map=string.format("%s%s", map, ".lua")
if(io.open(map, r)==nil) then --open the file first to make sure it's there
   level=1 --wrap back to start
   gamefield=nil
   screen.waitVblankStart(60)  --short delay
   LoadLevel(1) --call yourself to load first level since we ran out.
   io.close()
else  -- yep it's there better close it
   io.close()
   gamefield=nil
   if(level~=1) then
   screen.waitVblankStart(60) --short delay
   end
   dofile(map)
   mappos=StartupPosition()
   return 1
end

end


This runs perfect everytime in Luaplayer for Windows. In luaplayer for PSP it runs perfect until the 10th time it is called and then dofile() no longer works.
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Wed Sep 21, 2005 7:05 am    Post subject: Reply with quote

deja vu

didn't we had a really similar question yesterday?

try shineshighscore script :)
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group