diff options
author | Manoj Srivastava <srivasta@debian.org> | 2005-08-11 18:48:32 +0000 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2005-08-11 18:48:32 +0000 |
commit | 3b7bbcb0376675074bf4389c5290aaa34c75efa8 (patch) | |
tree | 7f3fd5b93832fa559a11f5c973164e83811c9640 /lib/help/lua_intr.txt | |
parent | 34bad86cb4b86404352892f789df0e1b2cf6eab4 (diff) |
Imported tome-232-src
Imported tome-232-src
into srivasta@debian.org--etch/tome--upstream--2.2
git-archimport-id: srivasta@debian.org--etch/tome--upstream--2.2--patch-1
Diffstat (limited to 'lib/help/lua_intr.txt')
-rw-r--r-- | lib/help/lua_intr.txt | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/lib/help/lua_intr.txt b/lib/help/lua_intr.txt index cb975114..ccb87067 100644 --- a/lib/help/lua_intr.txt +++ b/lib/help/lua_intr.txt @@ -26,13 +26,13 @@ action, I strongly suggest that you download my example script pack from scripts covered in these help files, they also include the addition of my "hina" race which has a Lua scripted racial power which you might like to look at. There's also a quest which I will be including documentation for as a -tutorial soon. Plus there's all the other lua scripts in the lib\scrpt +tutorial soon. Plus there's all the other lua scripts in the lib\scpt directory to look at. Most of what you see in these files has been learned from those files anyway! The source code is invaluable as well. There's a searchable and browsable version of the latest ToME source code available online at -[[[[[Ghttp://angband.oook.cz/]. Use it! +[[[[[Ghttp://www.t-o-m-e.net/cvs.php]. Use it! If you don't want to download and install the example scripts, then just follow the tutorials with a text editor open! But I'll say it again, it's a lot @@ -72,26 +72,26 @@ clearly. Thus "do the washing up" might be - #####BScrub plates till clean #####BPlace clean plates on rack to dry, -There's still plenty of problems here though, We've not said to turn the tap -off, or what the bowl is, or to wash any dirty cutlery, mugs, saucepans etc -etc. Whilst this might seem fairly obvious to a person, this is how we need -to think when writing programs for computers. +There's still plenty of problems here though. We've not said to turn the tap +off, or what the bowl is, or to wash any dirty cutlery, mugs, saucepans, etc., +etc. Whilst this might seem fairly obvious to a person, this is how we need +to think when writing programs for computers. Lets look now at some of the terms we're going to be using, in the rest of these help files, and what they mean... #####R=== Variables and Constants === A variable is a way to store information in a computer. Just as you store -things in your own memory, you can store things in the computers memory. And +things in your own memory, you can store things in the computer's memory. And just as things change in your memory, so things can change in the computer's memory. This factor of change is why they're called "variables" and not "statics". -For instance, you may have a friends email address committed to memory, but +For instance, you may have a friend's email address committed to memory, but things change over time, they get a new ISP or domain, and so their email address changes. You commit this new address to memory, and eventually forget the old one. The thing you have stored in your memory is the same -(your friends address) but the value(property) of what you have stored has +(your friend's address) but the value (property) of what you have stored has changed (from friend@old-address.com to friend@new-address.com). Variables are the building blocks out of which you will create your patch. @@ -108,15 +108,15 @@ washing up liquid, put the dirty plates into it, and then scrub them till they're clean", we just say "do the washing up". This is where we come to the difference between scripting and programming. -With scripting we can use the functions and variables that exist in the +With scripting we can use the functions and variables that exist in the ToME code. Maintainers like DarkGod have already made sure that the computer knows how to "do the washing up", including turning the tap off and what the bowl is. All we need to do in our script is say "do the washing up". Or to look at it in a more relevant way, the game has been coded so that when a magic missile is fired, a bolt or beam spell with a black line of asterisks will be drawn in the direction indicated by the player, the -mana of that player will be used up, the monster will take the appropriate -amount of damage and so on. All we need to do in our script is say "fire a +mana of that spell will be used up, the monster will take the appropriate +amount of damage, and so on. All we need to do in our script is say "fire a magic missile". As you script, you will still be designing your own functions, and @@ -125,12 +125,9 @@ variables, but the hardest parts have been done for you! Not every function and global variable in the source-code has been exported to use in your scripting. But the ones that have are easily identifiable by looking in any source files with the extension .pkg . Chris Hadgis has written -some excellent documentation which outline the use the most important +some excellent documentation which outline the use of the most important functions in some of these files. They outline the functions from the OK, the first tutorial proper is on *****lua_pow.txt*0[adding a racial power] . [[[[[gThis file by fearoffours (fearoffours@moppy.co.uk)] - - - |