Zeige Ergebnis 1.411 bis 1.440 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; Pllease post you code...
-
04-08-2006, 07:06 AM #1411Developer

- Registriert seit
- Mar 2006
- Ort
- Isle of Wight
- Beiträge
- 491
- Points
- 12.360
- Level
- 72
- Downloads
- 0
- Uploads
- 0
Pllease post you code
-
04-08-2006, 07:18 AM #1412Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
Its good I messed around and fixed it but I get the [colo=Black]****ING LOOP IN GETTABLE NOW[/black] on the lines with "--Loop In gettable" next to em
And the stick.x stuff has to be like that otherwise the player wont moveCode:black = Color.new(0,0,0) red = Color.new(255,0,0) stick = {} stick.x = 240 stick.y = 200 life = 1 coll = 0 y = 0 speed = 3 spike = Image.load("spike.png") bg = Image.load("background.png") death = Image.load("death.png") stick = Image.load("stick.png") math.randomseed(os.time()) x = math.random(480 - spike:height()) while true do screen:clear() screen:blit(0, 0, bg, false) screen:blit(stick.x, stick.y, stick) --Loop in gettable pad = Controls.read() screen:print(0, 240, "Speed: " .. speed, black) screen:blit(x, y, spike) if not paused then screen:print(0, 250, "UNPAUSED", black) y = y + speed if y + spike:height() >= 272 then screen:print(x, y - 10, "OUCH!", red) y = 0 x = math.random(480 - spike:height()) screen.flip() System.sleep(2000) end else screen:print(0, 250, "PAUSED", red) end if pad:cross() and pad ~= oldpad then if paused then paused = false else paused = true end end if pad:up() and pad ~= oldpad then speed = speed + 1 end if pad:down() and pad ~= oldpad then speed = speed - 1 end if pad:left() and pad ~= oldpad then --Loop In gettable stick.x = stick.x - 2 end if pad:right() and pad ~= oldpad then -- Loop in gettable stick.x = stick.x + 2 end oldpad = pad screen.flip() screen.waitVblankStart() endGeändert von Mast3r_Shak3 (04-08-2006 um 07:29 AM Uhr)

