Zeige Ergebnis 6.781 bis 6.810 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; Thanks...
-
04-15-2007, 06:43 AM #6781
Thanks
-
04-15-2007, 09:14 AM #6782QJ Gamer Blue
- Registriert seit
- Jan 2007
- Ort
- somewhere
- Beiträge
- 119
- Points
- 4.239
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Ok I added animation to my game on start up and it works fine on the pc but when run it on my psp I get this error "Libpng warning: Incomplete compressed datastream in iCCP chunk Libpng warning: profile size field missing from iCCP chunk
-
04-15-2007, 11:19 AM #6783QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
is it possible to make color with half opacity???
i thought lowering RGBA element would make it half transparent, but that doesnt seem to work :/[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
04-15-2007, 11:52 AM #6784QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
transparentred = Color.new(255,0,0,127)
-
04-15-2007, 12:38 PM #6785QJ Gamer Blue
- Registriert seit
- Jan 2007
- Ort
- somewhere
- Beiträge
- 119
- Points
- 4.239
- Level
- 41
- Downloads
- 0
- Uploads
- 0
any body know whats wrong
Zitat von pspfreak101
-
04-15-2007, 05:35 PM #6786
Yeah, youre using the windows port of lua player
Zitat von pspfreak101
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
04-15-2007, 05:59 PM #6787QJ Gamer Blue
- Registriert seit
- Jan 2007
- Ort
- somewhere
- Beiträge
- 119
- Points
- 4.239
- Level
- 41
- Downloads
- 0
- Uploads
- 0
But it works fine on the pc
-
04-15-2007, 06:16 PM #6788QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
But windows luaplayer ftl
-
04-15-2007, 06:32 PM #6789
Hey guys i was wondereing if there is a tutorial for making an digital clock anywhere. Or if someone could just help me out.
Thanks Bob Hoil
-
04-15-2007, 06:34 PM #6790QJ Gamer Gold
- Registriert seit
- Nov 2006
- Ort
- ...
- Beiträge
- 2.080
- Points
- 11.942
- Level
- 71
- Downloads
- 0
- Uploads
- 0
couldn't you just use the screen.waitVblankStart() to your advantage, all you'll need is the set of numbers
-
04-15-2007, 06:37 PM #6791
I have a question can you get the time that is set on the psp and use that and have it print to the screen some how so that would be the clock?
-= Double Post =-
That way you don't have to code an entire clock.Geändert von Bob Hoil (04-15-2007 um 06:38 PM Uhr) Grund: Automerged Doublepost
-
04-15-2007, 06:39 PM #6792QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Go to the lua snippets thread and theres a clock snippet i have in there just look for it
-
04-15-2007, 06:42 PM #6793
I just found it before you posted it thanks.:)
-
04-15-2007, 06:45 PM #6794
Its...in...the... luaplayer....build....
Zitat von Bob Hoil
-= Double Post =-
It does? I thought you had a problem with it?
Zitat von pspfreak101
Geändert von youresam (04-15-2007 um 07:04 PM Uhr) Grund: Automerged Doublepost
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
04-15-2007, 07:07 PM #6795QJ Gamer Gold
- Registriert seit
- Nov 2006
- Ort
- ...
- Beiträge
- 2.080
- Points
- 11.942
- Level
- 71
- Downloads
- 0
- Uploads
- 0
that's what i thought too
-
04-15-2007, 09:49 PM #6796words 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
pspfreak - Try opening and re-saving your image giving you the problem as PNG using MSPaint. Other than that, i dont know what to suggest you try.

