Lua Programming Help Thread
This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; There are sixty Vblanks in a second, so this pauses our program at this point for exactly one second. That ...
-
07-18-2007, 08:57 AM #7711QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
That is correct to the PSP's screen as it refreshes at 60hz.There are sixty Vblanks in a second, so this pauses our program at this point for exactly one second.
No. The refresh rate represents how many times the screen gets drawn per second. Every time the screen is drawn, there is one vblank.so the vblank is the refresh rate?
This is why I said you ignored my post. There was a link in brackets that said, "read this" which goes to a Wiki explaining EXACTLY what a vBlank is. Obviously, you didn't read it.
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
07-18-2007, 09:51 AM #7712QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Zitat von Gam3freQ
My point was that there is no difference from coding C++ for the PSP or any other system besides API specific functions in the PSPSDK. If you don't know C++ at all in the first place, then you will have no clue what you are doing. This stuff takes time, it isn't "Get up and go make a 3D game". Learn the basics and syntax of the language first, then move on the the API specific functions provided by the PSPSDK.
-
07-18-2007, 03:34 PM #7713QJ Gamer Green
- Registriert seit
- Jul 2005
- Ort
- Belgium
- Beiträge
- 594
- Points
- 7.599
- Level
- 58
- Downloads
- 0
- Uploads
- 0
Does anyone know if it's possible to create a rectangle, and fill it but with a semi transparant color
I've tried check = Color.new(100,200,200,50) and check = Color.new(100,200,200,210 ) but it stays the same opacity
and another similar question, is it possible to get a PNG semi transparant, becaus I've loaded a PNG with a gradient transparancy, but it just cuts of at about 50% transparancy, everything below isn't shown, everything over is turned opaque
-
07-18-2007, 04:22 PM #7714
If you can't see already, I have already started to learn lua and learning C++ at this point would only confuse me, so there is no reason for you to continue an arguement for no reason.
Zitat von _dysfunctional
-= Double Post =-
So the vblank is related to the refreshrate, which is 60hz on the psp, which is why 60 vblanks take a second on the psp, because every time a hz blaublahubadung. In other words, it is the time interval between the end of the last line of one frame or field of a raster display, and the beginning of the next.
Zitat von yaustar
-= Double Post =-
I tried once and it didn't work but will try again
Zitat von slicer4ever
Geändert von Gam3freQ (07-18-2007 um 04:27 PM Uhr) Grund: Automerged Doublepost
-
07-18-2007, 04:42 PM #7715QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Not it isn't pointless, and who was arguing? I was just saying that by being rude back to me when I was just trying to help and was correct, is ridiculous.
-
07-18-2007, 04:43 PM #7716QJ Gamer Gold
- Registriert seit
- Nov 2006
- Ort
- ...
- Beiträge
- 2.080
- Points
- 11.942
- Level
- 71
- Downloads
- 0
- Uploads
- 0
i agree with dys, ridiculous
-
07-18-2007, 05:06 PM #7717
I'm sorry, you were right, but I can't even figure out how to play comp.wav in lua so how can I figure out how to do C++:Cry:
Zitat von _dysfunctional
-
07-18-2007, 05:30 PM #7718QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Code:soundvar = Sound.load("sound.wav") soundvar:play()Understanding how the pixels in memory are displayed on the screen is important for writing games. The concept of many displays, including the one for the PSP, are the same like for the old cathode ray tube: A beam starts at top left and scans all lines top down. At the bottom it needs some time for returning to the top left, which is called the vertical blank (vblank), because the beam is deactivated while moving back to it’s start position. Of course, in PSP there is no real beam, but you can think of it as if it works like this. With “screen.waitVblankStart() ” the script waits for the start of this vblank. While the vblank time no pixels are written to the display, which gives you the time to flip the screen and offscreen to avoid flickering.
-
07-18-2007, 05:37 PM #7719
on the first quote - thanks i was able to figure out Sound.load but not how to play it
Zitat von michaelp
on the second quote - yes that does help alot - increases understanding of why when I was doing screen.flip() instead of the vblank thing it wouldn't let me press more than one button at a time but now it makes alot more sense thank you for both quotes they really helped we need more people like you around here :Punk:
-
07-18-2007, 05:43 PM #7720QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
you said you want to play comp.wav...
Also, you only need one "screen.flip" in your script.Code:comp = Sound.load("comp.wav") --This loads your sound file some code some code --Now, if you wanted to play the file, you'd do this: comp:play() --This plays your sound
-
07-18-2007, 05:49 PM #7721
This is what i did and it worked, but if I press the button twice it will play twice over itself
Zitat von michaelp
INFO: COMP.wav is in the musc folder, so I put "music/comp.wav" and it worked, then I wanted it to play the sound for every button I press, so I put the comp
lay() under each Pad:variable
Spoiler for my source code:
-
07-18-2007, 05:57 PM #7722QJ Gamer Gold
- Registriert seit
- Aug 2006
- Ort
- Under Your Bed
- Beiträge
- 3.083
- Points
- 12.189
- Level
- 72
- Downloads
- 0
- Uploads
- 0
I thinkCode:if pad:circle() and comp=true then --Whatever for this end
-
07-18-2007, 06:40 PM #7723
? what? I posted my code above which works
Zitat von xpack
http://wiki.ps2dev.org/psp:lua_player:tutorial
http://www.evilmana.com/tutorials/lua_tutorial_list.php
both links above provide little explanation which I don't like. I feel like I need to :rtfm: but only if I could find the manual
-
07-18-2007, 07:36 PM #7724words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Not necesarily, it depends on the effect you're trying to produce.
Zitat von michaelp
Run this script hten look at it and you'll see
http://jordansg57.googlepages.com/Tr...ionCircles.lua

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
07-18-2007, 08:17 PM #7725
hmm thats weird, my latest project has semitransparent colors that blit perfectly. is it the darker half of the png that gets cut off?
-= Double Post =-
btw, nevermind my question on text width, i found something on the ps2dev forums that answered my question. looks like he had the same problem...
Zitat von the underminer
Geändert von Da_MerV (07-18-2007 um 08:32 PM Uhr) Grund: Automerged Doublepost
-
07-18-2007, 08:56 PM #7726
http://dl.qj.net/PSP-LUA-Software-St...3462/catid/193
Will this help me code? I have downloaded it... because it says that it will help debug... but I have no idea on how to use it as the readme is a 0kb file...
-
07-18-2007, 08:59 PM #7727QJ Gamer Bronze
- Registriert seit
- Jul 2006
- Ort
- Louisiana
- Beiträge
- 183
- Points
- 4.563
- Level
- 43
- Downloads
- 0
- Uploads
- 0
it has basic coding help, but nothing too technical
Survived Hurricane Gustav!!!!!
-
07-18-2007, 09:10 PM #7728
I'm not good enough to be compared at all with SG57, so that's besides the point
Zitat von AdjutantReflex
-= Double Post =-
I can't even use it properly. when I click debug it launches a pc version of luaplayer. and I don't know the pc controls either. I don't get why it has a compiler because you can't compile lua. I don't understand the usage of "quick notepad" in this application either, so I guess I'm better off without this and using notepad
Zitat von almost219
Geändert von Gam3freQ (07-18-2007 um 09:18 PM Uhr) Grund: Automerged Doublepost
-
07-18-2007, 10:27 PM #7729Developer

