Jump to content

Before i buy leadwerks i have questions.


howdoyou
 Share

Recommended Posts

1. Do i need to know any C/C++ to program with leadwerks? or can i just use the editor, and lua's basic script coding?

 

2. I cant find any information about this: When i am done with something i have made with leadwerks, how do i compile and distrabute? All i can find is information about compiling lua files into some other type of lua file... How do i get my stand alone EXE for distrabution?

 

3. When you are programming a game with leadwerks + lua, and you write a seperate script file for each entity so everything works the way you want, where do you put your coding for the actual game? I don't get it? is there a MAIN.lua or something?

 

Please help me out, i've been doing all the reasearch i can trying to figure this stuff out but it really is quite confuseing.

Link to comment
Share on other sites

1. You can just use the editor and lua.

 

2. There already is an exe that takes a main lua file. So you can create a shortcut where you call this main exe passing in the main lua file to start the game.

 

3. Yes there is a main lua file that starts everything. Even in the editor. This main lua file is configurable so you can point it to any lua file.

Link to comment
Share on other sites

I can program lua, thats easy, and i have an artist that is great at textures, and modeling.

 

Can we all work together on the same project with ease?

Is that how it works?

 

I use lua to script each object, and the main project code,

and my artist uses the visual leadwerks editor to drop in and place his objects with my code? Will this work?

 

Also, for my #2 question on the orignal post, you said:

There already is an exe that takes a main lua file. So you can create a shortcut where you call this main exe passing in the main lua file to start the game.

 

so when i distrabute the game, i compile ALL of my lua scripts for each object, and the main lua script, and drop them in the same folder as the engine.exe file, then the end user runs engine.exe and each of these compiled lua scripts work together? :lol: Am i way off?

Link to comment
Share on other sites

1. You can't really work in the editor at the same time, but basically you write Lua code for models. That's one way to approach it. When I was doing it I approached it slightly different, and if you do a search for "Thingoids" on the forums (when you get access after you buy LE) you can see how I was doing things. As a Lua programmer I created functionality Lua objects that a level designer could just plug in. For example I created a Lua object script that handled 3rd person functionality. All Lua files need to be attached to models, but I attached these functionality Lua scripts to just nothing models (models that aren't shown in game). Each model can have links to other models, so I used that as a way to link my functionality Lua scripts to actual in game models. For example in my 3rd person camera functionality script, the first link for that will be the character model. When the game starts, that 3rd person functionality script will give 3rd person camera controls on that first link. I then made a character control script that allowed you to configure the movement keys and when it was linked to will be what's moved. This is just one way to handle things. You can also just have your main Lua script do everything.

 

 

2. You are correct. In your shortcut you pass your main lua script as an argument to engine.exe and when the user dbl clicks your shortcut it'll start running your main lua script.

Link to comment
Share on other sites

When you are making your game with Lua you have 2 different Lua script types:

- Game scripts

- object scripts

 

The object scripts are the one that you place in a folder which an object/model is going to use in your scene/editor.

 

The game scripts are the scripts that start your game, control the movement, GUI stuff etc. Although it is possible to let object scripts run several of these subjects.

When you have a game project you should have the engine.exe in the root together with a start.lua or start.luac (compiled)

file. When you run the engine.exe, it is automatically going to look for a start.lua or start.luac file. You can rename the engine.exe to something else.

 

Have a look at the Lua introduction tutorial to see how this works:

http://leadwerks.com/werkspace/index.php?/page/resources/_/programming/lua/1-introduction-to-lua-scripting-r23

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