Jump to content

Recommended Posts

Posted

OK i have a menu system for lua script but i cant get it to run its giving me error after error????

 

red = Color.new(255,0,0)
black = Color.new(0,0,0)
white = Color.new(255,255,255)

menustatus = 1

while true do
screen:clear(black)
pad = Controls.read()

if pad:up() then
menustatus = menustatus - 1
screen.waitVblankStart(4)   
end

if pad:down() then
menustatus = menustatus + 1
screen.waitVblankStart(4)   
end

color={white, white, white}

screen:print(50, 50, "Play", color[1])
screen:print(50,60,"Options", color[2])
screen:print(50,70,"Exit", color[3])

color[menustatus]=red

if menustatus == 1 then
   if pad:cross() then
   --insert game code here
   end
end

if menustatus == 2 then
   if pad:cross() then
   --insert options here
   end
end

if menustatus == 3 then
   if pad:cross() then
   break
   end
end

if menustatus <= 0 then
menustatus = 3
end

if menustatus => 4 then
menustatus = 1
end

screen.flip()
screen.waitVblankStart()
end

xtremelogo.jpg
Posted

The Q is where did you get this code?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Posted

whats the error?

 

For one

 

if menustatus => 4 then

 

Thats backwards.

 

Should be

>=

 

2. Color isn't a valid class from this code, so it will never set.

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Posted

from a discussion in the PSP Development Forum ? :)

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Posted

yeah I see now ... and you thought it would be plug and play ?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Posted

yeah I see now ... and you thought it would be plug and play ?

 

Well i tried creating my own menu but i failed realy bad.I can code in c# but im not sure how to place the codes to work with leadwerks and things.

xtremelogo.jpg
Posted
You mean thats for a psp

 

 

Well it was on the PSP Development Forum ....

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Posted

lua is a scripting language that allows you to basically create your own library with it. So each engines implementation of the functions they created in lua to use in lua will be different.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...