Jump to content

Lua complete game experience


YouGroove
 Share

Recommended Posts

I was making a small game using Lua with LE3.1 only , and as game grows, it just showed me, LE3 is for C++ mainly, two things that show that :

- C++ language that is not comparable to Lua, specially when your code is really growing

- Visual Studio also far away from text editor

 

Lua is good to make some "side" gameplay or objects interaction or some really small game, not for bigger.

 

Main lacking features of Lua and editor :

- Simple language syntax errors not catched, you have to run the game to see that some "=" or "then" is missing

- Auto completition for language and 3D engine functions and variable names

- language convention : having to write ""Script" or "self" can be tedious

- Auto paragraphs and advanced editing don't exist, yes you have to tab each time it don't do it itself

- No real language class system or structures even if you can do a work around

 

As the small game demo is finished almost, i just see that if i had Visual Studio and C++ i would have put perhaps half time to make it or less.

 

With LE3 , it seems the way to go is C++ and Visual Studio as main programming tools if you want to stay productive and go lot more faster and efficient in programming, specially when your game grows a lot in terms of code.

 

 

EDIT :

Changing from autocompletition editor as Sublime Text 2 , makes a really huge difference.

If i had it when making small game demo, yes i would have avoided lot of writing mistakes and auto completition , would just had made coding ten times faster.

Stop toying and make games

Link to comment
Share on other sites

I didn't like the visual c++ editor at first but I am growing to like it. I don't think c++ is much harder than lua.

 

I don't like code completion or any other interference with proggraming.

I think c++ has a rhythm that sticks in your mind and becomes second nature after a while.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

I don't like code completion or any other interference with proggraming.

 

It will change a lot , having stcutures "if then else" auto completed, engine functions, and even your variable names will make you gain lot of time. The big beneift of Visual Studio, is that you don't need to launch the gmae, compiling errors will be detected before.

 

But C++ itself has nothing to do with remembering function names of objects. That's why intellisense is so great.

I agree that's why i talked about Lua editor that is simple editor and very far from intellisense.

Stop toying and make games

Link to comment
Share on other sites

you are not forced to use the Leadwerks included LUA editor. I like to use Sublime Text for nearly all scripting i do.

Visual Studio is good for C++ though. Too bad the C++ Plugin for Sublime Text is discontinued. Would have liked to try it out.

  • Upvote 1
Link to comment
Share on other sites

@beo6 :

I just tried Sublime Text 2 and compared to LE3 editor it's day and night. It has auto completition for Lua language, all words and variable names you have in your file, seems you can code at light speed with it laugh.png

 

I m' just searching how to manually add autocompletition for highlight keywords ( like GetPosition for example).

Stop toying and make games

Link to comment
Share on other sites

@Rick it's super simple in Sublime Text 2 , just need to find the right example tutorial smile.png

Example of auto complete for getPosition()

 


<snippet>
 <content>
<![CDATA[ GetPosition(${1:object},true) ]]>
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>get</tabTrigger>
<scope>source.lua</scope>
<description>Position of object true = local </description>
</snippet>

 

in this example , you type "get" it will propose your snippet in the auto completition list , it you type enter, it will replacet "get" with

GetPosition( object,true)

And you cursor will be positionned on the word "object" , so you can change it direclty.

(${1:object} means that your cursor will be positionned first in this word, here "object"

<description> : is for the description of the text , here i just put some help to say about the boolean effect in GetPosition

 

Not hard to add mainly used LE3 keywords ans like Visual Studio It speeds up incredibly programming.

A must have tool.

Stop toying and make games

Link to comment
Share on other sites

@Rick it's super simple in Sublime Text 2 , just need to find the right example tutorial smile.png

Example of auto complete for getPosition()

 


<snippet>
 <content>
<![CDATA[ GetPosition(${1:object},true) ]]>
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>get</tabTrigger>
<scope>source.lua</scope>
<description>Position of object true = local </description>
</snippet>

 

in this example , you type "get" it will propose your snippet in the auto completition list , it you type enter, it will replacet "get" with

GetPosition( object,true)

And you cursor will be positionned on the word "object" , so you can change it direclty.

(${1:object} means that your cursor will be positionned first in this word, here "object"

<description> : is for the description of the text , here i just put some help to say about the boolean effect in GetPosition

 

Not hard to add mainly used LE3 keywords ans like Visual Studio It speeds up incredibly programming.

A must have tool.

 

I have already a full autocompletion in my sublime text editor for leadwerks with those snippets also some other fast hacks. sublime text is best editor ever use it also at work and for fun coding.

It doesn´t work... why? mhmmm It works... why?

Link to comment
Share on other sites

The compartmentalization of Lua scripts is really convenient, but yes, C++ is more powerful. My personal preference is to use them both for different tasks.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

When you have some errors, LE3 lua editor opens as this is it that points errors and allows to launch/debug the game.

Sublime Text 2 is really great, but having to switch between LE3 3D editor, LE3 Lua editor and Sublime Text 2 can become somewhat complicated at long.

Would be great to have LE3 Lua editor able to select/launch Sublime Editor or another Lua external editor.

 

Creating LE3 command for Sublime Text can take long time, i wonder if writing a C#wrapper would be as simple declarations ?

Caus if needing to type main LE3 keywords, better put that big work on a C# wrapper instead.

 

Yes Lua at final not only from editor point of view, but from language also is lacking all C++ object style language and Visual Studio editor and pre compiling points.

  • Upvote 1

Stop toying and make games

Link to comment
Share on other sites

Lua is a scripting language. One of the benefits of a scripting language is that you don't have to compile it. It can also be one of it's drawbacks, but that's how scripting languages work. You can do OOP with Lua. You have much more freedom when passing things around between functions. Lua is less strict than C++. My guess is you'll start getting into C++ and come back complaining about how much more difficult it is ;)

  • Upvote 1
Link to comment
Share on other sites

I started with a le3 lua autocompletion for sublime text but haven't finished it. A bad thing is that the auto completion is not context sensitive. And i might have been a bit too extreme in describing the parameters of the le3 lua methods.

 

Will see that i share it. Maybe i will even continue with it.

 

Edit: switching is not so hard yougroove. ;).

 

Just press ALT+Tab to the editor, press CTRL+G and enter the line number Leadwerks complained about. Change and save and switch back with alt+tab. :)

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