Zeige Ergebnis 91 bis 120 von 10238
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; .................
-
10-05-2005, 02:22 PM #91QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
..............
Geändert von Bilo (10-05-2005 um 03:38 PM Uhr)
-
10-05-2005, 03:20 PM #92
I am sorry to say that this one doent even display the text... i have noticed in whitehawks tutorial that he did it, so i am going to try and recreate that effect.
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
http://www.cools.biaklan.com
Currently Working on ?????
Quote of the Week
-
10-05-2005, 03:21 PM #93QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
Sorry, I hadnt even tried what I told you to do. The above WILL work. I tested it :)Code:board = Image.load("boardnew.png") screen:blit(0, 0, board, false) black = Color.new(0, 0, 0) screen:print(200, 130, "Board", black) screen.flip() while true do screen.waitVblankStart() end
My excuse is that I'm not well. And so thats why what I told you to do was wrong
Geändert von Bilo (10-05-2005 um 03:48 PM Uhr)
-
10-05-2005, 04:05 PM #94
Thanks! It works perfectly! :icon_smil
Geändert von cools (10-05-2005 um 04:42 PM Uhr)
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
http://www.cools.biaklan.com
Currently Working on ?????
Quote of the Week
-
10-05-2005, 04:43 PM #95
I've commeted your program to help you find out why it was doing what it was doing..
Zitat von cools
-
10-05-2005, 04:46 PM #96
Thanks Jenay. Hopefully this will not happen again!
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
http://www.cools.biaklan.com
Currently Working on ?????
Quote of the Week
-
10-05-2005, 04:49 PM #97QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- In your garage
- Beiträge
- 73
- Points
- 4.648
- Level
- 43
- Downloads
- 0
- Uploads
- 0
Zitat von cools
No problem :)
-
10-05-2005, 05:10 PM #98NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Wow that took me a while...
Zitat von Dremth
Ok put keyboard.lua (rename it to that) in the same file as your main code.
Then put this in your main code:
When you want define a variable or print something you can define the variable or what it's printing as keyboard()Code:dofile("keyboard.lua")
This will allow you to input what it is going to register the value as.Code:-- Examples print(keyboard()) thetext = keyboard()
=================
Start - Enter Value
D-pad - select key
R - Space
L - Delete
Select - Like holding down shift
Control pad - Press the button corresponding with the character on the selected key
================
I've tested it and it seems to work on luaplayer v9 but not v11Geändert von MagicianFB (10-05-2005 um 05:18 PM Uhr)
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-05-2005, 05:58 PM #99
- Registriert seit
- Oct 2005
- Beiträge
- 3
- Points
- 4.399
- Level
- 42
- Downloads
- 0
- Uploads
- 0
I'm having a bit of trouble with the Timer function.
Using this as code:
I get:Code:Timer = Timer.new(0)
Thanks in advance for any help.Code:error: DEFUSE.LUA:27: attempt to index global 'Timer' (a nil value) Error: No script file found. Press start to restart
-
10-05-2005, 05:59 PM #100NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
It's Timer:new(0)
Zitat von goldnetx
You have to use a colon."15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-05-2005, 07:12 PM #101
- Registriert seit
- Oct 2005
- Beiträge
- 3
- Points
- 4.399
- Level
- 42
- Downloads
- 0
- Uploads
- 0
Hm...I've got the timer now working, but I'm having another problem with it.
If I run the program once it works fine, but once I try and run it a second time I get this error:
The code I have at Line 152 is this:Code:error: DEFUSE.LUA:152: loop in gettable Error: No script file found. Press start to restart
Code:Timer:start()
-
10-06-2005, 06:49 AM #102
MagicianFB, can you tell a little about your rpg? Are you just using screen sized backgrounds or can you do the scrolling bg most rpgs have?
I'm interested in doing an rpg myself, and since there seems to be no rpg maker in site for psp, I'm learning lua now. It'd be nice to hear a little about your project so I have a general idea of how to get started.
Also, this may be a little advanced, but would there be a way to display some sort of fmv? I'm not expecting to be able to do a Final Fantasy or something as my very first project, but it seems like with the psp's power it shouldn't be a problem to have decent looking backgrounds and even a movie or two, right? Is there maybe a way for your lua script to make calls to the psp firmware functions? Like to use the psp's built in mp4 or mp3 playback? Or is that something that would need to be built into the actual lua player?Geändert von Snaku (10-06-2005 um 06:59 AM Uhr)
-
10-06-2005, 07:34 AM #103
Can u make lua loop this kind of code?
Code:pad = Controls.read() if pad:circle() then screen:blit(0, 0, lua, false) screen:print(220, 170, "Fel", svart) screen:print(220, 190, "Triangel: Tillbaka", svart) screen:print(220, 210, "[]: Avsluta", svart) screen.flip() while true do jag = Controls.read() if jag:triangle() then screen:blit(0, 0, lua, false) screen:print(220, 170, "Hejsan", svart) screen:print(220, 190, "O: Nåt trevligt", svart) screen:print(220, 200, "X: Info", svart) screen:print(220, 210, "[]: Avsluta", svart) screen.flip() end end
-
10-06-2005, 07:44 AM #104NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Just put a while true loop around the entire thing, too
I'm posting from school
Zitat von lingon
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-06-2005, 08:12 AM #105
Okay, thanks alot.
-
10-06-2005, 11:18 AM #106Developer

