Zeige Ergebnis 2.611 bis 2.640 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; What is a nil value in LUA. Sorry I am still learning LUA...
-
06-07-2006, 08:37 PM #2611QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Illinois
- Beiträge
- 897
- Points
- 8.215
- Level
- 61
- Downloads
- 0
- Uploads
- 0
What is a nil value in LUA.
Sorry I am still learning LUA
-
06-07-2006, 08:40 PM #2612QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Illinois
- Beiträge
- 897
- Points
- 8.215
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Can someone also give me an example of how to load a ttf font and display it also.
-
06-08-2006, 04:35 AM #2613QJ Gamer Bronze
- Registriert seit
- May 2005
- Beiträge
- 159
- Points
- 6.356
- Level
- 52
- Downloads
- 0
- Uploads
- 0
im trying to make a maze in lua.. like a oldschool one.. like this
http://sinai.critter.net/gallery/blakat-maze.gif
i would like to have the joystick be a image.. and i would like to make it detect when i hit a black line on the maze.. whats the best way to go about that? thanks for your help!╔══════════════╗
║PSParty Supporter║
╚══════════════╝
-
06-08-2006, 06:17 AM #2614QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
I think its either one of two things.Code:function check(dummy) if dummybb[1].x + 49 >= house1x and dummybb[1].x + 49 <= house1x + 21 and dummybb[1].y + 20 >= house1y and dummybb[1].y <= house1y + 20 and tile1show1a == 1 then dummybb[1].go = false tile1show1a = 2 end if tile1show1a >= 2 then screen:fillRect(house1x, house1y, 21, 21, blue) screen:blit(house1x, house1y, house1R) end
and/orCode:function check(dummy) -- nowhere in your function does it mention "dummy" again
Code:tile1show1a = 2 end if tile1show1a >= 2 then -- turn ">=" into "==" screen:fillRect(house1x, house1y, 21, 21, blue) screen:blit(house1x, house1y, house1R)
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
06-08-2006, 12:11 PM #2615QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
Zitat von EminentJonFrost
Its def. not the second part.
I tried something and now i get
Code:error:attempt to index field '?' <a nil value>
anyone know what that means?
-
06-08-2006, 02:17 PM #2616QJ Gamer Gold
- Registriert seit
- Mar 2006
- Ort
- LOLWUT
- Beiträge
- 2.625
- Points
- 18.627
- Level
- 86
- Downloads
- 0
- Uploads
- 0
A nil value is a variable that you haven't declared yet. Example:
Zitat von cwirsing
You haven't declared bob yet, if you put bob = 1 above while true do, you declared it and the program can perform functions on it.Code:red = Color.new(255,0,0) while true do screen:clear() pad = Controls.read() if pad:up() then bob = bob + 1 --This would return an error saying that the program is trying --to execute an arthimetic function on a nil value. end screen.waitVblankStart() screen.flip() end
--PSPduh
-
06-09-2006, 02:32 AM #2617
Also, nil means that is has no value at all, nothing.
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
06-09-2006, 02:38 AM #2618QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
Who unstickied this?
-
06-09-2006, 02:47 AM #2619QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
As you might see, there is a thread called "Programming help" which is stickied, the "Lua help thread" is linked from there.
Zitat von PopcOrn DeVil
New Developers! *READ*[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]
-
06-09-2006, 02:48 AM #2620sceKernelExitGame();
- Registriert seit
- Jan 2006
- Ort
- New York
- Beiträge
- 3.126
- Points
- 19.955
- Level
- 89
- Downloads
- 0
- Uploads
- 0
yeah, this is all serideths doing ;)
Zitat von PopcOrn DeVil
-
06-09-2006, 03:21 AM #2621QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
why un-sticky this? its used so often it just doesnt make sense to me to make it harder to find.
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
06-09-2006, 04:46 AM #2622QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Read what i wrote.
[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]
-
06-09-2006, 04:52 AM #2623QJ Gamer Bronze
- Registriert seit
- Jan 2006
- Ort
- Western Australia
- Beiträge
- 1.046
- Points
- 8.803
- Level
- 63
- Downloads
- 0
- Uploads
- 0
I prefer it just being up the top than just clicking on a thread then getting the link to go here...
-
06-09-2006, 09:46 AM #2624QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
answer please
Zitat von montrob
-
06-09-2006, 11:05 AM #2625
if its not stickied, you can just add it to your favorites, yet i think it should have stayed stickied, so other people can directly see this thread.
-
06-09-2006, 03:43 PM #2626<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
how can you flip an image
(preferbly in v16)
-
06-09-2006, 04:05 PM #2627QJ Gamer Green
- Registriert seit
- Nov 2005
- Beiträge
- 1.029
- Points
- 10.689
- Level
- 68
- Downloads
- 0
- Uploads
- 0
I was wondering if you could use LUA Player to calculate the TOTAL space on the memory stick? , If so could someone post the code for it. Thanks.
-
06-10-2006, 08:51 AM #2628
Zitat von DeMoN X
mem = System.getFreeMemory() -- gets free memory at least.
i'm not sure if thats what you wanted since you said TOTAL space, but maybe that will help anyways.
-
06-10-2006, 09:55 AM #2629QJ Gamer Green
- Registriert seit
- Nov 2005
- Beiträge
- 1.029
- Points
- 10.689
- Level
- 68
- Downloads
- 0
- Uploads
- 0
Well I tried getfreememory(), heres the code :
Zitat von emericaska8r
It gives me the wrong values when I do it.. :Argh:Code:mem = System.getFreeMemory() screen:print(200, 100, mem) screen.flip() while true do screen.waitVblankStart() end
-
06-10-2006, 09:59 AM #2630QJ Gamer Gold
- Registriert seit
- Mar 2006
- Ort
- LOLWUT
- Beiträge
- 2.625
- Points
- 18.627
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Wouldn't the code be:
Zitat von DeMoN X
Try that instead.Code:white = Color.new(255,255,255) mem = System.getFreeMemory() while true do screen:clear() screen:print(100,100,"Free Memory = " .. mem, white) screen.waitVblankStart() screen.flip() end
--PSPduh
-
06-10-2006, 10:17 AM #2631QJ Gamer Green
- Registriert seit
- Nov 2005
- Beiträge
- 1.029
- Points
- 10.689
- Level
- 68
- Downloads
- 0
- Uploads
- 0
I get 'Free Memory = 8399608' , Erm.. 8MB? Lol.. It should say 111MB..
-
06-10-2006, 10:18 AM #2632words 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
PSPduh - It doesnt really matter... The System.getfreeMemory() returns an integer, which means you cant use a number as a string, although a string is just a bunch of ASCII number values... But ohwell, it desnt really matter, you just need to have that '.. mem' then a color to get it working...

