Zeige Ergebnis 2.731 bis 2.760 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; Hi cool thread helped me alot...
-
06-20-2006, 04:14 PM #2731
Hi cool thread helped me alot
-
06-20-2006, 04:16 PM #2732QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
hello and well i guess welcome to the forums it looks like=-)
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
-
06-21-2006, 01:39 AM #2733
Good to hear. Atleast I helped you with one thing
Zitat von slicer4ever
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
06-21-2006, 04:01 AM #2734Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Can Someone Pleassssssssssssss Help Me Wit My Question On The Last Page??
--------------------------------------------------------------------------------------
-
06-21-2006, 08:29 AM #2735QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
can you upload your code or pm a link to where i can see it?
Geändert von slicer4ever (06-21-2006 um 09:27 AM Uhr)
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
-
06-22-2006, 02:05 AM #2736Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
me?? i was just asking if there was a way to not use oldpad statements. my question is on the last page. and my code is the bullets snippet from pspmillionaire.
Zitat von slicer4ever
--------------------------------------------------------------------------------------
-
06-22-2006, 05:12 AM #2737
@ Grimfate126:
I never used his snippets, but I can't imagine why the oldpad way wouldn't work. Or he/you made a mistake with it. Otherwise it should know weither or not you press the button again.LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
06-22-2006, 06:06 AM #2738QJ Gamer Bronze
- Registriert seit
- Feb 2006
- Ort
- Earth, UK
- Beiträge
- 457
- Points
- 5.924
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Grimfate126 if you show us the code that doesnt work then we can see if theres a mistake (evilmana.com doesnt work anymore for some reason so we cant see it from there)
<<Put A message Here>>
<<Just made another rubbish website visit it here.>>
-
06-22-2006, 08:58 AM #2739QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
just do a couple of replaces:
for example:
1. find and replace:
and oldpad
button used)() ~= pad
button used)()
with
(nothing)
next search for oldpad and replace that with nothing
this well make it so now when you hold down the button to fire it well keep firing
but wait you are limited by 5 bullets(if i remeber correctly) so go find the array that says bullets and you should see a loop above it change the 5 to say 20 that should be enough to clear them off the screen in time o and go to your bulletsetup array and you well see sometin like:
if currentbullet > 5 then
currentbullet = 1
else
currentbullet = currentbullet + 1
end
change the 5 to the samething you changed the the loop with1. 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
-
06-22-2006, 08:23 PM #2740I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Saving
Does anyone know if there is a save state function in lua?

-
06-23-2006, 03:29 AM #2741QJ Gamer Gold
- Registriert seit
- Mar 2006
- Ort
- LOLWUT
- Beiträge
- 2.625
- Points
- 18.627
- Level
- 86
- Downloads
- 0
- Uploads
- 0
You would have to make it up yourself.
Zitat von Access_Denied
My lua is a bit rusty, but I think that is how it is.Code:file = io.open("highscore.txt", "w") --Open the file in write mode file:write("Highscore = " .. highscore) --Write the highscore to the file file:close() --Close the file.
Yep, it is. I tested it and it works perfectly.Geändert von PSPduh (09-14-2006 um 04:09 PM Uhr)
-
06-23-2006, 03:50 AM #2742Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
the problem with that is when you TAP x, 3-4 bullets come out at once, and if you HOLD it, the bullets just line up in front of you and release once you let go of x. thats bad cause then you have 20 bullets going all at once , which is really cheap.
Zitat von slicer4ever
--------------------------------------------------------------------------------------
-
06-23-2006, 03:34 PM #2743
So without the oldpad it does work?
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
06-23-2006, 08:25 PM #2744QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
yes it well the thing is it seems like it lags there are multiple ways of doing this like creating a timer and if you press x then the timer resets etc etc but i advise using oldpad just try diffrent things...
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
-
07-02-2006, 03:04 PM #2745Developer

- Registriert seit
- Jul 2006
- Ort
- Ireland
- Beiträge
- 205
- Points
- 5.397
- Level
- 47
- Downloads
- 0
- Uploads
- 0
Does anyone have a guide on making a simple pong game? I just havn't a clue on where to start making one
-
07-02-2006, 08:10 PM #2746Developer

