User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

lgscript:index [2009/09/04 00:09]
telliamed logo
lgscript:index [2013/01/23 08:32]
Line 1: Line 1:
-====== LgScript ====== 
-{{ lgslogo1.jpg |So easy a Dromeder can do it}} 
-> :?: Like the logo? Other slogans could be "So easy a pagan can do it." or "So easy even Benny can do it." ​ 
-> I've also tried a different layout in [[http://​​doku/​_media/​lgscript/​lgslogo1b.jpg|lgslogo1b.jpg]]. 
-__LgScript__ is a custom script module for __Thief__, __Thief 2__, and __System Shock 2__. With it you can create your own scripts using a Lua-like((Mostly the same as regular __Lua__, but with a few extensions. And the ''​io''​ and ''​os''​ libraries are disabled.)) language. 
-===== Example ===== 
-A simple script might looks like this. 
-### I should add "​lgscript"​ to the list of languages 
-<code lua> 
-function SlashStimStimulus(message) 
-    local link = lgs.LinkSrv.GetOne("​ControlDevice",​ script.objid) 
-    local dest = lgs.LinkToolsSrv.LinkGet(link) 
-    lgs.DamageSrv.Damage(dest,​ 0, message.intensity / 2, message.stimulus) 
-    return true 
-In plain English, this means: 
-  - Listen for the message ``SlashStimStimulus``. An object gets this message when a receptron action is ''​Send to Scripts''​. 
-  - Get the destination of a ``ControlDevice`` link. 
-  - Damage the linked object with half the strength of the stimulus. 
-===== Download ===== 
-  * {{}} 
-The first thing you want to do when you unpack the archive is to run the ''​QuickTour.bat''​ file. This will introduce you to the __Lua__ language and some of the extensions provided by __LgScript__. The interactive interpreter ''​lgscript.exe''​ can be used to test your scripts. However, the services available when using scripts in-game aren't in the interactive interpreter. NOTEME Eventually there will be an emulated environment for simulating a script running in the game. 
-The other files in the archive are ''​lgs.osm''​ which is the script module that you copy to the game directory. In the ''​scripts''​ folder is an example of a complete script. In your fan-missions,​ you will include the OSM and any necessary scripts. 
-===== How to Use ===== 
-> FIXME Please read and critique all of these tutorials. 
-The [[lua|language reference]] describes __Lua__ as implemented by __LgScript__. Read it if you have never used a programming language before, or are unfamiliar with __Lua__. 
-To begin writing scripts for games, read [[Getting Started]], then the script examples: 
-  * [[First Script]] 
-  * [[Second Script]] 
-  * [[Third Script]] 
-Useful references when writing scripts: 
-  * [[messages]] 
-  * [[services]] 
-  * {{}} Lists of property, link, and receptron data with the fields and types you can use. 
-===== Feedback ===== 
-  * [[bugs]] --- Add information about problems or feature requests to this page. 
-  * [[faq]] --- Ask questions. Maybe even answer some if you can. 
-  * [[tips]] --- Share helpful tips and sample scripts for others to learn from. 
-===== External Links ===== 
-  * [[http://​​]] 
-  * [[http://​​FAQ/​|Unofficial Lua FAQ]] 
-  * [[http://​​frs/?​group_id=377|Lua for Windows]] 
-  * [[http://​​SciTE.html|Scintilla Text Editor]] 
lgscript/index.txt · Last modified: 2013/01/23 08:32 (external edit)