QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

My first lua script!

This is a discussion on My first lua script! within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Yay, I made my first lua script! Note: It has no usefulness whatsoever, so don't download it looking for some ...

Reply
 
LinkBack Thread Tools
Old 10-01-2006, 07:46 PM   #1
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default My first lua script!

Yay, I made my first lua script!

Note: It has no usefulness whatsoever, so don't download it looking for some great app.

It's called Tux says hello. I tried to keep my first script simple, so it isnt much. I got all the bugs out too.

I don't really care that an experienced lua coder could make this in 5 minutes, it's my first script ever. Comment on it if you wish.

Last edited by TacticalPenguin; 10-14-2006 at 09:14 PM..
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:04 PM   #2
 
Join Date: Sep 2006
Posts: 121
Trader Feedback: 0
Default

nice to see more people joining the homebrew community!
UB3R-W4N-K0N0B1 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:27 PM   #3
 
Urza's Avatar
 
Join Date: Aug 2005
Posts: 4,540
Trader Feedback: 0
Default

Quote:
Originally Posted by TacticalPenguin
I don't really care that an experienced lua coder could make this in 5 minutes
Someone who had never coded anything in their life could make this in 2. Please don't make threads like this.
Urza is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:33 PM   #4
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

Somebody who hasnt read any tutorials at all? You're telling me that I can read 2-3 tutorials and then make this in 2 minutes? That's a load of bullsh!t there.
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:35 PM   #5
Look at my user title :p
 
%chrono trigger%'s Avatar
 
Join Date: Feb 2006
Real First Name: Dave
Location: Texas
Just Played: Banjo Kazooie
Posts: 1,178
Trader Feedback: 0
Default

what does the script do?
__________________
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
%chrono trigger% is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:36 PM   #6
 
El Diablo's Avatar
 
Join Date: Mar 2006
Location: Somewhere
Posts: 3,625
Trader Feedback: 0
Default

urza please. you have done absolutley nothing to help the comunity exept make a thread of everyones themes and oyu made 1 or 2 yourself. at least pengiun is doing acual coding and getting into the scene.

keep it up pengiun
__________________
Veteran

[CENTER][COLOR="Green"][FONT="Fixedsys"]
PSN Name[/FONT][/COLOR]: Eldiabl1o[/CENTER]
[center][QUOTE=gmansixfo]Since I have to reset my psp whenever i get out of an emulator. Can this damage my psp.[/QUOTE][/center]
El Diablo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:37 PM   #7
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

It shows a couple loading screens then it shows a pict5ure of tux and it says "Tux says hello" then a few seconds later it says "Tux says goodbye" then it blanks and says "Press home to exit"

Edit: Thank you Save_youresam!
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:39 PM   #8
Look at my user title :p
 
%chrono trigger%'s Avatar
 
Join Date: Feb 2006
Real First Name: Dave
Location: Texas
Just Played: Banjo Kazooie
Posts: 1,178
Trader Feedback: 0
Default

yeah im sure someone who just read the guides couldnt have done that in 2 minutes i have read the guides and am in the process of making a side scrolloing game but have had no luck so I started over and read them again and i learned new stuff. point is that for everybody coding isnt easy and you should welcome new developers not anger them and tell them thier stuff isnt any good.
i say good job tactical penguin keeep it up
__________________
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
%chrono trigger% is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:42 PM   #9
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

Thanks chrono! I think for now I'm just gonna make some samples for myself to find out how to do different things and have reference, then ill take a shot at making a game.
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:43 PM   #10
Look at my user title :p
 
%chrono trigger%'s Avatar
 
Join Date: Feb 2006
Real First Name: Dave
Location: Texas
Just Played: Banjo Kazooie
Posts: 1,178
Trader Feedback: 0
Default

good idea i took on te task of making a game before i did that
very stupid idea let me tell you from experience
__________________
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
%chrono trigger% is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:45 PM   #11
 
El Diablo's Avatar
 
Join Date: Mar 2006
Location: Somewhere
Posts: 3,625
Trader Feedback: 0
Default

i tried it once...i made an app like yours and then just was tired of it. it was too much work to learn comands and how to do good ****. now i have so much more respect for coders and less for ppl like urza that come into threads like this bashing the people who are trying to learn and code
__________________
Veteran

[CENTER][COLOR="Green"][FONT="Fixedsys"]
PSN Name[/FONT][/COLOR]: Eldiabl1o[/CENTER]
[center][QUOTE=gmansixfo]Since I have to reset my psp whenever i get out of an emulator. Can this damage my psp.[/QUOTE][/center]
El Diablo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 08:46 PM   #12
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

lol, thanks for the advice. You know, you can always go back and start at it again.
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 09:24 PM   #13
NeilR is back
 
