Lua:Libarylinks: Difference between revisions

From Spring
Jump to navigationJump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Lua]]
== Lua libraries ==
== Lua libraries ==
Many things you need for spring-lua scripting,  
 
have been allready implemented and tested by others. It is considered good practice in allmost every software project to not reinvent the wheel.
Many things you need for springs  lua scripting, have been allready implemented and tested by others. It is considered good practice in allmost every software project to not reinvent the wheel. This statement does in no way imply you are unable to code this, but that you rather invest your time into not fixing the same bugs others found before you.
Other Projects have created lua-Librarys, lua files which you can include after copying (or referencing them on GitHub) into your project:
Other Projects have created lua-Librarys, lua files which you can include after copying (or referencing them on GitHub) into your project:


Line 16: Line 18:


=Journeywar =
=Journeywar =
Quality: Poor
Quality: Average




Line 40: Line 42:
=S44=
=S44=
Quality: Unknown
Quality: Unknown
https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/api_vector.lua
https://github.com/spring1944/spring1944/blob/master/LuaRules/Includes/utilities.lua


=BAR=
=BAR=
Quality: Unknown
Quality: Unknown

Latest revision as of 19:03, 13 September 2015


Lua libraries

Many things you need for springs lua scripting, have been allready implemented and tested by others. It is considered good practice in allmost every software project to not reinvent the wheel. This statement does in no way imply you are unable to code this, but that you rather invest your time into not fixing the same bugs others found before you. Other Projects have created lua-Librarys, lua files which you can include after copying (or referencing them on GitHub) into your project:

To use them in lua Units-scripts, download them into the same folder the Unitscript resides in and add

include "LibraryFileName.lua"

The referenced functions are now available. Many Librarys also include a Headerfile of all Functions made available.

If you want to include a Lua-Function into your gadget or widget

VFS.Include("Gamefolder/Relative/Path/ToLibrary/Library.lua

Librarys

Journeywar

Quality: Average


Table and UnitScript Operations

https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_TableOp.lua?at=master

Library for Procedural Units and Buildings from Pieces

https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_Build.lua?at=master

Miniature Operatings Systems and Statemachines

https://bitbucket.org/PicassoCT/journeywar/src/scripts/lib_OS.lua?at=master

Zero-K

Quality: Unknown


https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/constants.lua https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/pieceControl.lua

S44

Quality: Unknown

https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/api_vector.lua https://github.com/spring1944/spring1944/blob/master/LuaRules/Includes/utilities.lua

BAR

Quality: Unknown