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; i decided to give u on my script. i tried everything to get it working....
-
09-29-2008, 04:18 PM #9451QJ Gamer Gold
- Registriert seit
- May 2005
- Ort
- I live in a City that goes by the nickname:The Bubble. 'Nuff said.
- Beiträge
- 1.766
- Points
- 13.240
- Level
- 74
- Downloads
- 0
- Uploads
- 0
i decided to give u on my script. i tried everything to get it working.

-
09-29-2008, 05:04 PM #9452QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
[size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]
-
09-29-2008, 07:28 PM #9453QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
really, i could have sworn pge was 3D capable, however your more of an expert on it than me
1. 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
-
09-29-2008, 08:13 PM #9454QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
It was in the plans but got dropped for stability for an earlier release. IWN is adding it back in as we speak and has a beta with pretty good support of it and he's made a few demonstrations of its abilities.
[size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]
-
09-29-2008, 08:31 PM #9455QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
well than in that case fchaos, your going to want to look up sceGuBlendFunc(from what TP just said it should be just GuBlendFunc in lua) in the sdk documentation, http://psp.jim.sh/pspsdk-doc/group__...d3bf7d032c62b6
that should help at least somewhat, since many of the blending functions available(not the operations) are similar to opengl's available blending functions, i suggest also looking up glBlendFunc to get a more better understanding of how the different blending functions work, anywho hope this helps=-)1. 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
-
09-29-2008, 08:54 PM #9456QJ Gamer Green
- Registriert seit
- Sep 2005
- Ort
- Texas
- Beiträge
- 146
- Points
- 5.981
- Level
- 50
- Downloads
- 0
- Uploads
- 0
Alright then, I'll look into that, thanks for the replies.
[IMG]http://img.photobucket.com/albums/v693/fchaos/koolaidsig.jpg[/IMG]
-
10-01-2008, 08:55 PM #9457QJ Gamer Green
- Registriert seit
- Jul 2008
- Beiträge
- 6
- Points
- 3.918
- Level
- 39
- Downloads
- 0
- Uploads
- 0
Okay, Lua semi-noob here, and I have a problem with a walking animation in my first game.
Anyways, I blitted my character to the screen in a standing position. Using AnimLib v4.5, when right is pressed my player will walk right and play the walking animation. Everything works as it should except the animation is played on top of the standing still sprite, and it looks like a jumbled up mess.
So, my question - How, using AnimLib v4.5 (I think that's latest version, and are there easier ways to animate besides AnimLib?), do I have my sprite standing still, then when right is pressed the walking animation is played, then when right is released it goes back to standing still?
P.S. - Here's my code, and sorry if it's a mess...
Code:player1 = Image.load("player1.png") player2 = Image.load("player2.png") player3 = Image.load("player3.png") player4 = Image.load("player4.png") player5 = Image.load("player5.png") player6 = Image.load("player6.png") background = Image.load("paper1.png") speed = "2" Player = {pic = player1, width = 32, hieght = 48, x = 0, y = 211} dofile("animLib.lua") player = ANIM.new("player", "png", 6) while true do pad = Controls.read() screen:clear() screen:blit(0, 0, background, false) screen:blit(Player.x, Player.y, Player.pic, true) if pad:right() then player:blit(Player.x, Player.y, 50) Player.x = Player.x + speed end if pad:cross() then speed = "4" else speed = "2" end screen:flip() screen:waitVblankStart() oldpad = pad end
-
10-04-2008, 08:29 AM #9458
An easier way (but certainly not the best way) to animate would be to :
Thats off the top of my head I haven't done any debugging but it should work.Code:function animate(x,y,startx,starty,height,width,image) framecount = framecount + 1 animtempo = 0 if framecount == 6 then framecount = 0 animtempo = animtempo + 1 if animtempo == 1 then screen:blit(x,y,image,startx,starty,height,width) else screen:blit(x,y,image,animtempo *width,starty,height,width) end end end
PS: Use your whole spritesheet for this not the pieces of it
-
10-04-2008, 10:08 AM #9459QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
But that doesn't use input, he wants to actually be able to control his character.
What you posted was just for displaying an animation.
-
10-04-2008, 10:59 AM #9460QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
just make 4 functions similar to bnc9's example, called animateRight animateLeft animateUp and animateDown. Then just do:
if pad:right() then
animateRight()
end
if pad:left() then
animateLeft()
end
if pad:up() then
animateUp()
end
if pad:down() then
animateDown()
end
you would also have to move the character's x and y, accordingly, but I suspect that he knows how to do that already.
-
10-04-2008, 11:57 AM #9461QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
[size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]
-
10-04-2008, 01:46 PM #9462QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
lol, I know that there is a better way to do it, but I was keeping it simple. Thank you for telling him a better way though.
-
10-04-2008, 05:21 PM #9463QJ Gamer Green
- Registriert seit
- Jul 2008
- Beiträge
- 6
- Points
- 3.918
- Level
- 39
- Downloads
- 0
- Uploads
- 0
Thanks guys, I'll go try those examples out!
I'm not sure I understand, but I'll try it and get back to ya! Thanks again.
While I'm here, I have a question on a different game, my first game, I'm making, so i'll go ahead and ask it :Jump:
I've been making my first game for a couple of days now, and it's almost done.
In the game, you control a space ship - [X] makes the ship go up, [<] makes the ship go left, and [>] makes the ship go right. I've implemented some physics, so when you are not accelerating up, you will begin to fall, and if you are moving up and then let go of up then you will slow down, then begin to fall. The object of the game is to avoid asteroids as they fly across the screen.
Anyways, I need to know how I could do collision detection on the asteroids, which are not perfectly round as they contain craters and things like that, and my ship. I'm new to collision, but I do not think the basic collision tutorial (one on EvilMana) will work. So what could I use to achieve my goal? I haven't found hardly any collision tutorials...
Also, is it possible to do collision detection on spinning asteroids?
Thanks
And here's a screenshot to help understand how the game plays...
(Never Mind, I have to have 10 posts :))Geändert von cjmabry25 (10-04-2008 um 05:50 PM Uhr) Grund: Needed to change something... again...
-
10-04-2008, 08:16 PM #9464
@PSProgrammer: As TurtlesPwn said one function for all animations is better the example I posted allows you make animations for all directions instead of 4 hardcoded functions.
@cjmabry25: uhh this might help but it'll be a little difficult to implement in your game: http://www.forums.evilmana.com/index.php?topic=1412.15
check tacticalpenguins code and his explanation at the bottom.
It involves collision with lines rather than boxes.
You'll need to know a little bit about vectors to understand this.
-
10-04-2008, 08:58 PM #9465QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
[size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]
-
10-10-2008, 09:19 AM #9466
- Registriert seit
- Mar 2008
- Beiträge
- 22
- Points
- 2.831
- Level
- 32
- Downloads
- 0
- Uploads
- 0
Is there any way to encrypt or decrypt lua files?
-
10-10-2008, 09:27 AM #9467Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Yes there is.
-
10-10-2008, 09:47 AM #9468
- Registriert seit
- Mar 2008
- Beiträge
- 22
- Points
- 2.831
- Level
- 32
- Downloads
- 0
- Uploads
- 0
How?
-
10-10-2008, 10:11 AM #9469Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
If you use it you fail.
XtreamLua Compiler
-
10-10-2008, 02:50 PM #9470QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
No, it's called luac, xtreamlua's compiler is an idiotic frontend that just made it easy for the mass noobs to use. And it is not encryption or decryption, it is simply compiling. However, unless you have extremely good reason and understand how and why compiling your script would be needed, you shouldn't compile it, and I seriously doubt you have such understanding.
[size=3][url=http://luaplayer.org/forums/index.php?topic=507]Complete Lua development cycle outline[/url][/size]
-
10-19-2008, 10:33 AM #9471QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- GA, USA
- Beiträge
- 243
- Points
- 9.319
- Level
- 64
- Downloads
- 0
- Uploads
- 0
How can I switch between different main loops??? Like say I want to run gameA and I am currently playing gameB. How would I switch between the two. I have a variable called "layer" and its value tells my program which to do.
IGNORE THIS POST!!!!! I fixed my problem.My Anime List || My Homepage- Keep up with my projects || Userbar
Projects:
Unamed RPG- In Progress
Lua File Manager & Extraction GUI
PSP Soundboard
-
10-19-2008, 10:39 AM #9472Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
You should never have more than one main loop ...
-
10-24-2008, 01:43 PM #9473QJ Gamer Blue
- Registriert seit
- Aug 2008
- Ort
- Pennsylvania
- Beiträge
- 17
- Points
- 2.467
- Level
- 30
- Downloads
- 0
- Uploads
- 0
How do I put .mp3 music in a lua script?
-
10-24-2008, 01:53 PM #9474Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
You could open the lua script in notepad and drag and drop your mp3 on top of it.
-
10-24-2008, 01:56 PM #9475QJ Gamer Blue
- Registriert seit
- Aug 2008
- Ort
- Pennsylvania
- Beiträge
- 17
- Points
- 2.467
- Level
- 30
- Downloads
- 0
- Uploads
- 0
What what i mean is how do i loop it so when i go to the certain script on my psp the music plays.
-
10-24-2008, 02:11 PM #9476Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
-
10-29-2008, 11:40 AM #9477
What would be the best type of collision for a fighting game?
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
10-29-2008, 01:10 PM #9478QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
i'd suggest a box collision first, than do a pixel collision if the box collision passes
1. 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
-
10-29-2008, 01:35 PM #9479
Ok ill try it
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
10-29-2008, 02:03 PM #9480QJ Gamer Bronze

- Registriert seit
- Jul 2006
- Beiträge
- 550
- Points
- 5.381
- Level
- 47
- Downloads
- 1
- Uploads
- 0
You shouldn't need anything more accurate than box collision for a fighting game.


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