Jump to content

LUA and me...


cocopino
 Share

Recommended Posts

I've just started with LUA about two weeks ago (trying to code a cable solution inside the editor). I have to say.... I hate it.

I can code (modestly) in several languages, as long as I have a decent IDE at my disposal. But:

 

- Saving with Ctrl+S often leaves an "s" somewhere in my code

- indentation isn't copied when using newline/enter

- I can't use Shift+tab to decrease indentation

- Using Ctrl+Z multiple times in a row will delete ALL code; you have to thread really carefully not to lose large chunks of code

- Using Ctrl+Z on a freshly opened script will delete ALL code

- Any mistake of using a non valid object (which happens all the time because LUA doesn't define variable types) will result in a complete editor crash without warning about line number.

- Debugging takes forever having to use Print/Notify every other line

- When using Blitzmax/C#/whatever as main language and LUA as scripting language, any mistake like previous will stop all other LUA scripts from being executed. So one mistake in any object script might, for instance, stop my scene from having a skybox or directional light (I've seen this happening)

- no intellisense or autocomplete

 

And I might even forget to mention some other issues I've had in just a couple of days time...

 

It very much looks like the LUA way is the only way this engine will go and I know how hard it is to create a reasonable text editor.

Is/will there a possibility to use our own/third party IDE and send a message to the editor that a script has been updated?

desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP

laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32

Link to comment
Share on other sites

What I mean is, the "old" ways of coping with objects in your scene (processScene, ini files etc) have been deprecated in favor of LUA. It very much looks like Josh is hoping/trying for us to go the LUA route.

 

Frankly, I do believe that scripting can be a good thing if used correctly. But this editor and lack of solid debugging makes me want to pull my hair out. I've encountered several issues when doing a really small project. Imagine doing a project (like yours?) with a hundreds of objects, when each and every script can make the game collapse without warning where to look.

 

I think I'll create my own processScene, with custom object loading/initialization and just leave LUA be for now.

desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP

laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32

Link to comment
Share on other sites

I actually agree about the whole Lua thing. It's kind of a pain to work with because the editor isn't that great. That thing used to crash on me when I've press to many tabs in a row. I was trying to convince Josh to do the .NET route, but I don't think I was successful. With visual studio you can actually make your own standalone editor that is like visual studio but customized for your needs. He could distribute something like that just for the .NET scripting and it could be smaller and more specialized than just normal visual studio.

Link to comment
Share on other sites

This is why I've completely igored LUA so far. I would like a scripting language to use in the traditional sence of simply using it to code game play and NPC behaviours but will probably write my own LUA implementation for that exposing all my lower level functionality like the state machine and pathfinding/AI routines.

 

Trying to write a game engine using LUA as it currently stands is a complete non starter for me!

 

I've already made my feelings known about the depreciation of previously existing functionality to force users down the LUA route!

 

I guess its 'horses for courses' ... it really depends on what people want to do. The current LUA implementation is great for object scripting and so long as you keep the scripts simple then the lack of a professional IDE and debugging tools is not such a problem.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I am on board with this entirely. Although I use Lua for my game projects and although I love the simplicity for game scripts: it is the complete opposite when working with class/object scripts. I have been using Lua for 8 months now but when it comes to class scripting I am still machetting my way forward. As I am more of a 'trial and error' guy, I have had my share of editor crashes. There are several failures when it comes to Lua class scripting. Cocopino mentioned most of them.

 

- no line information with error.

- The entire editor crashes. Meaning that when you have a sbx saved and you crash: you can not open your scene. You will have to look up the lua script and edit it further from there.

- selection commenting out.

- selection tab indent/backwards indent.

 

I personally think that Lua is good for ingame scripting, but at the moment it just doesn't feel right. People who have some experience with Unity know that the connection between scripts and objects can be very easy. This 'connection' is missing with Lua atm.

Link to comment
Share on other sites

  • 5 weeks later...

I don't understand if the problem is LUA language or LUA IDE/Editor.

LUA is a great language, sometimes not so clean, but VERY FAST, and so much used for hi-speed jobs. Furthermore LUA is a scripting language, much easier than other compiled languages like C or C++.

It is easily embeddable in other programs also. Many BIG COMMERCIAL games use Lua as scripting language (C/C++ and LUA).

 

If the problem is the editor... well, you can quickly find several for editors IDE in internet (someones are free, other ones are commercial).

 

http://www.zeusedit.com/lua.html

http://luaedit.luaforge.net/download.html

http://www.blide.org/

http://notepad-plus-plus.org/

http://lua-users.org/wiki/LuaEditorSupport

http://www.scriptdevelop.com/

http://code.google.com/p/fxite/

http://www.jedit.org/

http://sourceforge.net/projects/blua/

http://lua-studio.luaforge.net/

 

And more..... :-)

Link to comment
Share on other sites

The problem is not LUA but the way LUA is implemented.

 

1. The built-in script editor is bad. Yes, I use a separate "IDE" (Notepad ++) but to get it working I need to close and reload the script in Sandbox every time I make a change to make it work.

 

2. I want to know why, and even more importantly, where my script is crashing. A report saying "mymodel.lua crashed on line 86" would be the bare minimum.

 

3. When one of my scripts has crashed, this should not be able to effect any other scripts. If a model's script is failing this should not affect the loading of my scene or any other scripts. (This would be less of a problem of course if I actually knew what caused the failure in the first place, see point 2.)

desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP

laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32

Link to comment
Share on other sites

Hello,

 

as many other programmers, I'm always looking for "the perfect text editor". Well, I used several editors (even to write LUA apps), but everyone seems "another copy" of the others. It seems every new editor includes the same functions of other editor.

I haven't a Mac, but I was surprised to see Textmate.

But... just s couple of days ago, I finally found "my perfect editor"! It is called "Sublime Text":

 

http://www.sublimetext.com

 

It works in Windows, contains many functions found in any traditional editor plus Textmate.

But it has some absolutely incredible functionalities! I really love it.

Even if it is not free (it is not so cheap also!), it is really amazing. Look at these functions:

 

http://www.sublimetext.com/support

 

I just bought it!

 

Cheers!

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...