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; Zitat von Highsight I wish I could, but I don't have a miniUSB on hand. XD Could someone else try ...
-
12-28-2007, 11:55 AM #8221
System.listDirectory doesn't work on LuaPlayer for Windows.
Zitat von Highsight
[IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]
Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.
-
12-29-2007, 04:37 PM #8222Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
wanna bet i got it to work but as its on windows its relevant to your computer although after making it i realized it was useless unless your checking if ur file browser works
here is the code
sorry for the bad layout its from an old file browser that i coded discovering what the specific functions and variables do - i also looked at tp's code so credit to him for whatever i have used from his just to be safeCode:White = Color.new(255, 255, 255) Orange = Color.new(235, 115, 0) System.currentDirectory("C:\\") listitem = System.listDirectory() number = table.getn(listitem) current = 1 y = 10 oldpad = Controls.read() while true do pad = Controls.read() screen:clear() System.usbDiskModeActivate() if current > number then current = 1 end if current < 1 then current = number end for i = 1, number do screen:print(10, y * i, listitem[i].name, White) end screen:print(10, y * current, listitem[current].name, Orange) if pad:up() and oldpad:up() ~= pad:up() then current = current - 1 end if pad:down() and oldpad:down() ~= pad:down() then current = current + 1 end if pad:cross() and listitem[current].directory == false then if string.sub(listitem[current].name, -4) == ".lua" then screen:clear() dofile(listitem[current].name) end end if pad:cross() and oldpad:cross() ~= pad:cross() then System.currentDirectory(listitem[current].name) current = 1 listitem = System.listDirectory() number = table.getn(listitem) end if pad:triangle() and oldpad:triangle() ~= pad:triangle() then System.currentDirectory("\\") current = 1 listitem = System.listDirectory() number = table.getn(listitem) end if Controls.read():start() then break end oldpad = pad screen.waitVblankStart() screen.flip() end------ 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).
-
12-30-2007, 04:10 AM #8223QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
That's not correct, i just used it yesterday. It does work.
Zitat von Judas
[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]
-
12-30-2007, 04:17 AM #8224Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
as i also said you could use my code that is above with luaplayer windows
Zitat von HaxxBlaster
it allows you to browse your c drive but with simple changes any drive could be browsed
thanks ne wayGeändert von FaT3oYCG (12-30-2007 um 04:27 AM Uhr) Grund: Automerged Doublepost
------ 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).
-
12-31-2007, 10:20 AM #8225QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Does anyone know if there is a string function that can get you a letter in the string?
As in:
myString = "michaelp"
How do I access the letters? Just to find out what they are and to use them for printing?
Can you do this?
myString[1]?
-
12-31-2007, 10:30 AM #8226Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
what do you mean by accessing the letters to use them for printing
string.sub(string, start character, end character)
might be what your after but if you just wanted to print it why wouldn't you use
screen:print()
also check this out
Zitat von lua users wiki: tutorial directory - strings
http://lua-users.org/wiki/StringLibraryTutorialGeändert von FaT3oYCG (12-31-2007 um 10:45 AM Uhr)
------ 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).
-
12-31-2007, 01:14 PM #8227QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
You know how in C++, you can access a character in the string class by naming the string variable, then using this: []
string myString = michaelp;
myString[0]; would be m.
How can I do that same thing in LUA? Is there a string function for that?
-
01-01-2008, 05:09 PM #8228Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
for that you would have to use string.sub()
simple function
- im not sure you might have to use character + 1 for the second value as i haven't tested itCode:function findchar(string, character) string.sub(string, character, character) end
then to use
that should print the "m" but you can use it in any wayCode:myString = michaelp first_character = findchar(mystring, 0) screen:print(10, 10, first_character)
if you need an example script just ask and ill test it for you aswell------ 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).
-
01-01-2008, 05:19 PM #8229QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Okay, now that I know the function I got it.
Thanks. :)
-
01-01-2008, 05:40 PM #8230
fatboy:
*listDirectory in windows lua player is a DUMMY FUNCTION (its hardcoded)
*your "findchar" function returns nil, not a string
*myString = michaelp, you forgot quotes
If you don't know Lua well enough to teach it to others, I suggest you don't.牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
01-01-2008, 06:45 PM #8231lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Mr. youesam, I thought it was a good thing for noobs to help others?
Zitat von youresam
-
01-01-2008, 06:50 PM #8232
..not if they're giving misinformation. It just makes matters worse.
Zitat von Anti-QuickJay
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
01-01-2008, 07:09 PM #8233OMFG

