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; try this: Code: ----joke white= Color.new(225,225,225) brick=Image.load("Smile.png") ------ end load while true do screen:print(10, 10, "Opening Flash0", white) screen.waitVblankStart(12 0) ...
-
04-15-2006, 09:59 AM #1591Developer

- Registriert seit
- Mar 2006
- Ort
- Isle of Wight
- Beiträge
- 491
- Points
- 12.360
- Level
- 72
- Downloads
- 0
- Uploads
- 0
try this:
Code:----joke white= Color.new(225,225,225) brick=Image.load("Smile.png") ------ end load while true do screen:print(10, 10, "Opening Flash0", white) screen.waitVblankStart(12 0) screen:print(10, 20, "Cant Open... Starting Brute Force", white) screen.waitVblankStart(120) screen:print(10, 25, "jfklafdjoaiudfjkfdajklfda fdjlkadfkl", white) screen.waitVblankStart(10) screen:print(10, 35, "9803418093147893124891327 48913298478913", white) screen.waitVblankStart(10) screen:print(10, 40, "3249020234230432040234902 34023943204932", white) screen.waitVblankStart(5) screen:print(10, 50, "Flash0 Open.. Shuting Down will cuas a brick.", white) screen.waitVblankStart(20) screen:print(10, 60, "Flash0:/vsh is being delited", white) screen.waitVblankStart(60) screen:print(10, 70, "There you Go Bricked PSP", white) screen.waitVblankStart(5) screen:print(10, 80, "Enjoy By-By now", white) screen.waitVblankStart(30 ) screen.flip() end
-
04-15-2006, 10:02 AM #1592Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
nope still shows no text

-
04-15-2006, 10:06 AM #1593Developer

- Registriert seit
- Mar 2006
- Ort
- Isle of Wight
- Beiträge
- 491
- Points
- 12.360
- Level
- 72
- Downloads
- 0
- Uploads
- 0
Ok try this:
Code:----joke white= Color.new(225,225,225) brick=Image.load("Smile.png") ------ end load function print() screen:print(10, 10, "Opening Flash0", white) screen.waitVblankStart(12 0) screen:print(10, 20, "Cant Open... Starting Brute Force", white) screen.waitVblankStart(12 0) screen:print(10, 25, "jfklafdjoaiudfjkfdajklfda fdjlkadfkl", white) screen.waitVblankStart(10 ) screen:print(10, 35, "9803418093147893124891327 48913298478913", white) screen.waitVblankStart(10 ) screen:print(10, 40, "3249020234230432040234902 34023943204932", white) screen.waitVblankStart(5) screen:print(10, 50, "Flash0 Open.. Shuting Down will cuas a brick.", white) screen.waitVblankStart(20 ) screen:print(10, 60, "Flash0:/vsh is being delited", white) screen.waitVblankStart(60 ) screen:print(10, 70, "There you Go Bricked PSP", white) screen.waitVblankStart(5) screen:print(10, 80, "Enjoy By-By now", white) screen.waitVblankStart(30 ) while true do print() screen.flip() end
-
04-15-2006, 10:28 AM #1594
there should be screen.flips after each different piece of text otherwise it only shows all the text but only after all the screen.waitVblanckStart() 's are done, so after about 8 seconds. The one of Masta shaker should work (i took a quick look though).
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
04-15-2006, 11:00 AM #1595Developer

- Registriert seit
- Mar 2006
- Ort
- Isle of Wight
- Beiträge
- 491
- Points
- 12.360
- Level
- 72
- Downloads
- 0
- Uploads
- 0
You could justput screen:clear() before any of the text.
-
04-15-2006, 11:03 AM #1596
- Registriert seit
- Apr 2006
- Beiträge
- 17
- Points
- 4.107
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Background info:
Using LUA Player v.16, 2.6 Firmware, GTA Exploit - eLoader 0.9.7 - Bock (alternate "no cache" version)
Question:
Every time I add "System.usbDiskModeActiva te()" to my LUA scripts, they cause Lowser to freeze when I load those scripts within Lowser. Even when I try to toggle USB mode in Lowser, it causes Lowser to freeze. Does this mean that I have to enter USB mode in XMB (original PSP menu) to edit the lua script file and then reload GTA (and then the eloader) every time I want to edit my lua scripts? Is there an easier way?Geändert von dragaron (04-15-2006 um 11:06 AM Uhr)
-
04-15-2006, 11:07 AM #1597Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
yes, becuase 2.1+ does not allow kernal, which is needed for USB mode. just use luaplayer for windows which can be found at luaplayer.org
Zitat von dragaron
--------------------------------------------------------------------------------------
-
04-15-2006, 11:11 AM #1598
- Registriert seit
- Apr 2006
- Beiträge
- 17
- Points
- 4.107
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Thanks for the reply. The problem I have with luaplayer for windows is that there is no way (that I know of) to recognize analog input.
Zitat von Grimfate126
- keyboard mapping:
SELECT = a
START = s
LTRIGGER = q
RTRIGGER = w
TRIANGLE = r
CIRCLE = f
CROSS = c
SQUARE = d
directional pad = cursor keys
-
04-15-2006, 12:19 PM #1599Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
error: Elchika.lua:13: loop in gettable
here is line 13screen:blit( 480, 272, Rock1,480,272,Rock1:width () , Rock1:hight())
-
04-15-2006, 12:23 PM #1600
well you do have height spelled incorrectly
-
04-15-2006, 12:24 PM #1601Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
ty lol

-
04-15-2006, 12:45 PM #1602<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
are u still getting that error??
Zitat von MaSt3r_ShAk3
if your using an eboot that doesnt have that function included, you will get that error,,
try using lua player,,
-
04-15-2006, 01:07 PM #1603Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
i got the image to load but i dont see the text that is to be seen when you press a botton. it worked before the image worked

