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; Alright, I have a lua question that isn't really to do with programming. I've been making a game for some ...
-
08-09-2008, 04:51 AM #9181Seven Year Vet. BOW DOWN.

- Registriert seit
- Dec 2005
- Ort
- Manchester, UK
- Beiträge
- 2.240
- Points
- 14.794
- Level
- 78
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Alright, I have a lua question that isn't really to do with programming. I've been making a game for some time now, whilst back on 3.52 m33, using luaplayer 0.16 because it was apparantly the fastest, however last night I hit some PSP problems, bricked and had to update to 3.80 m33. My game wouldn't run on 3.80 m33, whilst other lua applcations would, so I tried using a different version. The only one I could get to work was HM7, but that dropped the frps of my game from 27 to 9. Next, I tried updating to 4.01 m33, to see if I could get luaplayer 0.16 to work on that. No joy.
My question is, whats the fastest luaplayer avalible for 4.01 m33, or is there anything I can do to get luaplayer 0.16 to work with this firmware? Any ideas? (Ps. I do know I could just go back to 3.52 m33 and make this, but that means upon release it will still not work for newer firmwares, which would be a shame.)
-
08-09-2008, 05:08 AM #9182My 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]
-
08-09-2008, 05:16 AM #9183Seven Year Vet. BOW DOWN.

- Registriert seit
- Dec 2005
- Ort
- Manchester, UK
- Beiträge
- 2.240
- Points
- 14.794
- Level
- 78
- My Mood
-
- Downloads
- 1
- Uploads
- 0
-
08-09-2008, 05:21 AM #9184No longer a community member.
- Registriert seit
- Dec 2005
- Beiträge
- 22
- Points
- 46.662
- Level
- 100
- Downloads
- 0
- Uploads
- 0
The 1.50 kernel does not come by default with the M33 firmwares anymore, you have to install in manually. This is because the slims can't run the 1.50 kernel. I would advise that you fix your game so that it will work on the slim, especially if you plan on entering it into a contest. Preventing many users from running your game simply because you can't be bothered to fix is pretty lame IMO.
Anyways, I believe that you can find the 1.50 kernel addon on Dax's site.
-
08-09-2008, 05:30 AM #9185Seven Year Vet. BOW DOWN.

- Registriert seit
- Dec 2005
- Ort
- Manchester, UK
- Beiträge
- 2.240
- Points
- 14.794
- Level
- 78
- My Mood
-
- Downloads
- 1
- Uploads
- 0
I got the kernal add on, and for some reason the frame rate of my game has gone from 27 fps to 41. Strange, but cool. I was thinking of just relelasing the game with a different version of luaplayer for the slim, but having seen how much it lags now, I guess i'll have to find another way. How would you suggest I do it?
-
08-09-2008, 05:49 AM #9186
Luaplayer for 1.00 should work on slim
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]
-
08-09-2008, 06:35 AM #9187Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
LuaplayerHM or Cools Mod or the Luaplayer 0.20 mod for kernel 3xx
-
08-09-2008, 11:26 AM #9188
Achievements:
- Registriert seit
- Aug 2008
- Beiträge
- 8
- Points
- 1.864
- Level
- 25
- Downloads
- 0
- Uploads
- 0
ok when i insert an image of a person for example how can i make that person move or do i have to get multiple pictures of dofferent actions?
-=Double Post Merge =-
i used the team m33 version of lua on my psp 3.90 m33-3
-=Double Post Merge =-
how can i convert a .lua file into an eboot.pbp if possible?Geändert von pspprelgnd (08-09-2008 um 11:48 AM Uhr) Grund: Automerged Doublepost
-
08-09-2008, 01:42 PM #9189Raining
- Registriert seit
- Jun 2005
- Ort
- In The Fog...
- Beiträge
- 545
- Points
- 7.355
- Level
- 57
- My Mood
-
- Downloads
- 0
- Uploads
- 0
It is pretty obvious that if you want your character to move left, right, up, or down and make it look like it is actually walking/running/jumping/etc. you need multiple frames to make this happen.
Also, why would you need to convert a .lua file into an Eboot? Simply bundle it with a LuaPlayer if you wish it to run by itself.
-
08-10-2008, 11:39 AM #9190
Achievements:
- Registriert seit
- Aug 2008
- Beiträge
- 8
- Points
- 1.864
- Level
- 25
- Downloads
- 0
- Uploads
- 0
how do i get the analog stick to work?
-
08-10-2008, 12:20 PM #9191Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Here http://www.evilmana.com/tutorials/codebase/analog.phpCode:pad:analogX() pad:analogY()
-
08-11-2008, 08:02 AM #9192Seven Year Vet. BOW DOWN.

