lua n00b question.

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

Moderators: Shine, Insert_witty_name

Post Reply
User avatar
Legacyxero
Posts: 23
Joined: Fri Sep 12, 2008 4:42 am

lua n00b question.

Post by Legacyxero »

Heres my issue. at the the transition from (Pressing start to play) to (loading "intro) I dont want to use the command

"screen.waitVblankStart()"

because i dont want it to wait. I want it to stay there UNTILL I press start!!

what should I do to display "intro" (its a picture that takes up the whole screen) after I press start also.

So here is my code:






pink = Color.new(255, 0 , 153)
blue = Color.new(0 , 153, 255)
orange = Color.new(255, 102, 0)
gray = Color.new(153, 153, 153)
black = Color.new(0 , 0 , 0)
green = Color.new(0, 255, 0)
white = Color.new(225, 225, 225)

--*****LOADING SCREEN*****

screen:print(194, 136, "Loading: 0%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

intro = Image.load("abaddonsparrable/introscreen.png")

screen:print(194, 136, "Loading: 20%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

lvlone = Image.load("abaddonsparrable/levelone intro.png")

screen:print(194, 136, "Loading: 40%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

story = Image.load("abaddonsparrable/story.png")

screen:print(194, 136, "Loading: 60%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

choiceone = Image.load("abaddonsparrable/choice1.png")

screen:print(194, 136, "Loading: 80%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

screen:print(194, 136, "Loading: 100%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

screen:print(194, 136, "Press START to play", white)
screen.flip()

pad = Controls.read()

if pad:start() then
screen:clear()
screen:blit(0, 0, intro)
screen.flip()
end
User avatar
Legacyxero
Posts: 23
Joined: Fri Sep 12, 2008 4:42 am

Post by Legacyxero »

can someone please help me?!
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Post by -DaRealXecon- »

Code: Select all

pink = Color.new(255, 0 , 153)
blue = Color.new(0 , 153, 255)
orange = Color.new(255, 102, 0)
gray = Color.new(153, 153, 153)
black = Color.new(0 , 0 , 0)
green = Color.new(0, 255, 0)
white = Color.new(225, 225, 225)

--*****LOADING SCREEN*****

screen:print(194, 136, "Loading: 0%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

intro = Image.load("abaddonsparrable/introscreen.png")

screen:print(194, 136, "Loading: 20%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

lvlone = Image.load("abaddonsparrable/levelone intro.png")

screen:print(194, 136, "Loading: 40%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

story = Image.load("abaddonsparrable/story.png")

screen:print(194, 136, "Loading: 60%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

choiceone = Image.load("abaddonsparrable/choice1.png")

screen:print(194, 136, "Loading: 80%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

screen:print(194, 136, "Loading: 100%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()


while true do
  screen:print(194, 136, "Press START to play", white)
  screen.flip()
  screen.waitVblankStart()

  pad = Controls.read()

  if pad:start() then
    for a=1,1 do
      screen:clear()
      screen:blit(0, 0, intro)
      screen.flip()
      System.sleep(seconds)
    end
    dofile("something.lua")
  end
end
I don't speak English very well... Therefore, i can you not really explain :p

Sorry... :(

Do you Speak German? :)[/code]
User avatar
Legacyxero
Posts: 23
Joined: Fri Sep 12, 2008 4:42 am

Post by Legacyxero »

sorry, nein schpecken ze deutch.
User avatar
Legacyxero
Posts: 23
Joined: Fri Sep 12, 2008 4:42 am

Post by Legacyxero »

ok, so i am just saying fuck the "press START to play", its redundant anyway...

but now what i want to do is: after the loading screen ends, i want to load that same picture (Intro) that take up the whole screen. I want that picture to stay on the screen till i press X, then I want it to load ANOTHER picture that takes up the whole screen.

from reading tutorials this is what I have gathered...(my problem's at the end of the code)




Code: Select all


pink = Color.new(255, 0 , 153)
blue = Color.new(0 , 153, 255)
orange = Color.new(255, 102, 0)
gray = Color.new(153, 153, 153)
black = Color.new(0 , 0 , 0)
green = Color.new(0, 255, 0)
white = Color.new(225, 225, 225)

--*****LOADING SCREEN*****

screen:print(194, 136, "Loading: 0%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

intro = Image.load("abaddonsparrable/introscreen.png")

screen:print(194, 136, "Loading: 20%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

lvlone = Image.load("abaddonsparrable/levelone intro.png")

screen:print(194, 136, "Loading: 40%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

story = Image.load("abaddonsparrable/story.png")

screen:print(194, 136, "Loading: 60%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

choiceone = Image.load("abaddonsparrable/choice1.png")

screen:print(194, 136, "Loading: 80%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

screen:print(194, 136, "Loading: 100%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

pad = Controls.read() 

while true do
screen:blit(0, 0, intro)
if pad:cross() then break end
screen:blit(0, 0, lvlone)
end



My buddy told me that should work, but it just freezes at the 100% screen.


someone please help me.
User avatar
Legacyxero
Posts: 23
Joined: Fri Sep 12, 2008 4:42 am

Post by Legacyxero »

OK, ALMOST got it fixed. This is what I got:

Code: Select all


pink = Color.new(255, 0 , 153)
blue = Color.new(0 , 153, 255)
orange = Color.new(255, 102, 0)
gray = Color.new(153, 153, 153)
black = Color.new(0 , 0 , 0)
green = Color.new(0, 255, 0)
white = Color.new(225, 225, 225)

--*****LOADING SCREEN*****

screen:print(194, 136, "Loading: 0%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

intro = Image.load("abaddonsparrable/introscreen.png")

screen:print(194, 136, "Loading: 20%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

lvlone = Image.load("abaddonsparrable/levelone intro.png")

screen:print(194, 136, "Loading: 40%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

story = Image.load("abaddonsparrable/story.png")

screen:print(194, 136, "Loading: 60%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

choiceone = Image.load("abaddonsparrable/choice1.png")

screen:print(194, 136, "Loading: 80%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

screen:print(194, 136, "Loading: 100%", blue)
screen.flip()
screen.waitVblankStart(60)
screen:clear()

pad = Controls.read()

while true do
screen:blit(0, 0, intro)
screen.flip()

if pad:cross() then break
end
screen:blit(0, 0, lvlone)
screen.flip()
end


It loads the loading screen fine, but when it comes time to display the first image, it displays both images... I guess thats what its doing cause the screen is flashing between the intro and lvlone.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

This isn't a PSP question. Sounds like you just need more lessons in Lua, and we don't do that here. Once you have this working on a PC, then have some PSP specific questions, ask those.
angelo
Posts: 168
Joined: Wed Aug 29, 2007 9:34 pm

Post by angelo »

It's amazing how he's managed to fill the thread with his own replies... truly facinating.

Sorry I spaced out!
Post Reply