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 its been driving me crazy forever. Does LPHMv2 allow flash 0 access because I know how to code lua ...
-
07-02-2009, 11:43 PM #10051QJ Gamer Blue
Achievements:
- Registriert seit
- May 2009
- Beiträge
- 106
- Points
- 2.716
- Level
- 31
- Downloads
- 0
- Uploads
- 0
alright its been driving me crazy forever. Does LPHMv2 allow flash 0 access because I know how to code lua and so far Ive been unsuccessful? If I could get a solid answer to this it would settle my nerves
-
07-03-2009, 02:24 AM #10052Developer 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).
-
07-03-2009, 07:24 AM #10053
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]
-
07-03-2009, 09:07 AM #10054QJ Gamer Blue
Achievements:
- Registriert seit
- May 2009
- Beiträge
- 106
- Points
- 2.716
- Level
- 31
- Downloads
- 0
- Uploads
- 0
yeah i can access and write and to flash 1 and I can read from flash 0 I just cant write to it. It says that it is writing to it so I know nothing is wrong with my code its just when you go to see if it actually wrote the file/files to flash 0 and it doesnt? Any one know if it just doesnt function right or is there a way around it. Thanks in advance to anyone that helps.
-
07-03-2009, 11:40 AM #10055Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
i have told many people many times HM is very buggy flash access is buggy along with other things, there is no way to fix the bugs that is down to HM himself.
you always have the alternative to switching to PGE it currently does not have many of the functions that HM does but with the release of 0.03 it will support module loading meaning that for example someone like me could create a module that could be loaded that would allow specific extra functions
what do you mean a level editor all it is is blocks on the screen?Geändert von FaT3oYCG (07-03-2009 um 11:42 AM Uhr) Grund: hehe
------ 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).
-
07-03-2009, 02:15 PM #10056
To make the layouts of the blocks.
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]
-
07-03-2009, 05:29 PM #10057Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
1. decide the format of the file the levels will be in
2. code reading the file into ur game
3. code analysing the code you have read in
4. code turning those analysations into displaying the blocks for that level
5. im not going to code it for you, im making my own things (unless you pay me XD)------ 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).
-
07-03-2009, 05:41 PM #10058Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Wouldn't even be hard.
I mean, it's one screen, you don't have to take into account any sort of scrolling at all(though that is easy as-well).
You need some sort of cursor to move the tiles. A variable to hold the current selected tile, layer changing (the easiest way is using a bool).
For a understandable way to write a 2d array to a file view the scripts/examples thread.
With the way i did my function it took two values. mapX & mapY. Basically i have a little mini-menu where i enter the size of my map, then it creates the map & there you go.
to load a map i simply do:
mapX = #map[1]
mapY = #map
It's as easy as that. Though if you don't really understand tile-maps then your gunna have trouble.
-
07-03-2009, 05:44 PM #10059
Thanks thats what I needed
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]
-
07-07-2009, 06:27 AM #10060QJ Gamer Bronze

