How to get started with embedded scripts?

I am working on a game in C ++. I was told, however, that I should also use an embedded scripting language such as Lua or Angelscript, but to be honest, I have no idea how or why. What benefits would I bring by saving all my data in some kind of text file? How do i get started? I tried to read some Lua examples, but I don’t see how this works, or how exactly I should use it.

+3
source share
3 answers

First the question is “ why ”:

If you have made reasonable progress so far, you have a game landscape where the action takes place, and then some kind of graphical interface with visible game controls: maps, compass, hot keys, chat window, whatever.

If you create a GUI (positions, sizes, settings, default settings, etc.) that can be configured through a configuration file, this is normal for starters. But if you make it code-driven, you can do a lot of very cool things. Example. Minimize the map when entering the city. Show portraits of other players in the group. Refresh the map. Display various hotkeys in battle. Something like that.

- C/++, , , , , dang. , . . , , GUI.

. , . , GUI .

:

() Lua "" , , , , , . , , , , ; , C/++.

, Lua . Lua C, (DLL) Windows. , , .

+4

, . , (, orc - ) ..

, ++. //, , .

, , , . , TOME, RPG Roguelike, C, Lua.

+3

, C2.

, ? , , ,

+1

Source: https://habr.com/ru/post/1725446/


All Articles