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 

Error in code

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



Joined: 17 Jul 2005
Posts: 4

PostPosted: Mon Sep 05, 2005 3:58 am    Post subject: Error in code Reply with quote

I'm getting this error with the code below:
error: script.lua4: attempt to call global 'pidle' (a nil value)

I've been coding for about 4 months in Visual Basic.. Lua seems like an easy language, but I'm still learning. Bear with me. =]

Code:
-- Animation Test

-- variables
pidle {}

-- graphics
pidle[1] = Image.load("gfx/pidle1.png")
pidle[2] = Image.load("gfx/pidle2.png")
pidle[3] = Image.load("gfx/pidle3.png")
pidle[4] = Image.load("gfx/pidle4.png")
pidle[5] = Image.load("gfx/pidle5.png")

-- animation
while true do
 
   for x=1,5 do
      screen:blit(200, 100, pidle[x])
      screen:flip()
      screen.waitVblankStart(3)
   end

end
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Mon Sep 05, 2005 4:14 am    Post subject: Reply with quote

The fourth line should be:
Code:
pidle = {}

This way is to let Lua recognize pidle as a table.
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
worldspawn



Joined: 17 Jul 2005
Posts: 4

PostPosted: Mon Sep 05, 2005 4:36 am    Post subject: Reply with quote

Thanks a bunch!

Ah man.. I should have seen that. Heh.
Back to top
View user's profile Send private message
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