- Registriert seit
- Dec 2007
- Ort
- B.F.
- Beiträge
- 328
- Points
- 7.257
- Level
- 56
- My Mood
-
- Downloads
- 1
- Uploads
- 0
I was wondering about if anyone has already used these LPHM's v7 built in functions:
How should i proceed to custom the Save file it retrieves with my own PIC1.png and ICON0.png images ?Code:System.startGameSave() System.startGameLoad()
Another question else, assuming i have saved something just this way:
This work, but I guess i can do this to load information saved and store it into a variable:Code:System.startGameSave("Info", "Info", "Details",string_saved)
The fact is doesn't return anything.Code:loaded_data = System.startGameLoad()
Geändert von seanpaul223 (07-07-2009 um 08:47 AM Uhr)
00:00: Windows is loading...Come back tomorrow.
01:00 : Booting done.Not yet errors encountered...
01:10: Fatal error.Windows has been detected on logical drive
01:22: Keyboard Locked, try everything.
01:42 : Mouse Device Pilot not found, or uninstalled.Press Left-Bouton to continue.
01:50 : Ending User session.Do you want to play another game ?
01:59: Not enough memory.Only 508'312'583 bytes available.
02:00 : System is shutting Down.
-
07-07-2009, 06:51 AM #10061Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
I think those functions don't work in HM7 (bugged), though supposedly fixed in HMv2 but i can't confirm that.
-
07-07-2009, 07:45 AM #10062Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
no those ones actually work but when loading you need to pass the name that you gave to the sace i think it is the "info1" as you call it but i cant be sure of which one is the name for the save.
------ 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).
-
07-09-2009, 02:07 PM #10063
Achievements:
- Registriert seit
- Jul 2009
- Beiträge
- 12
- Points
- 1.695
- Level
- 23
- Downloads
- 0
- Uploads
- 0
Okay. this is probably the most noob post you will ever see. I want to code in Lua for the psp, but I have no clue where to start? I dont even know how to get Lua up and running, much less make a game with it.
Can anyone explain how to get lua to work, and direct me to a tutorial? thanks.Geändert von EYEko (07-09-2009 um 04:44 PM Uhr)
-
07-10-2009, 09:40 AM #10064Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
use pge lua player - luaplayer.org click pge then download it has instructions on how to install i think
pge lua hello world tutorial - my website modern-gamer.tk click on the link, ill make more eventually, if you have any suggestions then feel free to tell me.------ 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).
-
07-10-2009, 09:49 AM #10065Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
search programming in lua, lua manual, lua-wiki in google. Read & (hopefully) understand?
-
07-12-2009, 04:29 PM #10066QJ Gamer Blue
Achievements:
- Registriert seit
- May 2009
- Beiträge
- 106
- Points
- 2.716
- Level
- 31
- Downloads
- 0
- Uploads
- 0
i have a file browser and I need it to program runeboot when you choose a file.
I tried to run ext. = pbp but not working any ideas the browser is already fully functional just cant get the variable right to run chosen EBOOT.pbp. Im on LPHMv2 if it matters. Thanx in advance !!!!!!
-
07-12-2009, 04:42 PM #10067QJ Gamer Gold

- Registriert seit
- Nov 2008
- Ort
- CAD
- Beiträge
- 693
- Points
- 13.372
- Level
- 75
- Downloads
- 19
- Uploads
- 4
can you post your variables?
That epic dude.
-
07-12-2009, 04:55 PM #10068Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
use string.sub() to find end of filename i.e
if string.sub(listOfFiles[currentSelecter].name, -4) == ".pbp" then
-
07-12-2009, 05:23 PM #10069QJ Gamer Blue
Achievements:
- Registriert seit
- May 2009
- Beiträge
- 106
- Points
- 2.716
- Level
- 31
- Downloads
- 0
- Uploads
- 0
Here is my code Im working with. Its not the whole code but the part of the code that controls running the eboot.
It works and it looks like its gonna launch the eboot but then it takes you back to the XMB and you get the cannot run game error.
Thanks in advance ! ! !
if pad:cross() and not oldpad:cross() then
if not fbrowser.fl[fbrowser.s].directory then
if string.lower(string.sub(f browser.fl[fbrowser.s].name, -4)) == ".pbp" then
System.runeboot("ms0:/psp/game/'fbrowser.fl[fbrowser.s].name'/eboot.pbp")
end
elseif fbrowser.fl[fbrowser.s].directory then
System.currentDirectory(f browser.fl[fbrowser.s].name)
fbrowser.s = 1
fbrowser.fl=System.listDi rectory()
fbrowser.nf=table.getn(fb rowser.fl)
fbrowser.ls = 1
end
end
screen.waitVblankStart()
screen.flipscreen()
oldpad = pad
if pad:start() then break end
end
-
07-12-2009, 06:44 PM #10070Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
What game/app did you try to run?
-
07-12-2009, 08:37 PM #10071QJ Gamer Blue
Achievements:
- Registriert seit
- May 2009
- Beiträge
- 106
- Points
- 2.716
- Level
- 31
- Downloads
- 0
- Uploads
- 0
any and it wont work. Just always get the same error message. Any Ideas ??? Do you want me to paste the entire code?
-
07-13-2009, 09:14 AM #10072QJ Gamer Gold

- Registriert seit
- Nov 2008
- Ort
- CAD
- Beiträge
- 693
- Points
- 13.372
- Level
- 75
- Downloads
- 19
- Uploads
- 4
try this:
Code:System.runeboot(System.currentDirectory().."/"..fbrowser.fl[fbrowser.s].name)
That epic dude.
-
07-13-2009, 01:15 PM #10073QJ Gamer Blue
Achievements:
- Registriert seit
- May 2009
- Beiträge
- 106
- Points
- 2.716
- Level
- 31
- Downloads
- 0
- Uploads
- 0
No Dice. Ive tried all kinds of strings and still get the cannot run game error. I bet its something super simple 2 that im just overlooking. Any more ideas ?
-
07-13-2009, 02:11 PM #10074QJ Gamer Gold