- Registriert seit
- Jul 2005
- Ort
- Toronto
- Beiträge
- 2.814
- Points
- 19.453
- Level
- 88
- Downloads
- 0
- Uploads
- 0
annnd I think im going to have to agree with youresam on this matter.
Zitat von youresam
-
01-02-2008, 04:37 AM #8234Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
thanks for telling me about listdirectory but about my function as i said i hadnt tested it and only said that it should work
Zitat von youresam
as you pointed out it wouldnt because i forgot to put quotes in but that is simple to solve if i would have tested it then i would have found that error and it would work
other than that i can only say that i am not a noob when it comes to lua i have heard of your "superior", and "enlightened" coding skills so you may be better than me but that does not mean that everyone that is beneath you is a noob
i know that anti-quickjay said "I thought it was a good thing for noobs to help others?" but as you put it "..not if they're giving misinformation" implies that i am a noob
anyway i dont want to start any grudges so ill leave it there------ 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).
-
01-02-2008, 09:47 AM #8235
I'm not saying I'm "superior" to anyone, and I didn't call you a noob. I don't even know who you are, btw. I just saw how many mistakes you made on a single page of a lua help thread, and felt as if I should correct you.. thats all ;)
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
01-02-2008, 12:53 PM #8236lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
I was being sarcastic fyi >_>....
Zitat von Anti-QuickJay
-
01-04-2008, 12:02 PM #8237Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
question probably been asked before, but oh well. Is there a luaplayer version that works on the slim?
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
01-04-2008, 01:33 PM #8238Developer 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 thnk there was a ported version but not everything worked
Zitat von %chrono trigger%
if someone would care to mention which commands need to be changed to make it work on a slim i will change them
but i also thought that there were 1.00 releases made wouldnt they work on a slim i woulnt know because i havent bothered to try it
thanks------ 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).
-
01-04-2008, 02:19 PM #8239Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
i just tried v.20 and it wont work at all for me on a 3.71 m33-4 slim psp
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
01-04-2008, 02:27 PM #8240Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
ok my bad it looks like the lua players need changing to work on a slim mainly while compiling i just tried with 0.16 but i couldn't get it to work on my psp slim 3.71 m33-i forgot i haven't updated think its 2
lol
well until someone explains what needs changing i cant help you
there was definatley one ported version of luaplayer to 3.xx but i cant remember where i saw it or who it was from
a quick google search may return a few results
but i could try making 0.20 3.xx compatible ill give it a go for you now------ 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).
-
01-04-2008, 02:53 PM #8241lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Their was a version ported to M33.
Use LuaPlayer version .20(1.00) and out it in PSP/GAME
Fatboy: You cannot help him out anyways since you don't know C
-
01-04-2008, 02:54 PM #8242QJ Gamer Blue
- Registriert seit
- Apr 2007
- Ort
- The Netherlands
- Beiträge
- 104
- Points
- 3.617
- Level
- 37
- Downloads
- 0
- Uploads
- 0
I have a slim psp with 3.71 M33-4 firmware and luaplayer works fine for me :)
You must use luaplayer 0.20 (Firmware 1.00 ) , then you just put it in ms0:/PSP/GAME and it should work !
-
01-04-2008, 03:08 PM #8243Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
i thought this would help, but i cant get it to work oh well
http://dl.qj.net/LuaPlayer-for-Team-...4654/catid/151
edit
ok ill try the 1.00 version of lua player
edit
still not working wonder what the deal is**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
01-04-2008, 03:27 PM #8244Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
hey chrono i updated to m33-4 just and used that one that you linked too and it works for me now thanks i dont know why it wont work for you tho
make sure that in recover it is set to 3.71 kernel and that it is in psp/game/luaplayer------ 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).
-
01-04-2008, 04:04 PM #8245Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
i see what was the problem it was my game that i was making it wont run on 3.71 apparently or something. So that presents a new problem is there a guide or anyone know how to get it working for 3.71?
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
01-04-2008, 04:07 PM #8246lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
You set your kernel to 3.71 in the recovery menu?
-
01-04-2008, 04:08 PM #8247Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
yep
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
01-04-2008, 04:10 PM #8248lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Do you have the kernel add-on v2?
-
01-04-2008, 04:13 PM #8249Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
i didnt think that worked for a slim does it?
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
01-05-2008, 04:00 AM #8250Developer and Tutor.
- Registriert seit
- Jul 2007
- Ort
- Widnes, England
- Beiträge
- 1.649
- Points
- 8.736
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
chrono if you use the version that you directed to and put it in ms0:/PSP/GAME/HERE
Zitat von %chrono trigger%
then it works on a slim but you have to use that version of the lua player------ 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).


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