...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
-
04-16-2007, 01:27 AM #6797Monster Masher
- Registriert seit
- Jun 2006
- Ort
- Behind you...
- Beiträge
- 265
- Points
- 5.084
- Level
- 45
- Downloads
- 0
- Uploads
- 0
Hello, Ive just started to learn Lua
Ive made a small script which im trying to run in luaplayerwindows, and i get an error that in line ten "then" expected near " ="
heres the code:
Now I know it's something in the syntax of if statements, and dont flame me for being a Luan00b. Please just say the problem and leave me alone.Code:red = Color.new(255, 0, 0) blue = Color.new(0, 0, 255) green = Color.new(0, 255, 0) color = red while true do screen:print(0, 0, "This text is red. Press 'X' to change the color.", color) screen.flip() end if pad:cross() then if color = red then color = blue end if color = blue then color = green end if color = green then color = red end end while true do screen.waitVblankStart() end
-
04-16-2007, 02:11 AM #6798
when using if statements, you need to use "==" instead of"="
-
04-16-2007, 04:24 AM #6799Monster Masher
- Registriert seit
- Jun 2006
- Ort
- Behind you...
- Beiträge
- 265
- Points
- 5.084
- Level
- 45
- Downloads
- 0
- Uploads
- 0
Ok, thanks. Another problemo in another script:
At line 55 (the first for) attempting to index "?"Code:--variables easy=1 med=1 hard=1 enemy1={} enemy2={} enemy3={} bullet={} --Load images bulletimg=Image.load("bullet.png") planeimg=Image.load("blob.png") --TIMERS easytimer=0 medtimer=0 hardtimer=0 --Collision script function Death(obj) if (obj.x+obj.width>bullet.x) and (obj.x<bullet.x+16) and (obj.y+obj.height>bullet.y) and (obj.y<bullet.y+16) then score=score+20 obj.x=1000000000 end end --Increase the timers easytimer=easytimer+1 medtimer=medtimer+1 hardtimer=hardtimer+1 --reset them if easytimer>300 then easytimer=0 enemy1[easy]={x=math.random(480-32), y=0, width=32, height=32} easy=easy+1 end if medtimer>450 then medtimer=0 enemy2[med]={x=math.random(480-32), y=0, width=32, height=32} med=med+1 end if hardtimer>600 then hardtimer=0 enemy3[hard]={x=math.random(480-32), y=0, width=32, height=32} hard=hard+1 end --Draw the planes while true do for a=1,easy do screen:blit(enemy1[a].x, enemy1[a].y, planeimg, false) end for b=1,med do screen:blit(enemy1[b].x, enemy1[b].y, planeimg, false) end for c=1,hard do screen:blit(enemy1[c].x, enemy1[c].y, planeimg, false) end end
Is this because the for statement is wrong, or that I cant use easy?
-
04-16-2007, 05:02 AM #6800QJ Gamer Gold
- Registriert seit
- Nov 2006
- Ort
- ...
- Beiträge
- 2.080
- Points
- 11.942
- Level
- 71
- Downloads
- 0
- Uploads
- 0
did you try it without using easy
-
04-16-2007, 05:37 AM #6801QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
thx, thats what i was doing... but i didnt know it doesnt work in windows lua player
Zitat von TacticalPinguin
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
04-16-2007, 05:56 AM #6802QJ Gamer Blue
- Registriert seit
- Apr 2007
- Beiträge
- 81
- Points
- 3.525
- Level
- 37
- Downloads
- 0
- Uploads
- 0
whats wrong with this line?
pad = Controls.read()
I get an error "Attempt to index global 'controls' (a nil value)"
-
04-16-2007, 06:44 AM #6803Monster Masher
- Registriert seit
- Jun 2006
- Ort
- Behind you...
- Beiträge
- 265
- Points
- 5.084
- Level
- 45
- Downloads
- 0
- Uploads
- 0
weird that seems odd...check capitals.
on another note:
should act as an alarm - only the alarm never goes down. it is always 60. shouldntCode:alarm={} red=Color.new(255, 0, 0) b=1 for a=1, 6400 do alarm[a]=0 end alarm[0]=60 block={} block[1]={x=math.random(440), y=math.random(240), width=32, height=32} blockimg=Image.load("circle.png") while true do for a=1, 6400 do if alarm[a]>0 then alarm[a]=alarm[a]-1 end end if alarm[0]<=1 then block[b+1]={x=math.random(440), y=math.random(240), width=32, height=32} alarm[0]=60 end for f=1, b do screen:clear() screen:print(0, 0, alarm[0], red) screen:blit(block[f].x, block[f].y, blockimg, false) screen.flip() screen.waitVblankStart() block[f].y=block[f].y+1 end endmake it go down?Code:for a=1, 6400 do if alarm[a]>0 then alarm[a]=alarm[a]-1 end end
-
04-16-2007, 06:49 AM #6804QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
nothing
question: is it possible to draw circle ??? i looked in SGs transmutation script but i want to draw it without that "animation"[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
04-16-2007, 07:02 AM #6805QJ Gamer Blue
- Registriert seit
- Apr 2007
- Beiträge
- 81
- Points
- 3.525
- Level
- 37
- Downloads
- 0
- Uploads
- 0
Zitat von xmex
Nope. I tried upper and lowercase. Same problem.
-
04-16-2007, 07:03 AM #6806Developer

- Registriert seit
- Jul 2006
- Beiträge
- 205
- Points
- 4.318
- Level
- 41
- Downloads
- 0
- Uploads
- 0
That's not the line the error is referring to.
Zitat von yumCOOKIEZZ
you are setting alarm[1-6400]==0, and then you say alarm[0]=60, and then you loop from 1 to 6400 checking if it's greater than zero.Code:for a=1, 6400 do alarm[a]=0 end alarm[0]=60 while true do for a=1, 6400 do if alarm[a]>0 then alarm[a]=alarm[a]-1 end end
I really don't know how you're not getting an error, because table indices do not begin at zero in Lua. Even if they did, that if statement would never be true since you don't check the zeroth entry of the table in the while loop, whatever that means. On top of that, it only decrements the current entry, so even if it did what you seem to be trying to make it do, the table would just be {59,0,0,0,0,0,........}.
-
04-16-2007, 07:09 AM #6807QJ Gamer Blue
- Registriert seit
- Apr 2007
- Beiträge
- 81
- Points
- 3.525
- Level
- 37
- Downloads
- 0
- Uploads
- 0
It said line 54 and...that was line 54 o.o
Zitat von LMelior
-
04-16-2007, 07:51 AM #6808Monster Masher
- Registriert seit
- Jun 2006
- Ort
- Behind you...
- Beiträge
- 265
- Points
- 5.084
- Level
- 45
- Downloads
- 0
- Uploads
- 0
okok, i see fixed it. But now a new problem:
I have a variable called direction, which is 0 - 360. If i hold left it goes up, and right it goes down. How can I calculate the correct x and y increments to use this to move around? as in if it was 0, which i want to be right, it would be x=x+2. And if it was 45 it would be x=x+1 y=y-1. The thing is, I cant have 360 if statements. Is the an algorithm for this?
-
04-16-2007, 08:37 AM #6809QJ Gamer Green
- Registriert seit
- Jan 2006
- Beiträge
- 508
- Points
- 5.382
- Level
- 47
- Downloads
- 0
- Uploads
- 0
You can use basic trigonometry: SOHCAHTOA
Zitat von xmex
You have an angle, and a distance, you can calculate the x and y by applying knowledge from the above link.
-
04-16-2007, 09:27 AM #6810Monster Masher
- Registriert seit
- Jun 2006
- Ort
- Behind you...
- Beiträge
- 265
- Points
- 5.084
- Level
- 45
- Downloads
- 0
- Uploads
- 0
Well that sort of is the idea but i'm not quite into Sin Cosine i cant really understand it. In Game Maker there was a function which returned the x and y componenets of a length and direction, which would help, except i doubt Lua has that.


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