- Registriert seit
- Nov 2008
- Ort
- CAD
- Beiträge
- 693
- Points
- 13.372
- Level
- 75
- Downloads
- 19
- Uploads
- 4
try somethin' like this:
just rename the variables' name to yours, it's just an example. you'll know how to put the right things into the right places;)Code:selection = 1 System.currentDirectory("ms0:") files = System.listDirectory() length = string.len(files[selection].name) name = string.sub(fichiers[selection].name , length - 3) if name == ".pbp" or name == ".PBP" then System.runeboot(System.currentDirectory().."/"..files[selection].name) endThat epic dude.
-
07-13-2009, 02:50 PM #10075QJ Gamer Blue
Achievements:
- Registriert seit
- May 2009
- Beiträge
- 106
- Points
- 2.716
- Level
- 31
- Downloads
- 0
- Uploads
- 0
thanx ill give it a shot in a while and i think it looks like it should work so ill let ya know ! ! !
-
07-13-2009, 03:37 PM #10076Lua 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 more or less the the same as your original method....also it's minus 4, there's 4 characters in .php
I think the problem had something todo with your cases. Nearly every eboot i've seen is in UPPER CASE
you had lower. Also even when you entered the directory i.e ms0:/...
you again used lower case. & AGAIN every psp i've seen went PSP/SOMETHING you had psp/something.
Most things are case sensitive and honestly i don't think this is any exception.
I'm no HM expert but its worth a try.
-
07-13-2009, 05:30 PM #10077QJ Gamer Blue
Achievements:
- Registriert seit
- May 2009
- Beiträge
- 106
- Points
- 2.716
- Level
- 31
- Downloads
- 0
- Uploads
- 0
ya i appreciate your help. Its actually my same browser i used in my psjournal program and im just altering it to run eboots so as far as the basic programming i already know its functional and running its just the runeboot system call thats having problems. Thanks to both of you for your help. Ill talk 2 u again soon and let u know how it goes !
-=Double Post Merge =-
Thank You Mootjeuh !!!!!! Your Idea got me thinkin and I was able to twist it around a bit and get it to work. Just like I said in the beginning. It was something super simple that I was just overlooking ! Thanks to both of you for takin the time to help. Talk to you guys soon!Geändert von thecraziness1 (07-13-2009 um 09:40 PM Uhr) Grund: Automerged Doublepost
-
07-14-2009, 04:21 AM #10078
Achievements:
- Registriert seit
- Jul 2009
- Beiträge
- 2
- Points
- 1.647
- Level
- 23
- Downloads
- 0
- Uploads
- 0
i cant code lol
-
07-14-2009, 04:22 AM #10079Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
some of your main problems seem to be that you dont understand the basic workings of the actual browser, seen as it is mostly identical to the one that Tactical_Penguin made that is probably why, if you searched into the functions that you are using and changed the variable names to somethingthat made sense to you then you would understand what was going on.
also lua is case sensitive with file names and function names.------ 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).
-
07-14-2009, 11:07 AM #10080Lua Coder

- Registriert seit
- Jan 2008
- Ort
- Iowa
- Beiträge
- 834
- Points
- 18.915
- Level
- 87
- My Mood
-
- Downloads
- 2
- Uploads
- 0
im working on a point and click game in lua, i have the d-pad set up so if you click it it changes the frame. I have this code:
the code allows me to click the dpad and it determines the next pic to blit, it works fine for the first 3 pics but wont blit the fourth.Code:if currentpic == 1 then if pad:left() and checkpad:left() ~= pad:left() and not pad:select() then currentpic = 2 end if pad:right() and checkpad:right() ~= pad:right() and not pad:select() then currentpic = 3 end end if currentpic == 2 then if pad:right() and checkpad:right() ~= pad:right() and not pad:select() then currentpic = 1 end if pad:left() and checkpad:left() ~= pad:left() and not pad:select() then currentpic = 4 end end if currentpic == 3 then if pad:left() and checkpad:left() ~= pad:left() and not pad:select() then currentpic = 1 end if pad:right() and checkpad:right() ~= pad:right() and not pad:select() then currentpic = 4 end end if currentpic == 4 then if pad:left() and checkpad:left() ~= pad:left() and not pad:select() then currentpic = 3 end if pad:right() and checkpad:right() ~= pad:right() and not pad:select() then currentpic = 2 end end
Spoiler for whole code if it helps:...


LinkBack URL
About LinkBacks
Mit Zitat antworten

rint(0,10, "Cursor.X = "..cursor.x, red)

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum