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 Grimfate126 i would try animation lib 3. but, you need a better understaanding of lua first.. I can ...
-
11-10-2006, 03:02 PM #4021QJ Gamer Gold
- Registriert seit
- Jul 2006
- Ort
- Ridin' With Urza
- Beiträge
- 1.950
- Points
- 16.445
- Level
- 82
- Downloads
- 0
- Uploads
- 0
I can personally vouch for ANIM Lib 3. It's a godsend because you don't can't load GIF's.
Zitat von Grimfate126
It's not at all hard to use, if all else fails, just overwrite Grimfate's test pictures and edit the number of frames in the Anilib.lua file.
-= Double Post =-
How can I keep the text from running of the side of the screen?
Also, I've been testing my code on Windows LUA Player, and now I want to try it on the PSP, but I have no clue as to how to incorporate ANIM Lib3 into it. Anyone want to help?
Geändert von KKlicK (11-10-2006 um 03:02 PM Uhr) Grund: Automerged Doublepost
-
11-10-2006, 03:11 PM #4022Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
ANIM lib work fine for both windows lua and PSP. you shouldnt have to change anything.. just run it as usual and it should work fine.
Zitat von Alyssa
if you have any problems, PM me.--------------------------------------------------------------------------------------
-
11-10-2006, 05:08 PM #4023words 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 - Stop doubling your work. Get back to what you announced! ;)