- Registriert seit
- Oct 2006
- Ort
- San Diego
- Beiträge
- 177
- Points
- 4.205
- Level
- 41
- Downloads
- 0
- Uploads
- 0
are you testing your app on your psp or are you using windows luaplayer? windows luaplayer does not handle transparencies correctly.
Zitat von Mistabeen
-
07-19-2007, 12:15 AM #7730words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Nor Lua Player itself. I believe you can't make a half transparent rectangle without it being an image. It's either 100% transparent or 0%.

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
07-19-2007, 12:22 AM #7731Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
wtf r u all talkin about if you want to make an IMAGE transparrent then you have to do this screen:blit(0, 0, image, transparency in %)
you cant create a colour with transparrency you have to apply it to the image
i dont know if it works for image.createempty() or rect.createempty() shapes but if u want that then just make an image the size you want and apply transparrency to that------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
07-19-2007, 12:27 AM #7732Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
windows luaplayer isnt compatible with transparent images. it the image is anything more than 0% transparent, windows luaplayer shows the image as if it werent transparent.
--------------------------------------------------------------------------------------
-
07-19-2007, 02:47 AM #7733QJ Gamer Green
- Registriert seit
- Jul 2005
- Ort
- Belgium
- Beiträge
- 594
- Points
- 7.599
- Level
- 58
- Downloads
- 0
- Uploads
- 0
I know I should have tested it on my psp more, but when it are such trival changes you just check them on your computer :)
thanks for the help tho
got another problem tho, can I resize an image to a variable size?
I found something on Evilmana but that uses a fixed size te resize it to, what I want to do is change the size constantly to whatever my variable tells it to be
the other small thing is that I need to rotate an image on a buttonpress, the rotation is so subtle that using images would require about 200 different images, wich would be a bit to much, how do I do this in LUA? I think it uses the 3D GU rotate function, but I can't find any relevant information on that.
-
07-19-2007, 06:24 AM #7734QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
I see.
Zitat von AdjutantReflex
And, the compile feature probably makes a "Game and Game%" folders so you don't need luaplayer to test it on your PSP.
Also, Lua can be compiled.(Prevents source from being read, small speedup. Useless for small scripts.)
-
07-19-2007, 09:40 AM #7735
Regaurdless, even though I have some basics of lua, I could never program one bit without a tutorial teaching me how to do something (as in code the whole thing by hand). I understand the BARE BONES basics (BBB) of the language but it isn't good enough to be a second language;
Zitat von michaelp
I need to be fluent in the language like it was my second language; be able to type it, speak it, and know it, but I can only read it BBB style, not even understand fully. I need a tutorial that gives a great understanding and a cheat sheet to help me code, and a bunch of functions that work and how to use them correctly, which I know there must be somewhere on the internet.
-
07-19-2007, 09:42 AM #7736Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
one site and one site only when it comes to the more advanced stuff there arent any tuts u have to look at other peeps code and figure it out urself
site:
http://www.evilmana.com/tutorials/------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
07-19-2007, 10:03 AM #7737QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
finish the tutorials at evilmana first (click on the link the last poster gave you)
i can now understand lua, and i used to be bigger noob than you
here's what happened
I started to learn Lua, and eventually made a script that blitted specific images when you pressed a button. I thought "Oh, this is easy, I'm gonna try to learn C since it's more powerful than Lua and it will help in the long run".
Bad idea.
I looked at the tutorials at psp-programming. I got to the 5th one until I said: "Wow. This is too hard, and I suck at it. Time to stop programming."
So, for about a month or so (give or take a bit) I started to learn Lua again.
I still had all the tutorials I found on the internet in .txt files, so I used those, got some more from evilmana, and picked up Lua and thought "How didn't I understand this before?"
I'm not saying you should go through the same process, I'm saying that one day, something just "clicked" and I understood it all. Just keep using some tutorials, and you'll understand soon enough.
-
07-19-2007, 10:04 AM #7738Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
about the resize thing that would be a long piece of code even just for 2 sizes but i could tell you how to do it if u be more specifc and tell me what you need it for and weather it is on a button press and wether you want it to have a menu
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
07-19-2007, 10:07 AM #7739Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
good advice dude
EDIT:
there are three steps
1. figure out what you need to tell the psp to do first
2. tell yourself in english or american how it is done e.g. load the image then put it on the screen
3. learn what the functions do so you know when to use them------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
07-19-2007, 10:35 AM #7740
Thanks for all the help. I will be spending alot of time at evilmania now. Michaelp, I thought that eventually it would click and everything would make perfect sense, but it hasn't happened yet, so I will try to master lua (no wannabe applications are going to released)
However, when I start to learn more about lua, I think that this would be a fairly challenging start to try to clone/port this http://scarymonkey.net/Flash/batmouse.swf but maybe that is too chalenging because of the AI, but this would be alot easier http://scarymonkey.net/Flash/squares.swf I think, because there is only one level and EVERYBODY loves squarez so everybody would love to see a squares 2 or for a start maybe fishy http://www.xgenstudios.com//fishy/fishyxgen.swfGeändert von Gam3freQ (07-19-2007 um 11:15 AM Uhr)


LinkBack URL
About LinkBacks
Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum