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; Zitat von Grimfate126 sorry for double post, but have a prob. i tried to do this: Code: for c = ...
-
05-18-2006, 09:41 PM #2371QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
I dont know much about the "for" statement.. but try this
Zitat von Grimfate126
Code:for c = 1, 18 do desert = Image.load("sp/desert"..c..".png") end
-
05-19-2006, 03:59 AM #2372Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von montrob
that wont work cause i want it like this:
BUT when i do that, it doesnt load all the images, in luaplayer PSP, for luaplayer windows, it works awesomely. why?Code:desert1 = Image.load("sp/desert1.png") desert2 = Image.load("sp/desert2.png") and so on...--------------------------------------------------------------------------------------
-
05-19-2006, 04:09 AM #2373Rock Star

- Registriert seit
- Aug 2005
- Ort
- CT| FW: 4.01 M33-2
- Beiträge
- 11.844
- Points
- 70.899
- Level
- 100
- Downloads
- 0
- Uploads
- 0
Thats strange if it works in LuaPlayerWindows it should work in LuaPlayerPSP. What version of LuaPlayer are you using on your PSP? I know LuaPlayerWindows is 0.16. Try having the same version, not sure if that would make a difference though.

-
05-19-2006, 07:53 AM #2374is not posting very often

- Registriert seit
- Feb 2006
- Ort
- omnipresent
- Beiträge
- 5.162
- Points
- 33.152
- Level
- 100
- Downloads
- 0
- Uploads
- 0
luaplayerwindows is 0.14
What did we think the world would look like in 2015?
http://forums.qj.net/501501-post26.html
Zitat von Abe
-
05-19-2006, 08:47 AM #2375QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
that wouldnt work montrob, he wants to load many images in one 'for' loop. by taking out the "..c", you take out what he's using to load multiple images.
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-19-2006, 11:07 AM #2376
well when i do it, it clears the image i quess, yet makes the whole screen a greenish color.
Zitat von slicer4ever
-
05-19-2006, 11:08 AM #2377
btw, my code is on the previous page.
-
05-19-2006, 12:05 PM #2378QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
ok well then try this:
playervisible = yes
if playervisible == yes then
screen:blit(0,0,player)
end
that should work1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
05-19-2006, 12:26 PM #2379is not posting very often