-
04-15-2006, 01:36 PM #1604Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
if I have text abouve a pic. do i need the screen.waitVblankStart()
here is an ex. of the scropt
here is the pickit runsscreen:blit( 0, 0, Rock1,0,0,Rock1:width () , Rock1:height(), true)
screen.flip()
end
this is the buttons i do have valus for the keys
if pad:l() then
screen
rint(15,252,L,red)
end
if pad:up() then
screen
rint(15,252,up,red)
end
if pad:triangle() then
screen
rint(15, 252, triangle, red)
end
if pad:circle() then
screen
rint(15, 252, circle, red)
end
if pad:cross() then
screen
rint(15, 252, cross, red)
end
if pad:square() then
screen
rint(15, 252, square, red)
end
screen.waitVblankStart()
screen.flip()
end
-
04-15-2006, 01:41 PM #1605Developer

- Registriert seit
- Mar 2006
- Ort
- Guadalajara
- Beiträge
- 958
- Points
- 7.499
- Level
- 57
- Downloads
- 0
- Uploads
- 0
Does the eloader support the new luaplayer??

Current projects:
- pspshootoutsv0.4
- PSPIRATESv6 :D
- Kindom Hearths: Sora´s Adventure V0.2
- PSPirates Alarm Clock v0.3
- Changos!: fall of the army-ITS ALIVE AND WORKING (coming soon)
PSPMEX DevTeam.
-
04-15-2006, 01:43 PM #1606Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
i am fw 1.5

-
04-15-2006, 01:51 PM #1607Developer

- Registriert seit
- Mar 2006
- Ort
- Isle of Wight
- Beiträge
- 491
- Points
- 12.360
- Level
- 72
- Downloads
- 0
- Uploads
- 0
No. Only .16 and below.
-
04-15-2006, 01:53 PM #1608Developer

- Registriert seit
- Mar 2006
- Ort
- Guadalajara
- Beiträge
- 958
- Points
- 7.499
- Level
- 57
- Downloads
- 0
- Uploads
- 0
thanx!!!
Zitat von kozine

Current projects:
- pspshootoutsv0.4
- PSPIRATESv6 :D
- Kindom Hearths: Sora´s Adventure V0.2
- PSPirates Alarm Clock v0.3
- Changos!: fall of the army-ITS ALIVE AND WORKING (coming soon)
PSPMEX DevTeam.
-
04-15-2006, 01:55 PM #1609Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
how should i get the Text to go above the pick , and ty guys ur all so grate

-
04-15-2006, 02:33 PM #1610Jesus loves me more.
- Registriert seit
- Mar 2006
- Ort
- Illegal Abric Sites
- Beiträge
- 1.551
- Points
- 11.452
- Level
- 70
- Downloads
- 0
- Uploads
- 0
i have tryed making where the text appers on the pick trasnparent any one know a way to get around that?

-
04-15-2006, 03:21 PM #1611QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
Hey i get the error
attempt to index a global 'mouse' <a userdata value>
what does that mean?
-
04-15-2006, 06:05 PM #1612QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
Hey everyone I'm making a game where you simply train a monster digimon/tamagotchi style and want to ask, how would I put a save/load function in? I have no idea.
-
04-15-2006, 06:06 PM #1613Quality Haxing Since 1991
- Registriert seit
- Oct 2005
- Ort
- Pennsylvania, USA Fi
- Beiträge
- 6.206
- Points
- 29.255
- Level
- 99
- Downloads
- 0
- Uploads
- 0
The best way to do it would be to write the data to a file. It can be any file, LUA or TXT file, and you can write and overwrite data to it. The best tutorial for this can be found here: http://www.evilmana.com/tutorials/lua_tutorial_09.php
Zitat von PopcOrn DeVil
Zitat von Noriko
-
04-15-2006, 06:07 PM #1614QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
Ok thanks dude.
-
04-15-2006, 06:56 PM #1615
could anyone here come up with a good AI program?...is it possible on LUA? (i'm not asking you to do it, i'm asking if you're able to do it)
edit: also, is there a switch function? like say a = 1 and b = 2, and now i want a = 2 and b = 1, but it must simultaneously because a can't equal b.Geändert von ro0kie42 (04-15-2006 um 07:11 PM Uhr)
-
04-15-2006, 07:16 PM #1616Quality Haxing Since 1991
- Registriert seit
- Oct 2005
- Ort
- Pennsylvania, USA Fi
- Beiträge
- 6.206
- Points
- 29.255
- Level
- 99
- Downloads
- 0
- Uploads
- 0
For your first question, yes AI is very possible with a basic rewrite of the code, with a bunch of if statements. and for your second question i sort of answered it on AIM right now.
Zitat von ro0kie42
Zitat von Noriko
-
04-15-2006, 07:57 PM #1617QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
Hey I don't see how that would help with loading data into a game like your pet's health/mood etc.
Zitat von PSPHax0r9
-
04-16-2006, 05:30 AM #1618<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
lets say your dude has 100% health, then he hurts himself or somethin,,now his health is 90%,, then when you save you wright in the file "player.health" or "health.txt" whatever you want to call it,, 90,,
Zitat von PopcOrn DeVil
then the next time you open your game, you call that file for the health,, and now your pet has 90 health,,
-
04-16-2006, 06:02 AM #1619QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
*puzzled*, hmm, I might just wait for someone to release a loading type thing and I'll learn from that.
-
04-16-2006, 07:38 AM #1620
its pretty simple if you follow the tutorial. You can almost copy past it, just adjust the var it writes to the file. Besides if someone else will have a loading function it will be the same anyways
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]


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