--XBL Gamertag: PhenoM904--
-
04-08-2006, 07:50 AM #1413QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
LUA PLAYER BUG?
If you do like this:
It obviously plays the bgsound.Code:if BGSoundTimer >= 1 then BGSound:play() BGSoundTimer = 0 end
But if you have any other sound that starts exactly when "BGSound" stops, then BGSound just stop looping, just stops.
It drives me nuts, because i really want to finnish my game![CENTER]Some of my homebrew Applications/Games:
[URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
[URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]
[URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]
-
04-08-2006, 09:25 AM #1414Think, Do, Gloat.
- Registriert seit
- Nov 2005
- Ort
- England, Norwich
- Beiträge
- 1.422
- Points
- 12.687
- Level
- 73
- Downloads
- 0
- Uploads
- 0
Why don't you use
Zitat von MaSt3r_ShAk3
That might fix the problem.Code:if pad:right() and oldpad:right() ~= pad:right() then stick.x = stick.x + 2 end
-
04-08-2006, 09:48 AM #1415Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
i still get the error for the
Code:screen:blit(stick.x, stick.y, stick) --Loop in gettable

--XBL Gamertag: PhenoM904--
-
04-08-2006, 09:56 AM #1416
i'm getting loop for gettable with...
Code:monster = Sound.load("sounds/monsterkill.wav",false) voice = monster monster:stop() -- this gives loop gettable thing
-
04-08-2006, 10:02 AM #1417QJ Gamer Silver
- Registriert seit
- Oct 2005
- Ort
- Sheffield, UK
- Beiträge
- 844
- Points
- 8.201
- Level
- 61
- Downloads
- 0
- Uploads
- 0
luaplayer dosnt understand what monster means because monster is not a command.
Zitat von Rixorster
-
04-08-2006, 10:07 AM #1418Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
He assigned monster to the sound he loaded

--XBL Gamertag: PhenoM904--
-
04-08-2006, 10:18 AM #1419QJ Gamer Blue
- Registriert seit
- Jun 2005
- Beiträge
- 55
- Points
- 4.899
- Level
- 44
- Downloads
- 0
- Uploads
- 0
ok, this is getting annoying. i keep trying to make start resart the game im working on, nad every time i get
no loop to break near end
and my code is this
if pad:start() then
break
end
ive tried it withall versions .10 and up, and ive tried it with all buttons. plz help
ps. does ne one know where to get lua player 0.09?
-
04-08-2006, 10:54 AM #1420QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
That's because there is no loop to break.
Zitat von qwerty
i rather would use:
To refresh the program, while creationg something in lua.Code:if pad:start() then dofile "index.lua" end
Geändert von HaxxBlaster (04-08-2006 um 11:03 AM Uhr)
[CENTER]Some of my homebrew Applications/Games:
[URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
[URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]
[URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]
-
04-08-2006, 11:24 AM #1421
Theres just something i need to clarify.
If i do a dofile, does my application retain all the variables, arrays etc from the other file?D:
-
04-08-2006, 11:25 AM #1422Quality Haxing Since 1991
- Registriert seit
- Oct 2005
- Ort
- Pennsylvania, USA Fi
- Beiträge
- 6.206
- Points
- 29.255
- Level
- 99
- Downloads
- 0
- Uploads
- 0
Yes it does.
Zitat von Gutya
Zitat von Noriko
-
04-08-2006, 11:29 AM #1423
Thanks mate.
P.S. Haha, just noticed the sig.
D:
-
04-08-2006, 03:24 PM #1424QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- Puerto Rico
- Beiträge
- 310
- Points
- 7.109
- Level
- 55
- Downloads
- 0
- Uploads
- 0
thanks, I see what I can do.
Zitat von califrag
-
04-08-2006, 04:41 PM #1425Simon Champion!
- Registriert seit
- Mar 2006
- Ort
- Calgary, Alberta, Ca
- Beiträge
- 537
- Points
- 11.489
- Level
- 70
- Downloads
- 0
- Uploads
- 0
I did. Nobobdy gave any examples lkike that.
Zitat von califrag
-
04-08-2006, 05:31 PM #1426Simon Champion!
- Registriert seit
- Mar 2006
- Ort
- Calgary, Alberta, Ca
- Beiträge
- 537
- Points
- 11.489
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Nobody has been able to help me.....I am dissapointed in this thread....
-
04-08-2006, 09:50 PM #1427QJ Gamer Bronze
- Registriert seit
- Jul 2005
- Ort
- Washington
- Beiträge
- 211
- Points
- 5.459
- Level
- 47
- Downloads
- 0
- Uploads
- 0
Hey, can someone help me with a couple of things?
If someone were to make a game in lua, ex. a fighting game , how would one go on about it. I've read the tutorials provided by whitehawk, they've helped alot but im looking for something a bit more complicated. How would you make it so that when your press a button, such as X, an animation plays?
something like this?
if pad:cross then
screen:blit(30, 120, punchR)
screen.flip()
end
except the character is actually executing the animation so that the location is not needed but it is where the character is, how would I do that, make it so that the character image changes to the animation, at his position? Then back?
Also How would you make your character move at a constant rate when you hold down a button and stop when you release? Would you have a command that if the button is pressed the character moves X amount of pixels right or left ect, depending on the button and then it stops when the button is released? If so, what is the command?
Finally how would you make it so that when an animation is played, if the opposing character is in range (right next to you) that the animation changes from just playing the animation but to another one where the opposing character is hit and his life goes down, an if command? If character is in range, play animation punchedR new line health - 20?
Thanks for your help
Andrey
Edit: One last thing, how would you make that if you have an image (background) and your moving in it, when you reach the end of the screen it keeps moving. Like a long image horizantle that you keep moving through then at the end when you touch a certain object it takes you to the next image, (background/level).Geändert von Andrey (04-08-2006 um 10:04 PM Uhr)
Psp firmware: 1.5 - Thank you 0okm and Fanjita! ^^
-
04-08-2006, 10:07 PM #1428SHOOP DA WHOOP

- Registriert seit
- Aug 2005
- Ort
- Wii forums
- Beiträge
- 7.407
- Points
- 12.310
- Level
- 72
- Downloads
- 0
- Uploads
- 0
how would you do a sidescrolling screen? such as when your sprite reaches the end of the screen (or the middle) it scrolls with him
-
04-08-2006, 10:12 PM #1429Simon Champion!
- Registriert seit
- Mar 2006
- Ort
- Calgary, Alberta, Ca
- Beiträge
- 537
- Points
- 11.489
- Level
- 70
- Downloads
- 0
- Uploads
- 0
I would also like to know EVERYTHING you just said.
Zitat von Andrey
-
04-08-2006, 10:19 PM #1430
I found this in teh internet :P
Zitat von mannymix03
Code:--load the images layer = { buffer = Image.createEmpty(480, 272) } slicesize=500 slices = { Image.load("slice1.png"), --500x272px Image.load("slice2.png"), --500x272px Image.load("slice3.png") --500x272px --images are at his site } -- 0..1500 shade = { start=0, ende=480 } drawslices = 0 function limited(val) val = math.ceil(val/501) if val>table.getn(slices) or val==0 then return 1 end return val end -- correct this value while not Controls.read():start() do shade.ende = shade.ende+1 shade.start = shade.start+1 if shade.ende>=1500 then shade.ende=0 end if shade.start>=1500 then shade.start=0 end --move the background to left layer.buffer:clear() drawslices = slicesize-math.mod(shade.start,slic esize+1) layer.buffer:blit(0,0,sli ces[limited(shade.start)],math.mod(shade.start,sli cesize+1),0,drawslices,27 2) layer.buffer:blit(drawsli ces,0,slices[limited(shade.ende)],0,0,math.mod(shade.ende, slicesize+1),272) layer.buffer:print(25, 100,shade.start ,Color.new(255,0,46)) layer.buffer:print(25, 110,shade.ende ,Color.new(255,0,46)) -- update screen screen:blit(0,0,layer.buf fer) screen.flip() end
-
04-08-2006, 11:07 PM #1431QJ Gamer Bronze
- Registriert seit
- Jul 2005
- Ort
- Washington
- Beiträge
- 211
- Points
- 5.459
- Level
- 47
- Downloads
- 0
- Uploads
- 0
For those interested more in lua, here is a tutorial which i think covers animation. Its http://wiki.ps2dev.org/psp:lua_player:tutorial it starts out with the hello world but talks about animation and a couple of other things, hope ya find what you need.
Going to read it nowPsp firmware: 1.5 - Thank you 0okm and Fanjita! ^^
-
04-09-2006, 12:44 AM #1432QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
Hey people, I jsut wanted to ask if anyone knew why some music in a gmae like BME would be disorted? It honestly is totally screwed, only plays a deep sound.
-
04-09-2006, 01:08 AM #1433QJ Gamer Platinum
Awards:
- Registriert seit
- Jan 2006
- Ort
- stevens bumhole
- Beiträge
- 10.308
- Points
- 87.718
- Level
- 100
- Downloads
- 0
- Uploads
- 0
how do i do to make a game compatible with the analog stick?? please help!
-
04-09-2006, 02:12 AM #1434QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
Look at PSPGuitar, it uses analog stick.
-
04-09-2006, 05:51 AM #1435<img src="images/smilies/psp.gif" border="0" alt="" title="" cl***="inlineimg" /> <img src="images/smilies/Punk.gif" border="0" alt="" title="" cl***=&

- Registriert seit
- Jun 2005
- Ort
- Canada
- Beiträge
- 1.944
- Points
- 11.105
- Level
- 69
- Downloads
- 0
- Uploads
- 0
I learned to do analog controls from this post,,
Zitat von madsoul
Zitat von monster356
-
04-09-2006, 10:16 AM #1436words 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
1. Thats Lumo's scrolling example, so i ask you, whyd you edit out his name and comments at the very top huh?
Zitat von Rixorster
2. That is a very good scrolling example except copying and pasting doesnt help you. You wont learn anything, nor if someone hoping to learn from your code will either, that is why its fairly important youeither make it yourself, or fully comment that scrolling example.
My opinion ^
EDIT
Oh and FLai, you just spammed again, nice work! WWAAYY off topicc, and no use, should have PMd me, not post it here to get 1 + post count... Your on a roll today!! w00t w00t, tread cautiouslyGeändert von SG57 (04-09-2006 um 10:23 AM Uhr)

...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-09-2006, 10:59 AM #1437
SG57, i found it in psplua.com, don't blame me <.< there were no credits there o_o
-
04-09-2006, 12:10 PM #1438
Is there like a basic quit command?
Like
if bla then
quit
end
what can i use?D:
-
04-09-2006, 12:11 PM #1439Quality Haxing Since 1991
- Registriert seit
- Oct 2005
- Ort
- Pennsylvania, USA Fi
- Beiträge
- 6.206
- Points
- 29.255
- Level
- 99
- Downloads
- 0
- Uploads
- 0
"break" is the basic quit command. It should break the loop and bring you back to lowser. So for example:
Zitat von Gutya
Code:if pad:start() then break end
Zitat von Noriko
-
04-09-2006, 12:16 PM #1440
What if your not loading it in Lowser? What if its with an eboot?
And also i tried that, but it doesnt seem to work in a function.D:


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