- Registriert seit
- Dec 2005
- Ort
- Manchester, UK
- Beiträge
- 2.240
- Points
- 14.794
- Level
- 78
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Uhh, hi guys, me again. I've hit another little snag in the game I'm making. The problem being with music. I know that using luaplayer v0.16 this has no MP3 support or anything like that, that I can only use MIDI files, thats not a problem. The problem is, the game is rather large; and whilst music runs fine in the menu, it just lags like hell in game. Apart from trying to optimize my code and using the collect garbage function, what else could I do to try and speed it up a little?
-
08-11-2008, 08:56 AM #9193Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Code efficiently?
Also Is it the Main Song e.g Always or Mostly played?
-
08-11-2008, 09:05 AM #9194QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
ok, Are you using a state system?? if not get one it will help make your code run faster, also, how wany different.lua files do you have that have a while true do loop in them??? you should be able to narrow your entire game down to only one or 2 while true do loops. You have any questions about what I've said then P.M. me or ask on this thread.
-
08-11-2008, 10:01 AM #9195QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
PSProgrammer, none of what you just said will have a damn thing to do with how fast the game runs. A state system is actually slower than other methods and having several different lua files allows memory to be conserved by only loading what's needed.
-Only blit images when you NEED TO
-Don't use fonts
-Any image that does not move around, blit it to the background so it is blitted with the background
-Store lots of stuff in variables rather than recalculating it constantly
-If you're using a bullet system with sin/cos, make a sin/cos cache table so that it doesnt have to recalc sin/cos each time you need it but instead simply accesses the value in the table
-
08-11-2008, 10:14 AM #9196Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
state systems are useful for menus, you can have the main game in a seperate lua file, and credits that are usually small inside one of the states for the menu, levels of the game can be in different lua files, aslong as the layout of the game is made correctly so that each level is loaded into the game rather than swapped to.
i would add more but i cba.------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
08-11-2008, 10:26 AM #9197QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Saying you would add more but cba is like saying Ok I am done now but I want you to know I could be more helpful but I am too busy to help you more than I already have.
-
08-11-2008, 11:23 AM #9198Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
08-11-2008, 02:04 PM #9199
Is it possible to rotate text in Lua? if so how would I do 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]
-
08-11-2008, 03:24 PM #9200Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
print the text to an Image.createEmpty() and then rotate the image, it would be much easier and the only way i can think of.
------ FaT3oYCG -----
AKA Craig, call me what you want to It's your preference.
My Website: http://www.modern-gamer.co.uk/
Currently working on:
(0) MediaGrab
(0) PGE Gears Of War - On hold (Very large project).
(0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).
-
08-11-2008, 03:32 PM #9201QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
-
08-12-2008, 03:54 PM #9202
Timer Help
I want an image to blit for three seconds so I made this function
Code:function rotateload() screen:blit(0,0,rotatebg) counter = Timer.new() currentTime = counter:time() screen:print(5,5,"Time: "..currentTime,white) if gamestate == "rotatescreen" and timerstart == "false" then counter:start() timerstart == "true" end if currentTime > 3000 then gamestate = "beggining" counter:reset(0) end end
The timer just stays at 0 and the rest doesn't work.
I don't understand why it won't work???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]
-
08-12-2008, 04:07 PM #9203Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
It's this If
Simple debugging should do the trick.Code:if gamestate == "rotatescreen" and timerStart == false then
Print The gamestate to the screen to see if the gamestate gets changed
-
08-12-2008, 04:13 PM #9204My 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]
-
08-12-2008, 04:18 PM #9205Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
If the gamestate doesn't change then Simple Logic: It will not workCode:IF THE GAMESTATE IS "rotatescreen" THEN DO SOMETHING END
-
08-12-2008, 04:21 PM #9206My 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]
-
08-12-2008, 04:25 PM #9207Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Then That Makes sense.
I'd do this
Code:function QuickBlit() local counter = Timer.new() local counterTime = counter:time() counter:start() while counterTime < 3000 do screen:blit(0,0,bg) end end
-
08-12-2008, 04:26 PM #9208My 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]
-
08-12-2008, 04:28 PM #9209Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
That would be more efficent, i'd say tidier aswell. Test it, tell me if it works?
-
08-12-2008, 04:36 PM #9210QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
In both of your functions (dan and chrome), you are creating new timer objects in the function. That means every time you call the 'blit' function, it will create a timer object then using that new created timer, work out how much time has passed (and since it is in the same frame it will be 0).
With that in mind, how should you fix this?[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]


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