...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
-
06-10-2006, 04:57 PM #2633QJ Gamer Gold
- Registriert seit
- Mar 2006
- Ort
- LOLWUT
- Beiträge
- 2.625
- Points
- 18.627
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Here is what it says at http://wiki.ps2dev.org/psp:lua_player:functions
Zitat von DeMoN X
That's what it says over at the website.
Zitat von That website above
--PSPduh
-
06-12-2006, 07:08 PM #2634
so are you saying that you just divide the number you get by 1024 twice then to get the memory in mb?
-
06-13-2006, 02:21 AM #2635
thats what the wiki says yes.
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
06-13-2006, 01:24 PM #2636QJ Gamer Green
- Registriert seit
- Nov 2005
- Beiträge
- 1.029
- Points
- 10.689
- Level
- 68
- Downloads
- 0
- Uploads
- 0
I think that code only works on older versions of LUA Player.
Zitat von Altair
-
06-13-2006, 03:15 PM #2637
Hmm I wouldn't know, I use 0.16. But why wouldn't it work on newer versions? It doesn't say that these commands are for any specific version, or am I missing something?
LUA manual:
[url]http://www.lua.org/manual/5.0/manual.html[/url]
LUA Wiki:
[url]http://wiki.ps2dev.org/psp:lua_player[/url]
-
06-13-2006, 09:32 PM #2638
true dat
Zitat von Altair
-
06-13-2006, 10:03 PM #2639QJ Gamer Green
- Registriert seit
- Nov 2005
- Ort
- Sweden
- Beiträge
- 460
- Points
- 6.520
- Level
- 52
- Downloads
- 0
- Uploads
- 0
I have seen that some of the newer LuaPlayer versions are slower, that's not good at all.
I tried "Graphic Creator" with 0.20 i think, and when choosing a BGcolor it lagged alot more then it did on the previous LuaPlayer versions.[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]
-
06-15-2006, 07:04 AM #2640Is in your zone.

- Registriert seit
- Oct 2005
- Ort
- Jacksonville, FL
- Beiträge
- 3.429
- Points
- 24.342
- Level
- 94
- Downloads
- 0
- Uploads
- 0
OKay I REALLY need help. This is the basic engine (minus jump script which im workin on) But whenever I try it on windowsluaplayer I get the stackdump thing. and when i try it on my PSP it freezes and shuts off. I dont see any problems with my code and anyone PLEASE HELP??
Code:black = Color.new(0,0,0) --VARIABLES/ARRAYS-- player = {} player.x = 20 player.y = 212 enemy = {} enemy.x = 420 enemy.y = 212 poox = nil pooy = nil poo2x = nil poo2y = nil z = 0 --IMAGES-- browndashleft = Image.load("brown/monkey1dashl.png") browndashright = Image.load("brown/monkey1dashr.png") brownhitleft = Image.load("brown/monkey1hitl.png") brownhitright = Image.load("brown/monkey1hitr.png") brownjumpleft = Image.load("brown/monkey1jumpl.png") brownjumpright = Image.load("brown/monkey1jumpr.png") brownstandleft = Image.load("brown/monkey1standl.png") brownstandright = Image.load("brown/monkey1standr.png") bluedashleft = Image.load("blue/monkey2dashl.png") bluedashright = Image.load("blue/monkey2dashr.png") bluehitleft = Image.load("blue/monkey2hitl.png") bluejumpleft = Image.load("blue/monkey2jumpl.png") bluejumpright = Image.load("blue/monkey2jumpr.png") bluestandleft = Image.load("blue/monkey2standl.png") bluestandright = Image.load("blue/monkey2standr.png") bg = Image.load("lv1.png") while true do screen:clear() screen:blit(0,0, bg, false) screen:print(6,2, "[WIP]", black) pad = Controls.read() if pad:left() then z = 1 if player.x > 0 then player.x = player.x - 5 end end if pad:right() then z = 0 if player.x < 456 then player.x = player.x + 5 end end if z == 1 then screen:blit(player.x, player.y, browndashleft) else screen:blit(player.x, player.y, browndashright) end if pad:start() then break end screen:blit(player.x, player.y, monkeystandright) screen.flip() screen.waitVblankStart() end
--XBL Gamertag: PhenoM904--


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