- Registriert seit
- Feb 2006
- Ort
- omnipresent
- Beiträge
- 5.162
- Points
- 33.152
- Level
- 100
- Downloads
- 0
- Uploads
- 0
who's that playervisible script for?
What did we think the world would look like in 2015?
http://forums.qj.net/501501-post26.html
Zitat von Abe
-
05-19-2006, 03:03 PM #2380
no that won't help, i want to just clear the image, and not the whole screen thats all i am trying to do. Does anyone know how. Like lets say you display a person, and then when you press x it clears that person, yet everything else stays. Also, if you can do this then like if you used screen:blit to paste grass everywhere, and then blited the person on top of the grass, would the grass be shown underneath once you cleared the person.
-
05-19-2006, 03:16 PM #2381
also, is there anyone that i can e-mail my code to and see where my bugs are. Its really simple, yet since i am a very begginner in lua, I am not sure what is wrong. Thanks, my E-mail is [email protected] . If you can help me e-mail me or post here.
-
05-19-2006, 03:26 PM #2382QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
I'll give it a shot.
Zitat von emericaska8r
[email protected][CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-19-2006, 03:29 PM #2383QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
I hear people saying that this will work:
Zitat von emericaska8r
Have you tried it?Code:screen:clear(image name here)
It should.
Zitat von emericaska8r
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-19-2006, 03:38 PM #2384
Hi I have a question:
The code above dosent work but an example.Code:if player1.x >= 100 and player1.x <= 116 and player1.y >= 200 and player1.y <= 216 then picture = true end
My question is:
I have a picture "player1" somewhere in the psp screen.
Is it possible to make the picture "player1" to have x and y axis so when "picture1" goes to that place, picture will be true.
You may think of doing
but this i know.Code:-------picture1 somewhere in the txt screen:blit(x0, y0, player1) --- if x0 >= 100 and x0 <= 116 and y0 >= 200 and y0 <= 216 then pause = true end
with this code above, not the hole picture1 that if it touches the x and y axis it will be true.Bequiet!!!
I'm learning cc©cc
-
05-19-2006, 03:46 PM #2385QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
wait, you want it so that if part of the pic is in a specific place it becomes true, or when the whole thing goes into the specific place?
Zitat von natan333
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-19-2006, 04:02 PM #2386
ok. imagen if picture "player1" is big but not 2 big
Zitat von EminentJonFrost
if the bottom of the big picture "player1" touches the x and y axis to be true, it will not do nothing.Code:-------picture1 somewhere in the txt screen:blit(x0, y0, player1) --- if x0 >= 100 and x0 <= 116 and y0 >= 200 and y0 <= 216 then pause = true end
if the topleft of the picture touches the x and y axis, it will turn true
the thing i want to know if its possible for any part of the big "player1"
picture to hit the x, y axis to be true
but hey, picture "player1" is a moving pictureGeändert von natan333 (05-19-2006 um 04:10 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-19-2006, 04:10 PM #2387QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
I dont believe so...no, not possible.
Zitat von natan333
If you had several images "stringed" together, then yes, it would be possible since all you would need to do is make the small images you want "true"..true. lol[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-19-2006, 04:12 PM #2388
Zitat von EminentJonFrost
if with picture isnt possible, i think its possible to add a moving invisible square around the picture "player1" so when it hits the x, y axis it will be true.
but i not idea how to make itGeändert von natan333 (05-19-2006 um 04:18 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-19-2006, 04:27 PM #2389QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
what do you mean you dont know how to make it? its the same as any other photo.
Zitat von natan333
just be sure that the "player" pic is blitted AFTER the square, and make the square become true when you want it to.
Code:-------picture1 somewhere in the txt screen:blit(x1, y1, square, false) --screen:blit(x0, y0, player1) -- Move this... --- if whatever = whatever then screen:blit(x1, y1, square, true) end --here, right after the square is blitted. screen:blit(x0, y0, player1) if x0 >= 100 and x0 <= 116 and y0 >= 200 and y0 <= 216 then pause = true end
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-19-2006, 05:17 PM #2390
yeah did kinda the way you said for bunch of pictures
i did with adding dots arround the picture and making them x0+(number), y0+(number) :Jump:
hey is there a invisible color ? so it dosent show up?Bequiet!!!
I'm learning cc©cc
-
05-19-2006, 05:21 PM #2391QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
um...you could not blit it. :icon_wink
Zitat von natan333
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-19-2006, 05:27 PM #2392
hmm, dont got it
is there a way to makewith no color ?Code:screen:drawLine(x0, y0+15, x0, y0+15)
Bequiet!!!
I'm learning cc©cc
-
05-19-2006, 05:34 PM #2393QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
nope.
curious, why draw am invisible line?[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-19-2006, 05:45 PM #2394
well, becuase this picture
Zitat von EminentJonFrost
have an invisible square (if you put in the screen and move arround), and the dots is to put in the top right side, bottom right side and left. top left side dont need becuase picture1 is included with them all x0, and y0 so when it touches the x and y axis in a place i mark, it will change to something.
but hey. i might put a invisible picture with only 1 pixel to do it :icon_winkBequiet!!!
I'm learning cc©cc
-
05-20-2006, 04:06 AM #2395
Yes but you have to draw it to another image then the screen. Then you blit that image to the screen but with alpha set to 255.
Zitat von natan333
So something like this:
Code:invis:drawLine(x0, y0+15, x0, y0+15) screen:blit(0, 0, invis, 0, 0,invis:width(),invis:height(),true)
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
05-20-2006, 11:59 AM #2396
guys, is there a software that records every sound, that comes out from the soundbox or headphone?
example:
record a jump sound from a gameGeändert von natan333 (05-20-2006 um 12:16 PM Uhr)
Bequiet!!!
I'm learning cc©cc
-
05-20-2006, 03:53 PM #2397words 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
yes... i just recorded the streaming Dont Wait from the website now i have the song for free... You can take the sound from: Speakers, Sound Card, Microphone, Web cam, etc.
Its called ReplayMusic. A DEMO version is out.. allows 25 tracks t be recorded, just click start, do the sound from game, then stop recording, then convert or whatever...
P.S. Anyone know what an LG Cingular C1500 Cell Phone's ringtone codec is? I have this converter, just dunno what codec it is in...
...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
-
05-20-2006, 05:57 PM #2398
hehehe . i got a registration code . but not sure if its registered becuase it crashed
Bequiet!!!
I'm learning cc©cc
-
05-20-2006, 06:01 PM #2399QJ Gamer Gold
- Registriert seit
- Mar 2006
- Ort
- LOLWUT
- Beiträge
- 2.625
- Points
- 18.627
- Level
- 86
- Downloads
- 0
- Uploads
- 0
I am having trouble with this code. I get the error: index.lua 28 'then' expected near '='. :Argh: :Argh: :Argh: The code:
The line that is bolded is line 28.Code:red = Color.new(255,0,0) yellow = Color.new(255, 255, 0) blue = Color.new(0, 0, 255) orange = Color.new(223, 88, 6) grey = Color.new(94, 97, 111) black = Color.new(0, 0, 0) white = Color.new(255, 255, 255) green = Color.new(0,255,0) duh = Timer.new() duh2 = duh:time() x = 470 y = 0 duh:start() man = Image.load("man.png") while true do screen:clear(white) if duh2 >= 470 then screen:blit(470,0,man) end screen:blit(x,y,man) for i = 1, 470 do if duh2 = i * 1 then man.x = man.x + 1 end screen.waitVblankStart() screen.flip() end
-
05-20-2006, 06:04 PM #2400words 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
me 2 ;) i bought it ;) now i just need to fix my internet/text messaing on my cell to download my ripped song... after finding what ringtone codec it is in...

...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


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