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; You've got the general method correct, but if you wanna get rid of the offset for the . and .. ...
-
03-13-2007, 05:31 AM #6061QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
You've got the general method correct, but if you wanna get rid of the offset for the . and .. directories, just add table.remove(files,1) table.remove(files,1) so that it gets rid of them and do it without the offset and count crap.
-
03-13-2007, 03:04 PM #6062QJ Gamer Blue
- Registriert seit
- Dec 2006
- Beiträge
- 347
- Points
- 5.056
- Level
- 45
- Downloads
- 0
- Uploads
- 0
im making a personal lua flasher (key word = PERSONAL), and i want to incorporate extra checks before and after i flash the file. for example, lets say i try to flash an .rco and the filesize was supposed to be 242 kb, but the custom one being flashed is only 200 kb. i want the script to refuse to flash the file.
i'm sure this is pretty simple, but ive never had to do this before.
-
03-13-2007, 09:44 PM #6063.info

- Registriert seit
- Jun 2006
- Ort
- ACT, Australia
- Beiträge
- 1.674
- Points
- 15.395
- Level
- 80
- Downloads
- 0
- Uploads
- 0
Read the post just above for the method of getting file size and then once youve got that make a function like
if filesize(rco) then
-- flash file
else
-- error
end
-
03-14-2007, 11:18 AM #6064QJ Gamer Blue
- Registriert seit
- Dec 2006
- Beiträge
- 347
- Points
- 5.056
- Level
- 45
- Downloads
- 0
- Uploads
- 0
ok thanks, didnt read the posts above.
EDIT: also, the filesize will be in bytes, right?
-= Double Post =-
one more question - how would you check the free space of flash0?
thanks for the help.
EDIT2: aahhh, another question - make that 2. first of all, with the new flash luaplayer, i get errors of iounassign, ioassign, etc, even in SG57's example. however, SG57's example worked, regardless. How can i fix these errors? i dont want luaplayer to be having errors as i'm flashing...
2nd question - luaplayer gives me the error that on line 91, it cannot find 'ms0:/wavebackup/', no script file found. Here is the line of code:
this line of code is after i re-assign flash0. i tried replacing "ms0:/wavebackup/" with "ms0:/wavebackup/system_plugin_bg.rco.back up" but i still get the same error - luaplayer can't find the script "ms0:/wavebackup/system_plugin_bg.rco.back up".Code:System.writeFile("flash0:/vsh/resource/system_plugin_bg.rco","ms0:/wavebackup/","no")
i would appreciate the answer as well as an explanation as to why luaplayer is looking for a script in this line of code.
Thanks again and sorry for so many questions.Geändert von parm289 (03-14-2007 um 01:51 PM Uhr) Grund: Automerged Doublepost
-
03-14-2007, 04:58 PM #6065words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
parm - There is no io.Assign or io.Unassign.
There is System.Assign and System.Unassign ;)
As for your writeFile error, the second parameter ('destination file') isnt the destination folder, but the destination file. So...
That s what u want (note, you can change it from dumped_wave.rco to whatever.)Code:System.writeFile("flash0:/vsh/resource/system_plugin_bg.rco","ms0:/wavedump/dumped_wave.rco","no")
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
03-14-2007, 05:45 PM #6066QJ Gamer Blue
- Registriert seit
- Dec 2006
- Beiträge
- 347
- Points
- 5.056
- Level
- 45
- Downloads
- 0
- Uploads
- 0
thanks, i figured the destination thing out and hit myself on the head.
as for the other part of your post, it isnt what u think is happening. when i exit any app by using the home button, a bunch of huge text pops up saying things like "io.assign p_kl: error_" and i was wondering what was happening in luaplayer. id feel much safer if no errors popped up, ya know what i mean?Geändert von parm289 (03-14-2007 um 05:46 PM Uhr) Grund: typos...
-
03-14-2007, 06:57 PM #6067words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
parm - That happens on all versions of lua player. Its the deinitialization of various libraries (mikmod mainly). Try it on a different version and youll see the same thing ;)

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
03-15-2007, 06:43 AM #6068QJ Gamer Blue
- Registriert seit
- Jul 2006
- Ort
- United Kingdom
- Beiträge
- 63
- Points
- 4.509
- Level
- 42
- Downloads
- 0
- Uploads
- 0
Does anyone know what the exit code is in Lua player 20 in 16 it was
os.exit()
doesnt work in 20. Whats the 20 exit code
Thanks
-
03-15-2007, 08:44 AM #6069Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
try break ?
-
03-15-2007, 09:49 AM #6070Ponies and Unicorns
- Registriert seit
- Aug 2006
- Ort
- Pelennor Fields
- Beiträge
- 547
- Points
- 5.778
- Level
- 49
- Downloads
- 0
- Uploads
- 0
break from what i understand in c++ and im assumming its the same in lua will just exit the loop. but it might work
you can try System.Quit() or whatever. but i think thats only in the mod one.If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
Gold donations are highly appreciated!
-
03-15-2007, 09:59 AM #6071
There is no exit code. os.exit() just returns the value you give it (ex: os.exit(1)) to the parent process what executed it.
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
03-15-2007, 10:00 AM #6072Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
youresam will break work ?
zomg look at your points !
-
03-15-2007, 11:14 AM #6073QJ Gamer Blue
- Registriert seit
- Dec 2006
- Beiträge
- 347
- Points
- 5.056
- Level
- 45
- Downloads
- 0
- Uploads
- 0
SG57 - thanks for the info, i hadnt seen it before.
-
03-15-2007, 11:27 AM #6074Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Would it be feasible to make curveball in lua for someone of my programming ability ?
-
03-15-2007, 11:53 AM #6075Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
3d? maybe. im working on a port of curveball right now, and its not too challenging, but curving is complicated.
Zitat von eldiablov
--------------------------------------------------------------------------------------
-
03-15-2007, 07:40 PM #6076words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Grimfate - What about Assualt, Space Escape, etc.?

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
03-15-2007, 08:01 PM #6077
Break just exits the current loop, be it while or for.
Zitat von eldiablov
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
03-15-2007, 09:03 PM #6078QJ Gamer Gold
- Registriert seit
- Aug 2006
- Ort
- Under Your Bed
- Beiträge
- 3.083
- Points
- 12.189
- Level
- 72
- Downloads
- 0
- Uploads
- 0
os.exit() is the exit code for Shines luaplayer, but the mods use System.Quit(). Find out what luaplayer your using and that should fix everything.
-
03-15-2007, 09:08 PM #6079
...........
Zitat von xpack
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
03-16-2007, 06:37 AM #6080QJ Gamer Green
- Registriert seit
- Jan 2007
- Ort
- beside my PC
- Beiträge
- 520
- Points
- 6.446
- Level
- 52
- Downloads
- 0
- Uploads
- 0
hi can anyone give me an idea to show image in the screen screen like credits while loading the app?
lets say something like a credit and name of the app will stay 3 secs then go to the main app...
thx in advance
-
03-16-2007, 06:53 AM #6081Ponies and Unicorns
- Registriert seit
- Aug 2006
- Ort
- Pelennor Fields
- Beiträge
- 547
- Points
- 5.778
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Start a timer then blit the image and text according to the timer. I could write some code but its your game/app so Im sure you want to. lol (too lazy)
If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
Gold donations are highly appreciated!
-
03-16-2007, 06:58 AM #6082QJ Gamer Green
- Registriert seit
- Jan 2007
- Ort
- beside my PC
- Beiträge
- 520
- Points
- 6.446
- Level
- 52
- Downloads
- 0
- Uploads
- 0
hmmm i there a tut for that?
i dunno about the blit thing..
i know how to use the timer
thx
-
03-16-2007, 07:53 AM #6083
Image.blit(target,x,y,ima ge)
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
03-16-2007, 09:36 AM #6084
Hi
can anybody help me with this coding, if X pressed image upload.
I have tryed this but doesn't work.
code:
if pad:cross () then
image.load("image.png")
_________________________ _
But that doesn't work
-
03-16-2007, 09:51 AM #6085
you don't need a timer.
just do:
the 60 there can be changed to any number to wait longer or shorterCode:screen:clear() screen:blit(0,0,backgroundimage) screen.watiVblankStart(60)
-= Double Post =-
two things. first you need to assign that image to a variable. Also, the 'i' in image.load needs to be uppercase. heres what you should have:
Zitat von playstationpod
Code:variablename = Image.load("image.png")Geändert von emericaska8r (03-16-2007 um 09:55 AM Uhr) Grund: Automerged Doublepost
-
03-16-2007, 10:04 AM #6086QJ Gamer Green
- Registriert seit
- Jan 2007
- Ort
- beside my PC
- Beiträge
- 520
- Points
- 6.446
- Level
- 52
- Downloads
- 0
- Uploads
- 0
thx but...
Zitat von emericaska8r
hmm how do i load the image?
srry
-
03-16-2007, 10:05 AM #6087Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
bla = Image.load("image.extensi on")
-
03-16-2007, 10:16 AM #6088QJ Gamer Green
- Registriert seit
- Jan 2007
- Ort
- beside my PC
- Beiträge
- 520
- Points
- 6.446
- Level
- 52
- Downloads
- 0
- Uploads
- 0
screen:clear()
screen:blit(0,0,backgroundimage) <-----ill leave this alone? or should i put the filename?
screen.watiVblankStart(60 )
-= Double Post =-
hmm it wont load load
Geändert von ai3gtmc (03-16-2007 um 10:20 AM Uhr) Grund: Automerged Doublepost
-
03-16-2007, 10:27 AM #6089
Guys remember that lua uses variables and OOP.
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
03-16-2007, 10:31 AM #6090QJ Gamer Green
- Registriert seit
- Jan 2007
- Ort
- beside my PC
- Beiträge
- 520
- Points
- 6.446
- Level
- 52
- Downloads
- 0
- Uploads
- 0
hmmm i feel out of place lol...
-= Double Post =-
This is my code:
I get errorsCode:screen:clear() screen.watiVblankStart(180) backgroundimage = Image.load("credits.png") screen:blit(0,0, backgroundimage)Geändert von ai3gtmc (03-16-2007 um 10:34 AM Uhr) Grund: Automerged Doublepost


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