- Registriert seit
- Sep 2005
- Ort
- Sweden
- Beiträge
- 941
- Points
- 10.075
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Does anyone know how I can change a number to the numer-1 or +1 with the triggers (or any button) like in PSP Soduko?? So if I program a button to insert a 5 or any numer in 1, 1, then how can i change the 5 to go +1 each time I press the right trigger?
-
10-06-2005, 11:56 AM #107
something like this?Code:if pad:r() then if var >= 5 then var = var + 1 else var = 5 end -- if end -- if
-
10-06-2005, 12:21 PM #108Developer

- Registriert seit
- Sep 2005
- Ort
- Sweden
- Beiträge
- 941
- Points
- 10.075
- Level
- 67
- Downloads
- 0
- Uploads
- 0
I only get this error when I use your code: "attempt to comprare number with nil"
Zitat von Jenay
-
10-06-2005, 12:38 PM #109
- Registriert seit
- Oct 2005
- Beiträge
- 6
- Points
- 4.421
- Level
- 42
- Downloads
- 0
- Uploads
- 0
hi im new to the whole modding a psp thing... im from england and just downgraded my firmware and started to learna bit of lua
heres the code of my first program (after that tutorial):
im not sure if its going the right way to making a cursor move on the screen, ive had experience with java and things but all i get is an error that reads:System.usbDiskModeActivat e()
cursor = Image.load("cursor.png")
x = 200
y = 140
screen.waitVblankStart()
while true do
pad = Controls.read()
if pad:analogX() < -30
then x = x - 1 end
if pad:analogx() > 30
then x = x + 1 end
if pad:analogy() < -30
then y = y - 1 end
if pad:analogy() > 30
then y = y + 1 end
if pad:start()
then break end
screen:blit(x, y, cursor)
screen.flip()
end
help will be appreciated :Jump:error: SCRIPT2.LUA18 loop in gettable
-
10-06-2005, 12:52 PM #110
Maybe it has something to do with this
I'm not sure though. Try it out and see what happens =)Code:if pad:analogy() < -30 --I think you should have a big Y here instead of a small one then y = y - 1 end if pad:analogy() > 30 then y = y + 1 end
-
10-06-2005, 12:54 PM #111NDS Mod
- Registriert seit
- Jul 2005
- Ort
- w00+land
- Beiträge
- 645
- Points
- 18.386
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Yeah, I've never programmed using the analog stick, but I think you're right. It has to be analogX and analogY rather that analogx and analogy.
Zitat von lingon
Edit: It make me sorta happy that this thread has lasted so long without being stickied.
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
-
10-06-2005, 12:57 PM #112
- Registriert seit
- Oct 2005
- Beiträge
- 6
- Points
- 4.421
- Level
- 42
- Downloads
- 0
- Uploads
- 0
ah... you were both right... lol capitilization errors.... always the way
thanks
-
10-06-2005, 12:59 PM #113
Im having some trouble creating dice. I just want to show the random number in a spot, then get rid of it, but i keep getting an error.
Code:while true do pad = Controls.read() dice2 = math.random(6) if pad:cross() then if dice2==1 then screen:print(90, 50, "1", black) screen.flip() if dice2==2 then screen:print(90, 50, "2", black) screen.flip() if dice2==3 then screen:print(90, 50, "3", black) screen.flip() if dice2==4 then screen:print(90, 50, "4", black) screen.flip() if dice2==5 then screen:print(90, 50, "5", black) screen.flip() if dice2==6 then screen:print(90, 50, "6", black) screen.flip() screen.waitVblankStart() end end
PSP Monopoly | PSP Tic Tac Toe | PSP eMail and SMS | Drag Mini | Block Dude
http://www.cools.biaklan.com
Currently Working on ?????
Quote of the Week
-
10-06-2005, 02:25 PM #114Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Use elseif statements.
Zitat von cools
Geändert von Twenty 2 (10-06-2005 um 02:36 PM Uhr)
F.A.L.O?
-
10-06-2005, 02:50 PM #115
- Registriert seit
- Oct 2005
- Beiträge
- 6
- Points
- 4.421
- Level
- 42
- Downloads
- 0
- Uploads
- 0
can anybody tell me how to set transparency colour for the pngs, e.g i want to make the edges of a cursor transparent
thanks
-
10-06-2005, 02:54 PM #116Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
If you use fireworks then you set the canvas to transparent and draw on to it.
F.A.L.O?
-
10-06-2005, 03:20 PM #117
put:
Zitat von SodR
var = 0
at the begining of your code.
-
10-06-2005, 03:26 PM #118
Zitat von cools
try something like this.Code:while true do pad = Controls.read() dice2 = math.random(6) if pad:cross() then screen:print(90, 50,string.format("%d", dice2), black) screen.flip() screen.waitVblankStart() end end
-
10-06-2005, 03:44 PM #119Developer

- Registriert seit
- Jun 2005
- Ort
- At my house...
- Beiträge
- 886
- Points
- 8.360
- Level
- 61
- Downloads
- 0
- Uploads
- 0
You might actually want to try
I changed the color so you could actualy see the number and I added a screen clear so that it doesnt print over it self so you cant read it.Code:blue = Color.new(0, 0, 225) while true do pad = Controls.read() dice2 = math.random(6) if pad:cross() then screen:clear() screen:print(90, 50,string.format("%d", dice2), blue) screen.flip() screen.waitVblankStart() end end
F.A.L.O?
-
10-06-2005, 03:48 PM #120
Can lua load .mp3 files?


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