PSP Hacks - Forums

Go Back   PSP Hacks - Forums > Tech Talk > LUA Scripting

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-28-2008, 01:56 AM
Organized_Chaos Organized_Chaos is offline
PSP Smarty
 

Join Date: May 2008
Location: Neosho, MO
Posts: 128
Organized_Chaos Has a Beginner Reputation
Default

Hello everyone.. As you can probably tell I am new at LUA programing. I followed all the directions in this tutorial at http://www.evilmana.com/tutorials/lua_tutorial_03.php and I am having problems. How do I make this error go away and make my "program" work?
I get an error message that says
"Error: Variable Tut.LUA:18: attempt to perform arithmetic on global 'myBirthYear' (a nil value)
Press start to restart"

("Variable Tut.LUA" is my file name.)
-
Here is my code:
Code:
-- NOTES
-- Green Color Object
green = Color.new(0, 255, 0)

-- Store birth year in variable myBirthYear
myBirthyear = 1991

-- Store current year in currentYear
currentYear = 2008

-- create an empty variable
myAge = nil

-- Store some text in a variable (Note the 

space after the last word before the end ")
someText = "My age is roughly "

-- Subtract myBirthYear from currentYear 

and store in myAge
myAge = currentYear - myBirthYear

-- Print our text variable to the screen 

(NOTE that there are no "" surrounding 

someText)
screen:print(10,100,someText .. 

myAge,green)

-- Buffer offscreen to onscreen (If this 

was a human, offscreen would be thinking 

about it, onscreen would be saying it)
screen.flip()
-- Loop forever
while true do
screen.waitVblankStart()
end
The only thing I did differently was use my birth year and the current year instead of the years in this tutorial. And I added a few custom notes using the "-- text" format. Since this was a tutorial I figured I might add in a few things in case I use this file later as a reference or something. That stuff shouldn't make a difference should it?
__________________
------------------------------------------------------------------------------------
A true master of control is one who never seems to be in control
------------------------------------------------------------------------------------
Reply With Quote
Reply

 



Thread Tools
Display Modes

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

Forum Jump


All times are GMT -4. The time now is 07:47 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©