Help the PSP 3D community grow! Vote for us below:


| | Development Center - Learn the basics of coding or talk about advanced coding techniques with other developers. |
Welcome to PSP3D.com - Sony PlayStation Portable News, Homebrew, Hacks, Reviews, Videos, Mods, Forums!
You are currently viewing our website as a guest, which gives you limited access to reply and interact to discussions and other members. By joining our free community, you will be able to post topics in the forums, communicate privately with other members, vote in polls, and access many other special features.
Registration is fast, simple, and absolutely free so join our community today!
| 
03-29-2006, 07:14 AM
| | Crash Bandicoot addict! | | Join Date: Dec 2005 Location: Adelaide-Australia
Posts: 618
Points: 5.98 Donate | | | Lua lesson 2 help! Im new to coding, and im following this guide http://www.scriptscribbler.com/psp/lua/lesson02.htm
I just want to know if the download pack that contains all the images and souns has everything you need? Coz I downloaded it and followed the instructions and it doesn't work. Thanks if anyone helps  | 
03-29-2006, 07:55 AM
| | Senior Member
My Mood: | | Join Date: Jan 2006
Posts: 351
Points: 41.54 Donate | | | Right, can you copy you script here or upload it please? | 
03-29-2006, 08:03 AM
| | Crash Bandicoot addict! | | Join Date: Dec 2005 Location: Adelaide-Australia
Posts: 618
Points: 5.98 Donate | | System.usbDiskModeActivate()
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)
screen rint(194, 136, "Loading: 0%", pink)
screen.flip()
background = Image.load("images/background.jpg")
screen:clear()
screen rint(194, 136, "Loading: 20%", pink)
screen.flip()
circle = Image.load("images/buttons/circle_button.png")
down = Image.load("images/buttons/down_arrow.png")
screen:clear()
screen rint(194, 136, "Loading: 40%", pink)
screen.flip()
l = Image.load("images/buttons/left_trigger.png")
left = Image.load("images/buttons/left_arrow.png")
screen:clear()
screen rint(194, 136, "Loading: 60%", pink)
screen.flip()
r = Image.load("images/buttons/right_trigger.png")
right = Image.load("images/buttons/right_arrow.png")
boltsnd = Sound.load("music/comp.wav")
screen:clear()
screen rint(194, 136, "Loading: 80%", pink)
screen.flip()
square = Image.load("images/buttons/square_button.png")
triangle = Image.load("images/buttons/triangle_button.png")
screen:clear()
screen rint(194, 136, "Loading: 90%", pink)
screen.flip()
up = Image.load("images/buttons/up_arrow.png")
x = Image.load("images/buttons/cross_button.png")
splash = Image.load("images/lua.gif")
screen:clear()
screen rint(194, 136, "Loading: 100%", pink)
screen.flip()
screen.waitVblankStart(60)
screen:blit(0, 0, splash, false)
screen.waitVblankStart()
screen.flip()
boltsnd lay()
screen.waitVblankStart(240)
Music.volume(128)
screen:blit(0, 0, background, false)
pad = Controls.read()
screen rint(135, 251, "Press 'Start' to restart", blue)
screen rint(110, 261, "Press 'Select' for a screenshot", blue)
screen rint(383, 35, "Support:", black)
screen rint(365, 45, "PS3Lounge.net", orange)
screen rint(365, 55, "scriptscribbler.com/psp", gray)
screen.flip()
if pad:cross() then
screen:blit(50, 228, x)
screen.flip()
end
if pad:circle() then
screen:blit(90, 195, circle)
screen.flip()
end
if pad:triangle() then
screen:blit(45, 165, triangle)
screen.flip()
end
if pad:square() then
screen:blit(15, 195, square)
screen.flip()
end
if pad:up() then
screen:blit(60, 40, up)
screen.flip()
end
if pad:right() then
screen:blit(90, 65, right)
screen.flip()
end
if pad:down() then
screen:blit(60, 80, down)
screen.flip()
end
if pad:left() then
screen:blit(30, 65, left)
screen.flip()
end
if pad:l() then
screen:blit(4, 6, l)
screen.flip()
end
if pad:r() then
screen:blit(403, 4, r)
screen.flip()
end
if pad:select() then screen:save("screenshot.tga") end
if pad:start() then
break
end
end | 
03-29-2006, 08:30 AM
| | Highly Respected Member
My Mood: | | Join Date: Jan 2006 Location: Western Australia Age: 15
Posts: 911
Points: 1.23 Donate | | | Yes it has everything you need. | 
03-29-2006, 09:17 AM
| | Senior Member
My Mood: | | Join Date: Jan 2006
Posts: 351
Points: 41.54 Donate | | What FW are you on? If its 2.xx+, you need to lose the System.usbDiskModeActivate()
line. It makes my scripts not work.
I looked at the tutorial and tried it myself, and using some debugging, I found that it crashes when it gets to
splash = Image.load("images/lua.gif")
So I made a jpg of the file and corrected the code.
In future, if you cant tell where your program crashes, try writing the following after each line of code in the area you think is a problem
screen:clear()
screen  rint(194, 136, "CHECK [x]", white)
screen.flip()
NB Must define WHITE if this is used
use a different vlaue for [x] each time you use this idea, and then you should get to a certain CHECK. Say you never reach CHECK 6. The line of code that comes before
screen:clear()
screen  rint(194, 136, "CHECK 6", white)
screen.flip()
Is your problem line!
ran your script, and got a 'no script' error, is that what you got??
Last edited by chrispy : 03-29-2006 at 09:37 AM.
| 
03-30-2006, 01:53 AM
| | Crash Bandicoot addict! | | Join Date: Dec 2005 Location: Adelaide-Australia
Posts: 618
Points: 5.98 Donate | | Im on 1.5 firmware. And yes I did get a no script error, thanks for your help so far.  | 
03-30-2006, 11:41 AM
| | Senior Member
My Mood: | | Join Date: Jan 2006
Posts: 351
Points: 41.54 Donate | | | OK then.
I was gonna attach the script, fixed, but my psp is upstairs charging, So I cant (be bothered)
What I did was loaded it into ttlde 1.7, a Lua App for PSP which is a lua IDE. Its real easy to use, and you can compile it from within the program. If theres an error, it helps you out, rather than just saying 'error'
I suggest you find a copy of ttlde, and debug in that. I dont advise TTLDE for writing lua, just debugging for PSP. | 
03-30-2006, 05:17 PM
| | Crash Bandicoot addict! | | Join Date: Dec 2005 Location: Adelaide-Australia
Posts: 618
Points: 5.98 Donate | | ok thanks verymuch, could you please upload the debugged file when your ready? Thanks 
Last edited by jaker : 03-31-2006 at 03:13 AM.
| 
04-03-2006, 03:01 AM
| | Crash Bandicoot addict! | | Join Date: Dec 2005 Location: Adelaide-Australia
Posts: 618
Points: 5.98 Donate | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On Points Per Thread View: 0.00 Points Per Thread: 1.00 Points Per Reply: 0.10 | | | | |