...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
-
11-10-2006, 05:10 PM #4024Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von SG57
umm, last time i checked, i could do whatever i want. i dont need a 9th grader bossing me around. (NO, assault is not dead. i have a little.. surprise for you all. but ill show you later.)--------------------------------------------------------------------------------------
-
11-10-2006, 06:55 PM #4025
yes, i'm back into lua programming! :)
ok, here is my question, i am making a pong like game, yet there are four sides in play. I need to get my collisions correct so that when the ball bounces off any of the four bars it will change course. Here is my code, what is wrong with it?
here barl is the left barCode:function collision() collide = "false" if ballspot.x == 15 then for a = (barl.y), 50 do if ballspot.y == a then slope.x = slope.x * -1 collide = "true" end end if collide == "false" then gameover() end end if ballspot.x == 465 then for a = (barr.y), 50 do if ballspot.y == a then slope.x = slope.x * -1 collide = "true" end end if collide == "false" then gameover() end end if ballspot.y == 257 then for a = (bard.x), 50 do if ballspot.x == a then slope.y = slope.y * -1 collide = "true" end end if collide == "false" then gameover() end end if ballspot.y == 15 then for a = (baru.x), 50 do if ballspot.x == a then slope.y = slope.y * -1 collide = "true" end end if collide == "false" then gameover() --you missed the ball end end end
barr is right, baru is upper, and bard is the lower bar.
The images for the bars are (10x50) and (50x10)
they are each located 5 pixels from the outer edge.
-= Double Post =-
also, if anyone wants to help me but doesn't understand all that, you can pm me and i will give you my entire code to look at. I trust nobody will steal it because the game is too simple, yet i think will be somewhat fun at the end...
-= Double Post =-
grrrr. sorry, i just don't really like the double post merge thing. i guess it helps the site, but still. anyway though, some1 please help
Geändert von emericaska8r (11-10-2006 um 06:55 PM Uhr) Grund: Automerged Doublepost
-
11-10-2006, 09:19 PM #4026QJ Gamer Platinum
- Registriert seit
- Dec 2005
- Ort
- h0000000rj
- Beiträge
- 12.867
- Points
- 57.528
- Level
- 100
- Downloads
- 0
- Uploads
- 0
re: Text2Phone - the original program was written by someone named cools. According to the comments from the version of netlib that the Text2phone program uses, the actual netcall and sms stuff was written by PsPmad and youresam:
Zitat von Access_Denied
re: fBrowsernetlib v2.0
Copyright 2006 by youresam
Also thanks to PsPmad for help with netcall and netsms!Guessing he made the imagesThis is a file browser script made by fchaos and yoyomacy.
[I fail @ life]
-
11-11-2006, 06:54 AM #4027QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Scotland, UK
- Beiträge
- 571
- Points
- 7.057
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Hey when i run this script i get and error saying attempt to perform arithmetic on global 'player' ( a table value). This is near the start of the main loop where i say player.x = 48 and player.y = 186 . The error is on line 383 and the script is in the attachment
-
11-11-2006, 06:58 AM #4028QJ Gamer Green
- Registriert seit
- Aug 2005
- Ort
- a
- Beiträge
- 545
- Points
- 12.085
- Level
- 72
- Downloads
- 0
- Uploads
- 0
I need some help:
http://forums.qj.net/f-psp-developme...ion-77884.html
-
11-11-2006, 07:06 AM #4029QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Scotland, UK
- Beiträge
- 571
- Points
- 7.057
- Level
- 55
- Downloads
- 0
- Uploads
- 0
why dont you try modifing this for your own use
http://evilmana.com/tutorials/codebase/name_entry.php
-= Double Post =-
now back on to my problem
-=Edit=-
Sorry i meant this site http://evilmana.com/tutorials/codeba...rd_program.phpGeändert von mark.sparky (11-11-2006 um 07:16 AM Uhr) Grund: Automerged Doublepost
-
11-11-2006, 07:40 AM #4030QJ Gamer Green
- Registriert seit
- Aug 2005
- Ort
- a
- Beiträge
- 545
- Points
- 12.085
- Level
- 72
- Downloads
- 0
- Uploads
- 0
I'd prefer to start from the base up any help?
-
11-11-2006, 08:49 AM #4031QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Scotland, UK
- Beiträge
- 571
- Points
- 7.057
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Any answers to my problem (post #4027)
-
11-11-2006, 08:58 AM #4032QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- script.lua
- Beiträge
- 426
- Points
- 6.087
- Level
- 50
- Downloads
- 0
- Uploads
- 0
Lua is perty!
-
11-11-2006, 09:56 AM #4033QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Scotland, UK
- Beiträge
- 571
- Points
- 7.057
- Level
- 55
- Downloads
- 0
- Uploads
- 0
what?
-
11-11-2006, 10:00 AM #4034Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
spam if i ever did see it:ROFL:
Zitat von XteticX
-
11-11-2006, 10:27 AM #4035No longer a community member.
- Registriert seit
- Jan 2006
- Beiträge
- 2
- Points
- 25.679
- Level
- 96
- Downloads
- 0
- Uploads
- 0
A reply to spam is just as bad as spamming itself. (Then why am I replying to a reply that replied to spam...?)
Zitat von eldiablov
-
11-11-2006, 11:31 AM #4036Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
And i'm going to reply to your reply about my reply about XteticX's comment by singing "We love you southend we do !" But seriously i think you're an excellent dev so could you tell me whats wrong? I want my player to start at the bottom of the screen but he starts halfway on the screen. Here is my code :
blue = Color.new(0, 0, 255)
green=Color.new(0,255,0)
white = Color.new(255,255,255)
health = Image.load("images/Healthplayer1-1.png")
background = Image.load("images/background.png")
Player = Image.load("images/stick1.png")
Sprites = {}
Sprites[1] = Image.load("images/stick4.png")
Sprites[2] = Image.load("images/stick3.png")
Sprites[3] = Image.load("images/stick2.png")
Sprites[4] = Image.load("images/stick1.png")
Sprites[5] = Image.load("images/stick5.png")
Sprites[6] = Image.load("images/stick6.png")
Player = {}
Player.x = 7
Player.y = 230
Player.health = 100
Player.gravity = 185
Player.jumpspeed = 10
Player.jumpstate = "ground"
currentsprite = 4
while true do
pad = Controls.read()
screen:clear()
screen:blit(0, 0, background)
screen:blit(8, 18, health)
screen
rint(15, 7, "1P Health", blue)
screen:blit(Player.x,Play er.y,Sprites[currentsprite])
-- Controls
if pad:right() and Player.x < 455 then
currentsprite = 4
Player.x = Player.x + 2
end
if pad:left() and Player.x > 7 then
currentsprite = 2
Player.x = Player.x - 2
end
if pad:up() and Player.y > 6 and Player.jumpstate == "ground" then Player.jumpstate = "jumping" and
currentsprite = 1
Player.y = Player.y - 2
end
if pad:down() and Player.y < 235 then
currentsprite = 3
Player.y = Player.y + 2
end
if pad:cross() then
currentsprite = 5
end
if pad:circle() and Player.jumpstate == "ground" then Player.jumpstate = "jumping" end
if pad:down() and pad:cross() and Player.y > 6 then
currentsprite = 6
end
if pad:start() then
os.exit()
end
-- Gravity function
if Player.jumpstate == "jumping" then
Player.jumpspeed = Player.jumpspeed - 0.5
Player.gravity = Player.gravity - Player.jumpspeed
end
if Player.gravity < 0 then
Player.jumpstate = "falling"
end
if Player.gravity < 230 and Player.jumpstate == "falling" then
Player.gravity = Player.gravity + (Player.jumpspeed + 3)
end
if Player.gravity == 230 then
Player.jumpspeed = 10
Player.jumpstate = "ground"
end
if Player.gravity > 230 then Player.gravity = 230 end
Player.y = Player.gravity
screen.waitVblankStart()
screen.flip()
end
-
11-11-2006, 12:45 PM #4037Ponies and Unicorns
- Registriert seit
- Aug 2006
- Ort
- Pelennor Fields
- Beiträge
- 547
- Points
- 5.778
- Level
- 49
- Downloads
- 0
- Uploads
- 0
sry eldiablov but i cant really figure out the answer to ur q. But i have a question myself. Im making a maze game and I have a path my dude walks down and enemies patroling the path moving back and forth in the same direction. but im having a problem here. i figured out how to move my enemies back and forth and it involves using a variable and adding to it and they move and its really complicated it worked yes but im wondering if there is a easier way to make a enemy patrol and path. i saw on evilmana they could make an enemy move in a circle but not in a straight line help plz.
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!
-
11-11-2006, 01:05 PM #4038QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Completely off the hip.
Not brilliant but it works.Code:Direction = { x = 0, y = 0 } Position = { x = 0, y = 0 } Direction.x = 1 Position.x = 10 Position.y = 10 Speed = 3 while true do if Position.x < 10 then Direction.x = 1 end if Position.x > 200 then Direction.x = -1 end Position.x = Position.x + ( Speed * Direction.x ) Position.y = Position.y + ( Speed * Direction.y ) end
-
11-11-2006, 01:47 PM #4039Ponies and Unicorns
- Registriert seit
- Aug 2006
- Ort
- Pelennor Fields
- Beiträge
- 547
- Points
- 5.778
- Level
- 49
- Downloads
- 0
- Uploads
- 0
^^^ thats the patrolling code?
EDIT: yah it is lol ok thanks.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!
-
11-11-2006, 02:12 PM #4040QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Scotland, UK
- Beiträge
- 571
- Points
- 7.057
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Is there a way to display the psp's current time and then use that so that if it is a certain time then the screen will be using a dark map and if it is before the time then it will use the light map
-
11-11-2006, 02:13 PM #4041lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Why would you want to display the current time when you can just press the home button?
-
11-11-2006, 02:16 PM #4042QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Scotland, UK
- Beiträge
- 571
- Points
- 7.057
- Level
- 55
- Downloads
- 0
- Uploads
- 0
because i am making a game and i want it so that when it is say 6 o'clock then a dark map will be displayed but before 6 o'clock a light map will be displayed.
-
11-11-2006, 02:18 PM #4043Ponies and Unicorns
- Registriert seit
- Aug 2006
- Ort
- Pelennor Fields
- Beiträge
- 547
- Points
- 5.778
- Level
- 49
- Downloads
- 0
- Uploads
- 0
I dont know. I think you would need to access the flash though because of the time.
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!
-
11-11-2006, 02:28 PM #4044QJ Gamer Green
- Registriert seit
- Oct 2005
- Ort
- Scotland, UK
- Beiträge
- 571
- Points
- 7.057
- Level
- 55
- Downloads
- 0
- Uploads
- 0
well what about when you use random numbers you use os.time() which is where you use the current tmie to determine random numbers
-
11-11-2006, 05:52 PM #4045
ok, here is my question, i am making a pong like game, yet there are four sides in play. I need to get my collisions correct so that when the ball bounces off any of the four bars it will change course. Here is my code, what is wrong with it?
here barl is the left barCode:function collision() collide = "false" if ballspot.x == 15 then for a = (barl.y), 50 do if ballspot.y == a then slope.x = slope.x * -1 collide = "true" end end if collide == "false" then gameover() end end if ballspot.x == 465 then for a = (barr.y), 50 do if ballspot.y == a then slope.x = slope.x * -1 collide = "true" end end if collide == "false" then gameover() end end if ballspot.y == 257 then for a = (bard.x), 50 do if ballspot.x == a then slope.y = slope.y * -1 collide = "true" end end if collide == "false" then gameover() end end if ballspot.y == 15 then for a = (baru.x), 50 do if ballspot.x == a then slope.y = slope.y * -1 collide = "true" end end if collide == "false" then gameover() --you missed the ball end end end
barr is right, baru is upper, and bard is the lower bar.
The images for the bars are (10x50) and (50x10)
they are each located 5 pixels from the outer edge.
also, if anyone wants to help me but doesn't understand all that, you can pm me and i will give you my entire code to look at. I trust nobody will steal it because the game is too simple, yet i think will be somewhat fun at the end...
-= Double Post =-
ok nm guys, i worked it out. the problem was that when I had the for loop run, it would go from the bar's x value to 50, when i wanted it to go from the bar's x value to that number + 50.
i also fixed some other minor things to make the highscore work and so-on. Now the game will completely work :Jump:Geändert von emericaska8r (11-11-2006 um 05:52 PM Uhr) Grund: Automerged Doublepost
-
11-11-2006, 11:45 PM #4046Ponies and Unicorns
- Registriert seit
- Aug 2006
- Ort
- Pelennor Fields
- Beiträge
- 547
- Points
- 5.778
- Level
- 49
- Downloads
- 0
- Uploads
- 0
is this patrolling code valid? im basing it off head 54us's idea. But im not sure if it will work but it looks valid to me
also to make my enemy move backwords i use exactly the same code but subtract from the y coordinate instead. do u guys think this will work?if enemy[1].x > 20 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x > 25 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x > 29 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x == 30 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x < 40 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x > 12 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x == 30 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x < 40 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x > 12 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x < 40 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x > 12 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x < 40 then
enemy[1].y = enemy[1].y + 3
if enemy[1].x > 12 then
enemy[1].y = enemy[1].y + 3
end
EDIT: wow ok i lost track of myself. what are the x and y coordinates on the psp i know what they are but are they like backwords on the psp or something because on a real graph 0,0 is on the bottom left but on the psp 0,0 is on the top left corner. is x the width and y the height ? someone help im confusedIf 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!
-
11-12-2006, 01:58 AM #4047.info

- Registriert seit
- Jun 2006
- Ort
- ACT, Australia
- Beiträge
- 1.674
- Points
- 15.395
- Level
- 80
- Downloads
- 0
- Uploads
- 0
Na, you use os:time()
Zitat von GuitarGod1134
-
11-12-2006, 06:31 AM #4048
.
On the PSP, x is width and y is height. I have no experience in patrolling or whatever, so i can't answer your other question.
-
11-12-2006, 06:35 AM #4049is not posting very often

- Registriert seit
- Feb 2006
- Ort
- omnipresent
- Beiträge
- 5.162
- Points
- 33.152
- Level
- 100
- Downloads
- 0
- Uploads
- 0
its not just on the PSP, thats the same on a graph (co-ords) & in matrices its the same, but you use 2 x 4 or whatever (however it means x x y)
What did we think the world would look like in 2015?
http://forums.qj.net/501501-post26.html
Zitat von Abe
-
11-12-2006, 06:45 AM #4050QJ Gamer Green
- Registriert seit
- Aug 2005
- Ort
- a
- Beiträge
- 545
- Points
- 12.085
- Level
- 72
- Downloads
- 0
- Uploads
- 0
I am trying to make a five DIGIT password application that you can boot on startup:
http://forums.qj.net/f-psp-developme...ion-77884.html
I have finished the main part of the code which was edited from an example program:
http://evilmana.com/tutorials/codeba...rd_program.php
Spoiler for the edited code:
This attempts to read the numbers from five text files. These numbers are then put into a variable, which is then referenced when the password is input. When the password is input correctly the application exits to the XMB.
At the moment, the app loadsup fine and displays the input screen:
Enter your password
p1 p2 p3 p4 p5
You can scroll over each "part" (p1, p2, p3, p4, p5) but when you attempt to change the digit by using up or down on the d-pad, the "part" stays the same, not allowing the exit unless you use HOME; which brings me onto another question. What is the code snippet which disables the use of the HOME button, so no exit from this app is allowed unless you input the password.


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