-Marshall-'s Avatar
 
Join Date: Sep 2006
Location: canada.. duh
Posts: 180
Trader Feedback: 0
Default

good work and it does take awhile for people like you and me who are starting out i made one of these but differnt yesterday took awhile. right now im working on a raceing type game, its not easy i can really respect the great devs now it takes alot of efforrt

good work man
__________________
[SPOILER="Donations"]Donators: TMK 1Mill, cowsruledaworld 300k, Arsonist 75k and 10 k, and thx spiral for the
prem....Thank you every one that has donated :D[/SPOILER]
[SPOILER="funny comic of the day!!!"][IMG]http://www.explosm.net/db/files/Comics/Matt/self-diagnosis.png[/IMG][/SPOILER]
Join #QJChat and #marshalls on IRC, at irc.toc2rta.com
-Marshall- is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 09:45 PM   #14
 
Zx30's Avatar
 
Join Date: Oct 2005
Location: Work/Xbox360/here
Posts: 3,926
Trader Feedback: 0
Default

I don't see the reason to flame the man/woman if he tryed to make something. It shows progress..He/she just started..Soon he'll do better things..

I look foward to hear from your success in the future if it happens.
Zx30 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 09:47 PM   #15

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Urza is right on the part to not make threads like this. Wow, your first script, awesome, sweet, amazing, not everyone can put up with simple little examples... Oh and a novice dev could make this in less than 5 minutes :X Brand new dev, dunno...
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 09:49 PM   #16
NeilR is back
 
-Marshall-'s Avatar
 
Join Date: Sep 2006
Location: canada.. duh
Posts: 180
Trader Feedback: 0
Default

well if its his first script then im guessing hes not a novice but a beginer
__________________
[SPOILER="Donations"]Donators: TMK 1Mill, cowsruledaworld 300k, Arsonist 75k and 10 k, and thx spiral for the
prem....Thank you every one that has donated :D[/SPOILER]
[SPOILER="funny comic of the day!!!"][IMG]http://www.explosm.net/db/files/Comics/Matt/self-diagnosis.png[/IMG][/SPOILER]
Join #QJChat and #marshalls on IRC, at irc.toc2rta.com
-Marshall- is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 09:53 PM   #17
 
Urza's Avatar
 
Join Date: Aug 2005
Posts: 4,540
Trader Feedback: 0
Default

Its not that I'm bashing new devs, I'm just saying if everyone put up an example after they completed some tutorial, we would have hundreds of identical threads like this. FREE_YOURESAM, please think before you post. Thank you.
Urza is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 09:55 PM   #18
 
Zx30's Avatar
 
Join Date: Oct 2005
Location: Work/Xbox360/here
Posts: 3,926
Trader Feedback: 0
Default

It's just one..I think we'll live for now..And I'm sure a mod will close it in the morning if necessary..=]
Zx30 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 09:58 PM   #19
NeilR is back
 
-Marshall-'s Avatar
 
Join Date: Sep 2006
Location: canada.. duh
Posts: 180
Trader Feedback: 0
Default

Quote:
Originally Posted by Urza the Tyrant
Its not that I'm bashing new devs, I'm just saying if everyone put up an example after they completed some tutorial, we would have hundreds of identical threads like this. FREE_YOURESAM, please think before you post. Thank you.
no i agree with you if everone did this then this forum would be filled with useless junk.
__________________
[SPOILER="Donations"]Donators: TMK 1Mill, cowsruledaworld 300k, Arsonist 75k and 10 k, and thx spiral for the
prem....Thank you every one that has donated :D[/SPOILER]
[SPOILER="funny comic of the day!!!"][IMG]http://www.explosm.net/db/files/Comics/Matt/self-diagnosis.png[/IMG][/SPOILER]
Join #QJChat and #marshalls on IRC, at irc.toc2rta.com
-Marshall- is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 10:02 PM   #20
 
Urza's Avatar
 
Join Date: Aug 2005
Posts: 4,540
Trader Feedback: 0
Default

Quote:
Originally Posted by TacticalPenguin
Somebody who hasnt read any tutorials at all? You're telling me that I can read 2-3 tutorials and then make this in 2 minutes? That's a load of bullsh!t there.
You could read 1 tutorial and make this in 2 minutes.
Urza is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-01-2006, 10:35 PM   #21
 
pspcoder05's Avatar
 
Join Date: Sep 2006
Posts: 167
Trader Feedback: 0
Default

Great job.
pspcoder05 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 07:08 AM   #22

Developer
 
Join Date: Jul 2006
Posts: 205
Trader Feedback: 0
Default