- Registriert seit
- Nov 2005
- Ort
- Land of Oz
- Beiträge
- 35
- Points
- 4.965
- Level
- 45
- Downloads
- 0
- Uploads
- 0
.. just think...
i would start with paddle movement, then add a ball with reflections off walls, then add in an angle thing to the paddle, so when it hits a paddle, it goes off at an angle depending how far up it the ball hits....
you really need to think on your own if you want to program
-
07-03-2006, 04:55 AM #2747QJ Gamer Blue
- Registriert seit
- Apr 2006
- Beiträge
- 146
- Points
- 4.464
- Level
- 42
- Downloads
- 0
- Uploads
- 0
I recently decided to try making some homebrew games for the PSP. I'm trying to make a game similar to breakout. I'm having a problem with figuring out how to get the ball to move realistically (bouncing off walls and the paddle at the right angle). Could someone explain to me what math formula I would need to use to accomplish this? I've tried searching, but I haven't come accross a source code for another breakout (I know they exist, I just can't find them). So, feel free to post a link to another source code, and I will see how they did it.
-
07-03-2006, 05:23 AM #2748<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
id like to know how to get the bounce off wall thing too,,
-
07-03-2006, 11:28 AM #2749
just reverse the direction of the ball.
Say you have a vertical wall
then if the x component of the ball's speed is say 1 (m/s or whatever) and its y component is 2. Then if it hits the wall th x component will reverse. So it will become -1 and the y will remain the same. Very easy.
If you want it to change the direction you will have to calculate the correct angle. You can use PSPGolf as an example for that.LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
07-03-2006, 12:01 PM #2750QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Illinois
- Beiträge
- 897
- Points
- 8.215
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Can someone take a look at my code.
The problem is at line 275 and the animation loops at the end.
Here is my LUA Script
http://www.sendspace.com/file/sw0ghd
-
07-03-2006, 12:30 PM #2751QJ Gamer Blue
- Registriert seit
- Apr 2006
- Beiträge
- 146
- Points
- 4.464
- Level
- 42
- Downloads
- 0
- Uploads
- 0
Zitat von Altair
Wouldn't that get the ball into an infinite loop between 2 points?
-
07-04-2006, 03:23 AM #2752
nope.
say the wall starts at xwall
and the ball goes with 1 pixel per loop to the right, where vx is the speed of the ball (vx=1 at the start)
if xball==xwall then
vx=-vx
end
x=x+vxLUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
07-04-2006, 07:00 AM #2753QJ Gamer Blue
- Registriert seit
- Apr 2006
- Beiträge
- 146
- Points
- 4.464
- Level
- 42
- Downloads
- 0
- Uploads
- 0
Have a look at the image I attached. It might clear up why I believe that the ball will be in an infinite loop.
-
07-04-2006, 04:56 PM #2754
I think i get why you think it'll loop. I was talking about a verticle wall starting at xwall and a ball moving from the left side of it to the right.
In case of a horizontal wall you do the same but then with the y component of the speed.
Also the ball doesn't just move one pixel to the left, but its speed is one pixel to the left/loop. I hop it makes it clear. If not you'll have to try and see for yourself.Geändert von Altair (07-04-2006 um 05:00 PM Uhr)
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
07-06-2006, 06:20 PM #2755<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
do any of you know how to change the colour of an image
like something like this
default image :)
then some code to change the yellow to purple like this :o
ive seen it done in psp air hockey, but i cant locate where it does it
any help?
-
07-06-2006, 07:07 PM #2756QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
by loading multiple images of the same thing but with diffrent colors for example:
that is all you have to do (note elseif is important because if you just use if then it well run threw each one and you well end up back at the purple ballCode:purple_ball = image.load(purpleball) orange_ball = image.load(orangeball) green_ball = image.load(greenball) currentball = purple_ball oldpad = nil function change_ball_color() if pad:cross() and oldpad:cross() ~= pad:cross() then if currentball == purple_ball then currentball = orange_ball elseif currentball == orange_ball then currentball = green_ball elseif currentball == green_ball then currentball = purple_ball end end end while true do pad = Controls.read() change_ball_color() screen:blit(240,136,currentball) screen.flip() screen.waitVblankStart() oldpad = pad end
Geändert von slicer4ever (07-06-2006 um 07:11 PM Uhr)
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
-
07-07-2006, 03:02 AM #2757
that, which is faster, or you make a function that checks for yellow pixels and if it finds one, it changes it to purple.
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
07-07-2006, 07:05 AM #2758
I just dug out LUA again to work on a projet. But havent worked in it for a while so i'm just making little test scripts, for some reason my function won't work, i get
Error: functions.lua:6: '=' expected near 'function'
Line 6 days 'function cursor()'
-
07-07-2006, 07:47 AM #2759QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
hmmm..unsure also altair how would you do sometin like that?
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
-
07-07-2006, 12:04 PM #2760QJ Gamer Green
- Registriert seit
- Sep 2005
- Ort
- Texas
- Beiträge
- 146
- Points
- 5.981
- Level
- 50
- Downloads
- 0
- Uploads
- 0
That would be pretty sloooow. Unless your working with small images. As for how you can change the color of an image, maybe take a solid color image (red, blue, etc) and place it on top of the other image with a alpha transparency?
Zitat von Altair
[IMG]http://img.photobucket.com/albums/v693/fchaos/koolaidsig.jpg[/IMG]


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