Jump to content

Lua Editor


Rick
 Share

Recommended Posts

I feel like the Lua editor could use a new look to be more efficient. I think the windows on the right side (Output, Warnings, Errors, Debug) should be along the bottom and able to be hidden.

 

In their place I feel the Script directory structure should be displayed so that we get a view of the project scripts all in one place and can more easily switch between our files. When I created my game I put everything under App: because it's so much faster and more efficient than going back and forth to the editor and opening every file I want to work in so they show up as tabs. This would also put the Lua editor more on par with vs/xcode.

 

 

What else might be cool would be a Create Class Wizard that creates a Lua class in it's own file automatically for us where we give the class name. Much like VS does. This would help keep code consistent since there are a few ways to create classes in Lua.

Link to comment
Share on other sites

  • 3 weeks later...

Missed this, but in LE2 the way I was doing classes was:

 


Bubble = {}
Bubble_mt = {}

Bubble_mt.__metatable = Bubble
Bubble_mt.__index = Bubble
Bubble = setmetatable(Bubble, Bubble_mt)

function Bubble:New()
local obj  = {}
table.CopyFromTo(self, obj)

--obj.color = color
obj.sphere  = CreateSphere(32)
--obj.sphere:SetKey("color", colorNumber)
--obj.tmrTurnOff = Timer:New(250)
--obj.tmrTurnOff:AddEventHandler(obj, self.TurnOff)
obj.sphere:SetScalef(.125, .125, .125)
obj.sphere:SetColor(Vec4(1, 0, 0, 1))

return obj
end

function Bubble:Update()
--self.tmrTurnOff:Update()
--self.sphere:Turnf(1, 1, 1)
end

function Bubble:TurnOn(silent)
--if silent == false then
--PlaySound(self.sound)
--end
--PaintEntity(self.cube, self.onMaterial)
--self.tmrTurnOff:Start()
end

function Bubble:TurnOff(tmr)
--PaintEntity(self.cube, self.offMaterial)
--tmr:Stop()
end

 

 

A template for new classes could be made very easily like this with a "Create Class" option for the Lua editor. Could help the Lua programs from making everything global and all in 1 file. When games start getting bigger in Lua and aren't using the entity scripts, using classes like this will help organize it better.

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...