Quote:
Originally Posted by Alberto
It's just one..I think we'll live for now..And I'm sure a mod will close it in the morning if necessary..=]
Actually, there have been many threads like this over the past couple months, including at least one that made the front page. It's great when new devs make their first step away from exactly copying tutorials, but nobody really needs to see it unless it might be an enjoyable game or a useful app to somebody. I know you're just looking for encouragement, but you could have just posted the message that you finished it on the Lua Help Thread after you were helped, that would suffice. Think about if we had a Beginner's release thread where new devs released all of their first apps. I can't imagine there would be many visitors there.

The only encouragement developers should need is the opportunity to create a great game or application, not acceptance by other developers, because that isn't worth much at all.
LMelior is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 07:45 AM   #23
i wish i was cool
 
psp4life's Avatar
 
Join Date: Oct 2005
Location: The Netherlands
Posts: 1,257
Trader Feedback: 0
Default

I agree, even I could make this and I don't call myself a dev, jus someone who red 3-5 tutorials. Btw this is all in the first lua tutorial on psp-programming.
psp4life is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 03:16 PM   #24
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

Actually I had to read 2 tutorials to get all of it, and it isnt a copy of a tutorial.
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 03:24 PM   #25

sceKernelExitGame();
 
Bronx's Avatar
 
Join Date: Jan 2006
Location: New York
Posts: 3,125
Trader Feedback: 0
Default

Just a tip. Declre all variables before your main loop (while true do) and do all in game stuff in the main loop. Also you only need to switch the screen rom off-screen buffer to on-screen buffer once per loop. So you only need screen.flip() at the end... This is your script re-organized
Code:
white = Color.new(0, 0, 0)
blue = Color.new(0, 0, 255) 
while true do
screen:print(0, 0, "Loading: 30%", blue) 
screen.waitVblankStart(120) 
screen:clear()
screen:print(0, 0, "Loading: 70%", blue) 
screen.waitVblankStart(120) 
screen:clear()
screen:print(0,0, "Loading Complete", blue) 
screen.waitVblankStart(120) 
screen:clear()
background = Image.load("bg.PNG") 
screen:blit(0,0, background) 
screen:print(0, 0, "Tux says hello!", blue) 
screen.waitVblankStart(240) 
screen:clear() 
screen:blit(0,0, background) 
screen:print(0, 0, "Tux says goodbye!", blue) 
screen.waitVblankStart(180) 
screen:clear()
screen:print(0,0, "Press Home to exit.", blue)
screen.flip()
screen.waitVblankStart()
end
Btw, try indenting and spacing so you can read it on later on (will become usefull when you go onto to larger projects).
Bronx is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 03:28 PM   #26
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

Cool, thanks bronx. And for indenting, what do you mean? I know to keep a single part of script per line, but what do you mean by indenting?
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 04:08 PM   #27

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Bronx, his way is just fine. Sure, in LUA you can pause the vsync, but later when he moves onto C and deals with un-delayable vsync's (TIFF SDK is a good example) he'll need to use a function to delay the thread, but that won't update the buffer (display), meaning he'll have to change it on, delay, than change it back off. Something I learned first hand in Space Invaders for 2.8 TIFF
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 04:25 PM   #28

sceKernelExitGame();
 
Bronx's Avatar
 
Join Date: Jan 2006
Location: New York
Posts: 3,125
Trader Feedback: 0
Default

Quote:
Originally Posted by TacticalPenguin
Cool, thanks bronx. And for indenting, what do you mean? I know to keep a single part of script per line, but what do you mean by indenting?
This should explain

http://www.psp-programming.com/dev-f...pic.php?t=1166
Bronx is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 06:11 PM   #29

Developer
 
Join Date: Jul 2006
Posts: 205
Trader Feedback: 0
Default

Quote:
Originally Posted by TacticalPenguin
Actually I had to read 2 tutorials to get all of it, and it isnt a copy of a tutorial.
I know, I said so in my post: "It's great when new devs make their first step away from exactly copying tutorials." Meaning you didn't copy a tutorial, meaning good job, but we don't need to see proof.

You should look into using code editors, because aside from color coding, some of them actually automatically indent the lines after function definitions and control statements. I thought Notepad++ did so, but I've been doing it on my own lately...maybe someone who uses conTEXT could say if that one auto-indents.

@Bronx
Actually his way isn't just fine, it has to be the way he had it. The only thing that would happen with your code is after 13 seconds it would say "Press Home to exit." in the top left of the screen.

EDIT: Also, you forgot to move his image loading line to outside of the main loop.
LMelior is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-02-2006, 06:37 PM   #30

sceKernelExitGame();
 
Bronx's Avatar
 
Join Date: Jan 2006
Location: New York
Posts: 3,125
Trader Feedback: 0
Default

really? That doesn't make sense... :?
w/e... sorry about that
Bronx is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
lua , script

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 01:38 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us