Zeige Ergebnis 361 bis 390 von 10238
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; sorry to hear that, thats tuff luck man....
-
12-12-2005, 10:18 AM #361
sorry to hear that, thats tuff luck man.
-
12-13-2005, 03:56 PM #362words 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
how do i say a number thro a number? like 1-100?

...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
-
12-14-2005, 04:33 AM #363
SG57, try this for that pixel thing you asked about.
pad = Controls.read()
If x>0 and x<50 and y>0 and y<50 and then
screen:blit(........
-
12-14-2005, 09:12 PM #364words 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
ya i kno but my cursor keeps freezing when i do and my picture wont blit unless i move it first so any help?

...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
-
12-15-2005, 06:46 AM #365
Hmm... perhaps its supposed to be WHEN or WHILE x>0 and x<50 and y>0 and y<50 and do
screen:blit(........
But I dont really know =(
-
12-15-2005, 03:18 PM #366QJ Gamer Green
- Registriert seit
- Oct 2005
- Beiträge
- 543
- Points
- 6.721
- Level
- 53
- Downloads
- 0
- Uploads
- 0
How fast does a "while true do" loop go? loop everytime the screen refreshes?
-
12-15-2005, 11:22 PM #367words 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
it makes the luaplayer read what ever is in the while true do loop over infinently as fast as the processor can handle

...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
-
12-15-2005, 11:26 PM #368words 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
any one have a menu example they could post? im looking 4 examples

...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
-
12-16-2005, 05:01 PM #369QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
im running 2.0. I go to lua player. I press circle on "smileys" lua script. nothing happens... psp doesnt freeze.. cuz if you press start it restarts the menu and evetything works fine.. heres the code (its my first program so dont be too mean) and yes all of my image placements are meant to be (0, 0)
System.usbDiskModeActivat e()
background = Image.load("background.jp g")
shot a = Image.load("shot a.jpg")
shot b= Image.load("shot b.jpg")
shot c = Image.load("shot c.jpg")
shot d = Image.load("shot d.jpg")
shot e = Image.load("shot e.jpg")
shot f = Image.load("shot f.jpg")
shot g = Image.load("shot g.jpg")
shot h = Image.load("shot h.jpg")
dribble a = Image.load("dribble a.jpg")
dribble b = Image.load("dribble b.jpg")
dribble c = Image.load("dribble c.jpg")
screen:blit (0, 0, background, false)
screen.waitVblankStart()
screen.flip()
while true do
screen:blit(0, 0, background, false)
pad = Controls.read()
if pad:square() then
screen:blit(0, 0, dribble a)
screen.flip()
screen:blit(0, 0, dribble b)
screen.flip()
screen:blit(0, 0, dribble c)
screen.flip()
end
if pad:circle() then
screen:blit(0, 0, shot a)
screen.flip()
screen:blit(0, 0, shot b)
screen.flip()
screen:blit(0, 0, shot c)
screen.flip()
screen:blit(0, 0, shot d)
screen.flip()
screen:blit(0, 0, shot e)
screen.flip()
screen:blit(0, 0, shot f)
screen.flip()
screen:blit(0, 0, shot g)
screen.flip()
screen:blit(0, 0, shot h)
screen.flip()
screen:blit (0, 0, background, false)
screen.waitVblankStart()
screen.flip()
endGeändert von montrob (12-16-2005 um 05:05 PM Uhr)
-
12-16-2005, 05:06 PM #370OMFG

- Registriert seit
- Jul 2005
- Ort
- Toronto
- Beiträge
- 2.814
- Points
- 19.453
- Level
- 88
- Downloads
- 0
- Uploads
- 0
get rid of all those screen.flips in the while statement. Just need the one at the end
-
12-16-2005, 05:08 PM #371OMFG

- Registriert seit
- Jul 2005
- Ort
- Toronto
- Beiträge
- 2.814
- Points
- 19.453
- Level
- 88
- Downloads
- 0
- Uploads
- 0
System.usbDiskModeActivat e()
background = Image.load("background.jp g")
shot a = Image.load("shot a.jpg")
shot b= Image.load("shot b.jpg")
shot c = Image.load("shot c.jpg")
shot d = Image.load("shot d.jpg")
shot e = Image.load("shot e.jpg")
shot f = Image.load("shot f.jpg")
shot g = Image.load("shot g.jpg")
shot h = Image.load("shot h.jpg")
dribble a = Image.load("dribble a.jpg")
dribble b = Image.load("dribble b.jpg")
dribble c = Image.load("dribble c.jpg")
while true do
screen:blit(0, 0, background, false)
pad = Controls.read()
if pad:square() then
screen:blit(0, 0, dribble a)
screen:blit(0, 0, dribble b)
screen:blit(0, 0, dribble c)
end
if pad:circle() then
screen:blit(0, 0, shot a)
screen:blit(0, 0, shot b)
screen:blit(0, 0, shot c)
screen:blit(0, 0, shot d)
screen:blit(0, 0, shot e)
screen:blit(0, 0, shot f)
screen:blit(0, 0, shot g)
screen:blit(0, 0, shot h)
end
screen.waitVblankStart()
screen.flip()
end
NOTE: I'm also not sure if you can put spaces when you declare things. So if that doesn't work then get rid of all the space when you load the pictures
-
12-16-2005, 05:41 PM #372QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
tried it with spaces in between, didnt' work. tried it without spaces.. still didn;t work... tried takin the usb activation code line.. didn't work.. could you put this on your psp and see if it runs and try to find out whats wrong. (its my first game so its gonna be lame)
http://rapidshare.de/files/9309628/Smileys.rar.html
ill see if any program can run on my psp besides the lua apps that come with the luaplayer.. if you still see something wrong help me thoughGeändert von montrob (12-16-2005 um 05:49 PM Uhr)
-
12-16-2005, 05:43 PM #373OMFG

- Registriert seit
- Jul 2005
- Ort
- Toronto
- Beiträge
- 2.814
- Points
- 19.453
- Level
- 88
- Downloads
- 0
- Uploads
- 0
I would also reccomend not learnign to code on a 2.0. It is much more of a pain in the ass since you can't access USB and change the code instead of having to restart your psp every time.
-
12-16-2005, 05:50 PM #374QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
ya but i have star wars battle front 2 that doesn't work with the version changer. could we talk on aim to help me? also see my post above to try the file please game and see if it works for you please.
-
12-18-2005, 02:32 PM #375QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
I need help with my code. what it does is it has an image pop up gradually.. see image 1, 2, 3. then when you hit square a block hits the image coming down from the top of the screen. the images pop up and down fine, but the block will only come down after the image goes all through image 1,2,3,2,1. what i mean is that i hold down square and the block only appears for a few seconds, then the images come back up again, and the block won't appear. (im still holding square) help please.
background = Image.load("background.pn g")
left1 = Image.load("left1.png")
left2 = Image.load("left2.png")
left3 = Image.load("left3.png")
block = Image.load("block.png")
while true do
screen:blit(0, 0, background, false)
pad = Controls.read()
if pad:square() then
screen:blit(62, 34, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 54, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 74, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(62, 94, block)
screen.flip()
screen.waitVblankStart(5)
end
if pad:circle() then
screen:blit(190, 34, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(190, 54, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(190, 74, block)
screen.flip()
screen.waitVblankStart(5)
screen:blit(190, 94, block)
screen.flip()
screen.waitVblankStart(5)
end
screen:blit(0, 0, left1)
screen:flip()
screen.waitVblankStart(30 )
screen:blit(0, 0, left2)
screen:flip()
screen.waitVblankStart(30 )
screen:blit(0, 0, left3)
screen:flip()
screen.waitVblankStart(24 0)
screen:blit(0, 0, left2)
screen:flip()
screen.waitVblankStart(30 )
screen:blit(0, 0, left1)
screen:flip()
screen.waitVblankStart(30 )
end
EDIT: also if i put this in my code somewhere.. would it work? what im trying to do is if block's XY coordinates are greater than or equal to image3's coordinates.. then screen:blit etc....
block = 62 , 34
image3 = 96, 80
if block >= image3 then
screen:blit(0, 0, image2)
screen.flip()
screen.waitVblankStart(30 )
screen:blit(0, 0, image1)
screen.flip()
screen.waitVblankStart(30 )
endGeändert von montrob (12-18-2005 um 06:39 PM Uhr)
-
12-19-2005, 11:34 AM #376
Well, that thing with the block dissapearing is proboably because of the waitvblankstart thing. Use loops like while true do instead, or functions. The reason that the block only will come out once is that you only tell it to. You write if pad:square only once so it will only do that once. I'd say that build it all into a function, cuz thay can be called as many times as you want.
Besides, there are better ways of displaying graphics, that I presume you are doing, then to blit alot of images. Check this site http://wiki.ps2dev.org/psp:lua_playerGeändert von lingon (12-19-2005 um 11:39 AM Uhr)
-
12-19-2005, 11:37 AM #377
Try it like this
Code:pad = Controls.read() if pad:square() then square() end function square() screen:blit(62, 34, block) screen.flip() screen.waitVblankStart(5) screen:blit(62, 54, block) screen.flip() screen.waitVblankStart(5) screen:blit(62, 74, block) screen.flip() screen.waitVblankStart(5) screen:blit(62, 94, block) screen.flip() screen.waitVblankStart(5) end
-
12-19-2005, 06:47 PM #378QJ Gamer Platinum
- Registriert seit
- Dec 2005
- Ort
- h0000000rj
- Beiträge
- 12.867
- Points
- 57.528
- Level
- 100
- Downloads
- 0
- Uploads
- 0
I'm trying to get info on the Socket.connect() function, but very little is available. I found someone who had used it as:
What is being stored in "error"???Code:httpsock, error = Socket.connect(server, port)
[I fail @ life]
-
12-20-2005, 08:52 AM #379
Does anybody know how to tell the math.random function to do a certain thing if the number generated id BETWEEN for instance 1 and 2?
-
12-20-2005, 03:04 PM #380QJ Gamer Platinum
- Registriert seit
- Dec 2005
- Ort
- h0000000rj
- Beiträge
- 12.867
- Points
- 57.528
- Level
- 100
- Downloads
- 0
- Uploads
- 0
I'm not sure what the syntax of the math.random function is, but I assume it generates a decimal number between 0 and 1. If so, here's how to generate a number between X and Y:
math.random() * (Y - X) + X
e.g. between 5 and 10:
math.random() * (10 - 5) + 5 --> math.random() * 5 + 5
This will generate a number between 0 and 1, then multiply by 5, thus giving you a number between 0 and 5. Then you add 5, thus forcing the range up to between 5 and 10.
Hope this helps![I fail @ life]
-
12-21-2005, 09:21 AM #381
Aaah! Thanks alot dude! =)
-
12-21-2005, 09:11 PM #382QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
anyone know what might be wrong with this code? it wont load on my psp
background = Image.load("background.pn g")
white1 = Image.load("white1.png")
white2 = Image.load("white2.png")
white3 = Image.load("white3.png")
white4 = Image.load("white4.png")
while true do
screen:blit(0, 0, background, false)
function white1()
screen:blit(0, 0, white1)
screen.flip()
screen.waitVblankStart()
end
function white2()
screen:blit(0, 0, white2)
screen.flip()
screen.waitVblankStart(12 0)
end
function white3()
screen:blit(0, 0, white3)
screen.flip()
screen.waitVblankStart(12 0)
end
function white4()
screen:blit(0, 0, white4)
screen.flip()
screen.waitVblankStart(12 0)
end
pad = Controls.read()
if pad:square() then
white1()
end
if pad:circle() then
white2()
end
if pad:triangle() then
white3()
end
if pad:cross() then
white4()
end
-
12-22-2005, 03:46 AM #383
What does the error message say? Oh, and you never flip the backround =)
-
12-22-2005, 11:19 AM #384QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- script.lua
- Beiträge
- 426
- Points
- 6.087
- Level
- 50
- Downloads
- 0
- Uploads
- 0
montrob, this would make it smaller at least. Dont know if it would fix your prob tho.
Code:background=Image.load("background.png") white1=Image.load("white1.png") white2=Image.load("white2.png") white3=Image.load("white3.png") white4=Image.load("white4.png") function white(IMAGE) screen:blit(0,0,IMAGE) screen.waitVblankStart(120) -keep on screen end while true do pad=Controls.read() screen:blit(0, 0, background, false) if pad:square() then white(white1) elseif pad:circle() then white(white2) elseif pad:triangle() then white(white3) elseif pad:cross() then white(white4) end screen.waitVblankStart() screen.flip() end
-
12-22-2005, 01:48 PM #385QJ Gamer Platinum
- Registriert seit
- Nov 2005
- Beiträge
- 5.272
- Points
- 32.631
- Level
- 100
- Downloads
- 0
- Uploads
- 0
EDIT: original thread ----->HERE
Zitat von hooger
thats me ^^ need help...
.....sadly complete n00b please be gentle.....Geändert von Hooger (12-22-2005 um 01:50 PM Uhr)
-
12-22-2005, 06:58 PM #386words 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
i modded my xbox yay! now i have a better internet browser! i shall continue my LUA project!

...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
-
12-22-2005, 08:38 PM #387QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- Grand Line
- Beiträge
- 5.996
- Points
- 40.380
- Level
- 100
- Downloads
- 0
- Uploads
- 0
hmm i need some help on how to press a key and it displays Text this is my code right now
Code:if pad:cross() then screen:print(40, 150, cross "Welcome to the Tutorial For pspBaller, blue) screen.flip() end
[CENTER][IMG]http://img130.imageshack.us/img130/1640/acefcbanner2wo9.gif[/IMG]
[SIZE=1][B]I'm soo hot[/B][/SIZE]
[/CENTER]
[SIZE=2][CENTER][/SIZE][/CENTER]
[center]Sorry. No Advertising[/center]
-
12-22-2005, 08:49 PM #388QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
try this if it doesnt work let me know
Zitat von KINGOFNOOBS
and you do haveCode:if pad:cross() then screen:print(40, 150, "Welcome to the Tutorial For pspBaller, blue) screen.flip() screen.waitVblankStart() end
in there right?Code:pad = Controls.read
-
12-22-2005, 09:05 PM #389QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- Grand Line
- Beiträge
- 5.996
- Points
- 40.380
- Level
- 100
- Downloads
- 0
- Uploads
- 0
doesnt work...
heres all my code
Code: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) screen:print(150, 130, "Welcome To pspBaller Beta!", blue) screen.flip() while true do screen.waitVblankStart(180) screen:clear() screen:print(40, 150, "Thank you for waiting, now Press X for Tutorial", blue) screen.flip() pad = Controls.read() if pad:cross() then screen:print(40, 150, "Welcome to the Tutorial For pspBaller, blue) screen.flip() screen.waitVblankStart() end end
[CENTER][IMG]http://img130.imageshack.us/img130/1640/acefcbanner2wo9.gif[/IMG]
[SIZE=1][B]I'm soo hot[/B][/SIZE]
[/CENTER]
[SIZE=2][CENTER][/SIZE][/CENTER]
[center]Sorry. No Advertising[/center]
-
12-22-2005, 09:29 PM #390QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
there ya go. added a background too =) just make sure you hold "X" as soon as it says press "X", until the text you want to appear appears, just to make sure it works.
welcome :)Code: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) background = Image.load("background.png") screen:blit(0, 0, background, false) screen.flip() screen.waitVblankStart(120) screen:blit(0, 0, background, false) screen:print(150, 130, "Welcome To pspBaller Beta!", blue) screen.flip() screen.waitVblankStart(180) screen:blit(0, 0, background, false) screen:print(40, 150, "Thank you for waiting, now Press X for Tutorial", blue) screen.flip() screen.waitVblankStart(120) pad = Controls.read() if pad:cross() then screen:blit(0, 0, background, false) screen:print(40, 150, "Welcome to the Tutorial For pspBaller", blue) screen.flip() screen.waitVblankStart(400) end


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