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!

lua scripts?

This is a discussion on lua scripts? within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; how do you implement high-scores and menus into my lua game?(it isnt realeased to the public just yet) also i ...

Reply
 
LinkBack Thread Tools
Old 09-09-2006, 05:47 AM   #1
likes kittens....awww....
 
Join Date: Sep 2006
Real First Name: Erik
Location: Detroit
Just Played: Call of Duty:World at War
Posts: 628
Trader Feedback: 0
Smile lua scripts?

how do you implement high-scores and menus into my lua game?(it isnt realeased to the public just yet)
also i need a GFX guy

and some guys were impersonating me as (Unregistered)
psphacker12. is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-09-2006, 05:49 AM   #2

Mindless Self Indulgence
 
Realn0whereman's Avatar
 
Join Date: Oct 2005
Location: afk
Posts: 7,212
Trader Feedback: 0
Default

highscore is like

define a variable of points... so after u die something like
IF points > Old points then highscore = points

and menu can be like if pad:cross then start game... or if pad:cross then option+1
__________________
PSN:realn0whereman
NEW MSI ALBUM APRIL 29TH: IF
*orgasm*
Realn0whereman is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-09-2006, 05:52 AM   #3
likes kittens....awww....
 
Join Date: Sep 2006
Real First Name: Erik
Location: Detroit
Just Played: Call of Duty:World at War
Posts: 628
Trader Feedback: 0
Default

would it be like
option+1 = ???
psphacker12. is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-09-2006, 05:59 AM   #4

I'm Baaaack!
 
Access_Denied's Avatar
 
Join Date: May 2006
Location: Waukegan,Illinois
Posts: 2,185
Trader Feedback: 0
Default

Go to evilmana.com and go to the Lua CodeBase. There are many little menu tutorials there. As for the highscore. Try this.
First create a .txt file. Something like "highscore.txt"
At the very beginning you want to do this:

high = io.open("highscore.txt"," r")
highscore = high:read()
high:close()

Now you want a variable for your points.

points = 0

Now when the game is over, do this.

if points > highscore then
high2 = io.open("highscore.txt"," w")
high2:write(points)
high2:close()
end

This will save the highscore to the .txt file, and it will load the highscore next time you play.
__________________
Access_Denied is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-09-2006, 06:12 AM   #5
 
Join Date: Jul 2006
Location: Alabama
Posts: 142
Trader Feedback: 0
Default

Take a look at the Snake game that comes with Luaplayer for Windows. Snake has (code for) an options/menu screen, single line saving, and multiple line saving.
Aphonia is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-09-2006, 06:13 AM   #6

I'm Baaaack!
 
Access_Denied's Avatar
 
Join Date: May 2006
Location: Waukegan,Illinois
Posts: 2,185
Trader Feedback: 0
Default

Or just check tutorial 9 for ProgramLua.
__________________
Access_Denied is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-09-2006, 06:28 AM   #7

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

Pretty much, keep the score in a variable... Then when the game is complete ro whenever you want to save the score use dofile() to save it into another .txt file
Bronx is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-09-2006, 07:42 AM   #8
likes kittens....awww....
 
Join Date: Sep 2006
Real First Name: Erik
Location: Detroit
Just Played: Call of Duty:World at War
Posts: 628
Trader Feedback: 0
Default

also how do you do a screen:/print function with a truetype font???
becuz i have the font loaded like this
red = Color.new(255,0,0)
font = Font Font.load(/DATA/FONT/font.ttf)
but how do i print text on the screen wit the custom font???

ARza THX 4 all of the help

Last edited by psphacker12.; 09-09-2006 at 08:16 AM..
psphacker12. is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-09-2006, 07:58 AM   #9

I'm Baaaack!
 
Access_Denied's Avatar
 
Join Date: May 2006
Location: Waukegan,Illinois
Posts: 2,185
Trader Feedback: 0
Default

I think it's

font = Font.load(DATA/FONT/font.ttf)

You don't need to put FONT twice. And I think to print with that font, you need to do something like:

screen:fontPrint(proporti onal, 0, 20, "Hello", blue)

I think it's like that. I've never used a ttf font. I'll check up on it later, but for now I have to go.
__________________
Access_Denied is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
lua , scripts

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 11:08 PM.



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