slopx.blogg.se

How to use notepad++ for lua
How to use notepad++ for lua















What do I then need to do about it? Check against Lua_SyncedCtrl (synced) and Lua_UnsyncedCtrl (unsynced).What information will I need to know about the game state? Check against Lua_SyncedRead (synced) and Lua_UnsyncedRead (unsynced).When do I need the engine to tell me something has happened? Check against Callins.To work out if some idea is possible you need to ask What can't Lua do in the current version of Spring? To see which of the lua environoments has access to which data/functionality, see Lua:Environments#Interfaces and Lua:Callins. Intended for mappers, there is also LuaGaia, which behaves like LuaRules but is separated from it. Gadgets can include both synced and unsynced code, and must be bundled inside the game. LuaRules: Addons in here are often called gadgets.They can be bundled inside the game, or loaded from the users "Spring/LuaUI/Wigets" directory. Clients can (if the game permits it) control which widgets are running. LuaUI: Used for unsynced GUI related code.Inside each Lua environment, developers can write addons, which are self-contained pieces of code. Spring allows various Lua Environments, each with differing functionality.

how to use notepad++ for lua

What is the difference between LuaUI, LuaRules, widgets and gadgets?

#How to use notepad++ for lua code#

But, code that warned a player when one of their own units was getting near a cliff edge, would need to be unsynced. Typically, this means the user interface.įor example, lua code to make units explode if they fell down a cliff would need to be synced. Unsynced code is code that will run differently (or maybe not at all) on each connected client. In practice, this means code which controls the game state. Synced code is code that runs, identically and at the same time, on every connected client. What is the difference between unsynced and synced lua code? For example, when you call Spring.GetUnitTeam(unitID), the engine returns the teamID of the unit identified by "unitID". For example, the widget:Initialize() call-in is run by Spring when the widget is loaded.Ĭall-outs are functions defined in Spring you can run at whichever moment you desire.

how to use notepad++ for lua

There are also IDEs able to work with Lua, such as Eclipse, if you look for them.Ĭall-ins are functions defined in your script that Spring calls when a determined event takes place. Discussion of lua coding takes place on the lobby in #moddev and #lua, and there is also a Lua sub-forum.Īny text editor is enough.

how to use notepad++ for lua

You can find documentation of Springs Lua API on the Lua_Scripting page. Once you're a pro, have a look at the game repos here, especially their /luaui/Widgets and /luarules/gadgets dirs. You can start by reading general Lua tutorials here.Īfter that, you could look at the example widget here, and try to add some functionality of your own!

  • 11 Why does the print function seem to do nothing?.
  • 10 Can I reload a script without restarting Spring?.
  • 7 What can't Lua do in the current version of Spring?.
  • 6 What is the difference between LuaUI, LuaRules, widgets and gadgets?.
  • 5 What is the difference between unsynced and synced lua code?.














  • How to use notepad++ for lua