Their was a version ported to M33.
Use LuaPlayer version .20(1.00) and out it in PSP/GAME
Fatboy: You cannot help him out anyways since you don't know C
Printable View
Their was a version ported to M33.
Use LuaPlayer version .20(1.00) and out it in PSP/GAME
Fatboy: You cannot help him out anyways since you don't know C
I have a slim psp with 3.71 M33-4 firmware and luaplayer works fine for me :)
You must use luaplayer 0.20 (Firmware 1.00 ) , then you just put it in ms0:/PSP/GAME and it should work !
i thought this would help, but i cant get it to work oh well
http://dl.qj.net/LuaPlayer-for-Team-...4654/catid/151
edit
ok ill try the 1.00 version of lua player
edit
still not working wonder what the deal is
hey chrono i updated to m33-4 just and used that one that you linked too and it works for me now thanks i dont know why it wont work for you tho
make sure that in recover it is set to 3.71 kernel and that it is in psp/game/luaplayer
i see what was the problem it was my game that i was making it wont run on 3.71 apparently or something. So that presents a new problem is there a guide or anyone know how to get it working for 3.71?
You set your kernel to 3.71 in the recovery menu?
yep
Do you have the kernel add-on v2?
i didnt think that worked for a slim does it?
chrono if you use the version that you directed to and put it in ms0:/PSP/GAME/HEREZitat:
Zitat von %chrono trigger%
then it works on a slim but you have to use that version of the lua player
Just a heads up:
JaX3RiR has recompiled Lua Player V0.16 to 3.XX kernel now :D
(The other one you guys linked to above, was V0.20)
http://forums.qj.net/showpost.php?p=...0&postcount=25
doesn't work
Sweet!Zitat:
Zitat von Mr_Shizzy
Alright, I've been learning Lua for couple months now, and I'm stumped by this error message:Code:blue = Color.new(0,0,255)
white = Color.new(255,255,255)
red = Color.new(255,0,0)
green = Color.new(0,255,0)
test = {x = -8, y = 243, speed = 3, img = Image.createEmpty(8, 8)}
test.img:clear(green)
box1 = Image.createEmpty(480, 80)
box1:clear(blue)
line = Image.createEmpty(5, 80)
line:clear(white)
line1 = Image.createEmpty(90, 5)
line1:clear(white)
line2 = Image.createEmpty(3, 52)
line2:clear(white)
back = Image.createEmpty(480, 140)
back:clear(red)
function drawimages()
screen:blit(0, 141, box1)
screen:blit(101, 141, line)
screen:blit(196, 141, line)
screen:blit(0, 0, back)
screen:blit(106, 141, line1)
screen:blit(106, 216, line1)
screen:blit(239, 221, line2)
screen:blit(test.x, test.y, test.img)
end
function drawtext()
screen:print(116, 151, "Fight", white)
screen:print(116, 166, "Harmony", white)
screen:print(116, 181, "Dissonance", white)
screen:print(116, 196, "Items", white)
end
function test()
if test.x < 500 then
test.x = test.x + test.speed
end
end
while true do
screen:clear()
drawimages()
drawtext()
test()
screen.waitVblankStart()
screen.flip()
end
What am I doing wrong?Zitat:
34:attempt to index global 'test' (a function value)
Note: The code should cause an 8x8 green block scroll from offscreen on the left side of the screen to offscreen on the right side.
I'm pretty sure it's because you have a function called test and an array/table called test. Rename one of them. Then I THINK it will work.
You named "test" a table AND a function. :pZitat:
Zitat von Foxhull
Rename one of them.
Dang it, michaelp beat me to it. lol
thanks, i'll try that
EDIT: Thanks, works now.
Come back for any help you need. :)
This is bugging the hell out of me. What EXACTLY is the screen object? I used to think it was an image, but when I tried to use it like one, it told me it was a table (With no elements in it). Can someone please explain it to me? I need to find a way to use it like an image object.
it is like a container
- if you blit an image to it it contains that data like a table if you want to use it like an image you cant i like to blit a blank image to it 480 x 272 and use that instead then it will act like a screen and an image
just remember
image_screen = image.createEmpty(480, 272)
then
image_screen.flip() and so on
thanks
I see.... I was trying to copy the screen into another variable:
But obviously this didn't work. Do you know any way I could make it work?Code:zoomOut = screen
why may i ask do you want to do that
from what you have said i can hazzard a guess that you want to take the screen content and soom out from it you could do this one of two ways that i can think of
screen:save() the screen and resize that
or
use the gu functions i dont know the specific commands off my head as i try to avoid using them where i dont need to and also because i havent learnt to use them properly
thanks
Learn the GU functions.
Its faster.
Your dead on. It's not REALLY a zoom effect though, more of a cropping effect. I was considering doing the screen:save(), but it wouldn't really be that efferent since I would have to save a file and delete it every time. I guess I'll have to learn the GU functions. Thanks. :)Zitat:
Zitat von FaT3oYCG
What did you use for mazegen then ?Zitat:
Zitat von Highsight
That was 3DGU, I believe they are referring to non 3D GU functions... right? XD
Incidentally, where can I learn about the GU functions Anti? I can't seem to find anything other than 3D GU, and I don't see how those would help. :/
its gu and gum commands if i am correct the 3d cube shows most of the commands but if you want to crop an image im sure that there is a much simpler way
for example create a blank image the size that you would like to crop to this will act like a view finder then blit the original image to that with minus co ordinate for that image and only the part that you want to see should be shown - that isnt a very good way though
im sure that screen:blit() accepts about 7 commands max which will do what you want with ease one mo ill try and find out the specific order they are in
EDIT:
screen:blit(x position, y position, full image to use, tile x start position on that image, tile y start position on that image, tile width, tile height)
an example of this would be
Code:
lua_image = Image.load("lua_image.png") -- for example 200 x 200 image
screen:blit(10, 10, lua_image, 30, 40, 100, 100) -- blits the image to 10, 10 x and y co-ordinates, tells it to use the lua_image and start 30 across from the start position in the image and 40 down, then takes 100 x 100 pixels of the image and blits that
Er, my code is already set up just like that, but that's not the problem. XD The problem is that the image I want to crop is an image that I get from the screen. What I am trying to do is create a transition between the player playing the game, and the brief pause between each game. So to do that, I need to get a picture of the screen and use that for the cropping process. The only thing is, I would like to be able to do this WITHOUT saving it as a PNG first, I would much rather use it as an Image object, if that is possible.Zitat:
Zitat von FaT3oYCG
Try creating a smaller blank image that is size of the crop and blitting the screen onto the blank image. No idea if it works though.
in that case wouldn't cropping_image = screen:save() do the trick and use that ??? not sure but anyway if you dont want to keep the image there is a function in lua to save a file as a temporary file and it is deleted after it has finished being used - you would have to search for that though
EDIT:
oh and yaustar i mentioned that before
Zitat:
Zitat von FaT3oYCG
screen:save returns nil and ALWAYS saves to the memory stick.
-= Double Post =-
Why wouldn't it be a good way?Zitat:
Zitat von FaT3oYCG
fair enough oh and i wasn't trying to undermine you sorry if it seemed that way
because it is using minus values what i meant was there may be better ways but i dont like using minus values in my code, most of the time you could use an addition instead just by revising your code but i guess this is an exception
Why don't you like using minus numbers? It really seems a little odd especially in programming.Zitat:
Zitat von FaT3oYCG
because most of the time using a negative number will make your code more hard to understand and sometimes more complicated than it needs to be
not that this would happen but say for example you wanted to print some text at 10, 10 then you could use this
screen:print(480 - 470, 272 - 262, "text", white)
but that is much harder than just putting
screen:print(10, 10, "text", white)
i just used that as an example but you should get what i mean as when it does occur it is usually with complex code
but as i said that is why i try to avoid using minus numbers where i can
thats just bad programing. you're unnecessarily doing two subtractions every frame. but i dont usually have a problem with minus values, unless they're used the way you mentioned. other than that, they're ok.
thats my point basically what im trying to say is that i dont like using minuses as they make the code sometimes do unnecesary calculations that is why i try to avoid using them i was only using that as an example to show that i dont use them because it sometimes makes the code unefficient i will use them where needed but as you say if you use a minus where none is needed its bad programming - if you are doing complex coding whith lots of variables and values then you may unnececarily use a subtraction where the value can be obtained by not doing one which is uneficcient codingZitat:
Zitat von Grimfate126
if you still dont understand what i mean then dont try to instead read my sig and you will understand why
but anyway i think we have had enough discussion on using minuses on the help thread so lets leave it there
Hi all,
Am new to Lua and relatively new to programming too i guess, anyway can anoyne help me with this problem please. I am getting the "loop in gettable" error when i try to mute my music. Code below:
The screenshot and quit functions mapped to Select and Start respectively work fine, however when i try to stop the music or set Music.volume(0) i get "error - loop in gettable".:Argh:Code:-- Activate USB Mode
System.usbDiskModeActivate()
-- Define Color White
white=Color.new(255,255,255)
-- Load Loading Image
loadingImage = Image.load("images/loading.jpg")
-- Print Loading Image as Background
screen:blit(0, 0, loadingImage, false)
screen.waitVblankStart()
screen:print(200,130,"Loading - 0%",white)
screen.flip()
-- Begin Loading All Other Images
backgroundImage = Image.load("images/background.jpg")
screen:clear()
screen:print(200,130,"Loading - 20%",white)
screen.flip()
gameimageImage = Image.load("images/game.jpg")
screen:clear()
screen:print(200,130,"Loading - 40%",white)
screen.flip()
dartImage = Image.load("images/dart.jpg")
screen:clear()
screen:print(200,130,"Loading - 60%",white)
screen.flip()
gameoverImage = Image.load("images/gameover.jpg")
screen:clear()
screen:print(200,130,"Loading - 80%",white)
screen.flip()
themeSound = Sound.load("sounds/theme.wav", true)
splashImage = Image.load("images/splash.jpg")
screen:clear()
screen:print(200,130,"Loading - 100%",white)
screen.flip()
--Pause At 100%
screen.waitVblankStart(60)
--Clear The Screen Of Loading Text
screen:clear()
--Load The Splash Screen
screen:blit(0, 0, splashImage, false)
screen.flip()
--Pause For One Second
screen.waitVblankStart(180)
--Load The Background Image
screen:blit(0, 0, backgroundImage, false)
screen.flip()
--Play The Theme Music
Music.volume(128)
themeSound:play()
--Update The Screen
screen.waitVblankStart()
while true do
pad = Controls.read()
if pad:start() then
break
end
if pad:select() then
screen:save("screenshot.png")
end
if pad:l() then
if themeSound:playing() then
themeSound:stop()
else
themeSound:play()
end
end
end
If anyone can offer some pointers please i would be most grateful.
Many thanks.:PC:
Ok, i haven't seen lua in a while (concept is same though), but here are some tips:
1) Try to indent properly. It helps when you have your code organized.
2) It seems that you are loading a lot of images, but not blitting them.
3) Instead of having a lot of "Loading..." printing, you could make a only one "Loading" printing when "if" blah is true, then change the "%" of loading. For example, if some image finishes loading, update the loading "%".
Also, when blitting an image, you don't need the fourth argument. You only need it if it's true.
other than the fact your code is set out wrong well its in the wrong order - logical orderZitat:
Zitat von Andysan
for a start the Music.volume(128) is before while true do
so threfore if you change it its not true so it will crash
looks like you have some logic and indenting errors
- try fix your logic and indenting and see if it works
EDIT:
here i fixed most of it for you and laid it out better with proper indentations
here is a simple lua file template aswellCode:-- Activate USB Mode - should only be done while testing or creating a game with a game refresh function to start ti again if you save a file currently in use
System.usbDiskModeActivate()
-- Define Color White
white = Color.new(255,255,255)
-- Load Loading Image
loadingImage = Image.load("images/loading.jpg")
-- Load All Other Images
backgroundImage = Image.load("images/background.jpg")
gameimageImage = Image.load("images/game.jpg")
dartImage = Image.load("images/dart.jpg")
gameoverImage = Image.load("images/gameover.jpg")
splashImage = Image.load("images/splash.jpg")
themeSound = Sound.load("sounds/theme.wav", true)
-- Print Loading Image as Background
screen:blit(0, 0, loadingImage, false)
screen.waitVblankStart()
-- display loading text
screen:clear()
screen:print(200,130,"Loading - 0%",white)
screen.flip()
screen:clear()
screen:print(200,130,"Loading - 20%",white)
screen.flip()
screen:clear()
screen:print(200,130,"Loading - 40%",white)
screen.flip()
screen:clear()
screen:print(200,130,"Loading - 60%",white)
screen.flip()
screen:clear()
screen:print(200,130,"Loading - 80%",white)
screen.flip()
screen:clear()
screen:print(200,130,"Loading - 100%",white)
screen.flip()
--Pause At 100% - for 1 second
screen.waitVblankStart(60)
--Clear The Screen Of all previous data
screen:clear()
--"display" The Splash Screen
screen:blit(0, 0, splashImage, false)
screen.flip()
--Pause For One Second - that is three seconds 60 miliseconds in one second
screen.waitVblankStart(180)
-- "display" The Background Image
screen:blit(0, 0, backgroundImage, false)
screen.flip()
--Update The Screen - keep whatever is on the screen untill told not to
screen.waitVblankStart()
while true do
pad = Controls.read()
--Play The Theme Music
Music.volume(128)
themeSound:play()
if pad:start() then
break
end
if pad:select() then
screen:save("screenshot.png")
end
if pad:l() then
if themeSound:playing() then
themeSound:stop()
else
themeSound:play()
end
end
end
thanksCode:white = color.new(255, 255, 255) -- create white as a colour
oldpad = Controls.read() -- set oldpad as a secondary controller setup
while true do -- while the above is true
pad = Controls.read() -- set pad as a primary controller setup
screen:clear() -- clear anything previously on the screen
-- insert your main code here
-- e.g.
if pad:cross() then
-- if cross is being held
screen:print(10, 10, "i pressed cross", white)
end
if pad:cross() and oldpad:cross() ~= pad:cross() then
-- do something if cross is pressed and not held
end
-- insert your main code here
if Controls.read():start() then -- if you press start exit
break -- break the current state
end -- end the if
oldpad = pad -- oldpad is the same as pad
screen.flip() -- flip the screen at the end of every while loop - if set right the while loop should be continuous
screen.waitVblankStart() -- keep any of that data on the screen untill specified otherwise
end