I am starting to learn how to be a LUA Coder. I was wondering if anybody had some incredibly in-depth tutorials and the tools that I need to be a Coder. I would love to give back to the homebrew scene, so I would appreciate anyones help.
Printable View
I am starting to learn how to be a LUA Coder. I was wondering if anybody had some incredibly in-depth tutorials and the tools that I need to be a Coder. I would love to give back to the homebrew scene, so I would appreciate anyones help.
firstly get familliar with the lua coding lunguage, I suggest reading this on-line book of lua coding find it here.
once you do that read the reference book to stay famillair with the lua find that here
after that then get familliar with the psp lua version and its codes find that here
once thats done your ready to do a quick tutorial find that here
then your about ready
Also have a look here
http://www.evilmana.com/tutorials/lua_tutorial_list.php
i tried evil mania and did pretty good until the button input thing then i would run it and it would say smething about it cant find 's' and then it would continue to run and shut off...now thats all it does.
"EDIT"--haha i relized why it automatically shuts down...i left out the
luaplayer script.lua
pause
line lol...but i would still like some help...especially from an experienced coder lol
but dont you find it ironic that i once said lua isnt that good and now im wanting to be a lua coder...odd huh lol.
Thanks for your help guys
im not entirely sure what im making. its on evilmana.com and im at the tables part of the tutorial. i understand most of it though
You need to have an idea to create
i do have an idea, but im still not entirely sure how to code and stuff. so until i learn all the terms and codes and stuff like that i cant put my idea into works. thats where i need ur guys help
First of all make sure your idea is basic and what bits do you need help on
lol my idea is pretty basic at this point it time. its just a beginning program and i need help on the WHOLE thing. like what codes to use, how to use them, and what they do, and where to put them.
P.S. I'm not a noob to homebrew, just coding :-)
Whats your idea i'll get you started
ok...well i was thinking of just making a simple app, like a temperature conversion program or a graphing program for alegebra because i need stuff like that for my homework and i think it would save kids from having to spend 100 bucks on a graphing calculator. whichever you think is better to start of with
Ok first lets just get started with something even more basic
we will just have something like making something move on the screen so find a image you will like as the background
Make sure it has this
width = 480
height = 272
uh...ok. so this means like find a pic that has those demensions. does it matter what it is
we will just use this as the background , we also need a player
http://www.psp-hacks.com/psp-backgro...AKU_RENDER.BMP
We will use the car as a player
Now are you ready to begin
opk sry to sound kinda stupid but i got confused with what u just said. im not sure what u mean by player. because i have luaplayer for the comp that i got off of a link at evilmana.com and that link im assuming shouldve sent me to a site to get the pic u have attached but it just sends me to psphacks.com like the very main page
I have uploaded background here ,install lua player on your psp
We will use this as the background and the car as a player to move around on the screen
Now are you ready to start
ok sry to take so long. I dont have my psp with me but i have the PSPE and i cant get it to run]properly, if u could help me get it working, then i guess we can continue with the coding things lol
First of all we will start with this
----------------------------------------------------------------
Room_width = 480
Room_height = 272
player1x = 15
player1y = 136
weapon=Image.load("images/weapon.PNG")
background=weapon
car1=Image.load("images/car1.PNG")
player1=car1
------------------------------------------------------------------
Put that in your script at the top
basically this is the images we will be using and where would like the car to be on the screen
Dont copy and paste it in , type it in you learn more about it that way
ok what do i do after this
We will add some controls now enter this
-----------------------------------------------------------------
This moves the car up and down
-----------------------------------------------------------------
if pad:up() then
character = car1
player.y = player.y - 2
end
if pad:down() then
character = car1
player.y = player.y + 2
end
-----------------------------------------------------------------
This moves the car left and right
-----------------------------------------------------------------
if pad:left() then
character = car1
player.x = player.x - 2
end
if pad:right() then
character = car1
player.x = player.x + 2
end
------------------------------------------------------------------
Enter that in to your code
ok its in my code now...what next
Now save as script.lua
And run it
it says error: script.lua:7: Image.load: Error loading image.
aahhhhh you have your first error do you have both of the images i posted here
This is the error here
---------------------------------------------------------------------------------------------------
Room_width = 480
Room_height = 272
player1x = 15
player1y = 136
road=Image.load("images/weapon.PNG")
background=weapon
car1=Image.load("images/car1.PNG")
player1=car1
What you need to do is remove the word images on both of them just remove the word images nothing else
yea i noticed that but it still says i have an error on line seven. this is what i have in my script
Room_width = 480
Room_height = 272
player1x = 15
player1y = 136
weapon=Image.load("weapon.PNG")
background=weapon
car1=Image.load("car1.PNG")
player1=car1
do you have both of the images i posted on this site
save them as PNG
Save the background as weapon.PNG
and the car as car1.PNG
ok i got that to work...now when i run it it tells me
errors: script.lua:12: attempt to index global 'pad' (a nil value)
for me line 12 is
player.y = player.y - 2
Post your whole script here
this is my whole script
------------------------------------------------
-- My First Lua Program
-- Author: YoungProdigy
Room_width = 480
Room_height = 272
player1x = 15
player1y = 136
weapon=Image.load("weapon.PNG")
background=weapon
car1=Image.load("car1.PNG")
player1=car1
if pad:up() then
character=car1
player.y = player.y - 2
end
if pad:down() then
character = car1
player.y = player.y + 2
end
if pad:left() then
character = car1
player.x = player.x - 2
end
if pad:right() then
character = car1
player.x = player.x + 2
end
-- My First Lua Program
-- Author: YoungProdigy
Room_width = 480
Room_height = 272
player1x = 15
player1y = 136
weapon=Image.load("weapon.PNG")
background=weapon
car1=Image.load("car1.PNG")
player1=car1
pad = Controls.read()
if pad:up() then
character=car1
player.y = player.y - 2
end
if pad:down() then
character = car1
player.y = player.y + 2
end
if pad:left() then
character = car1
player.x = player.x - 2
end
if pad:right() then
character = car1
player.x = player.x + 2
end
------------------------------------------------------------------
Give it a try now
as you may of noticed i added
pad = Controls.read()
I hope both of you realise that code won't display anything on the screen.
ok i added exactly what you have there and run it but i still have another error.
error: script.lua:13: calling 'blit' on bad self (number expected, got nil)
Lil swish try this i have uploaded it for you
Here's the new code
-----------------------------------------------------------------
-- My First Lua Program
-- Author: YoungProdigy
Room_width = 480
Room_height = 272
player1x =15
player1y =136
background =Image.load ("weapon.PNG")
player1=Image.load("car1.PNG")
function checkcontrols()
pad = Controls.read()
if pad:start() then
exitgame = 1
end
if pad:right() then
player1x = player1x +2
end
if pad:left() then
player1x = player1x -2
end
if pad:up() then
player1y = player1y - 2
end
if pad:down() then
player1y = player1y +2
end
end
function drawall()
screen:blit (0,0,background)
screen:blit(player1x,player1y,player1)
screen.waitVblankStart()
screen.flip()
end
while true do
checkcontrols()
drawall()
if exitgame ==1 then
break
end
end
ok so after i have this...how would i go about making another app or program
Depends On what you want doing
If i was you i would stick to basic lua programs to start with