A to Z Scripting: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Dragofer (talk | contribs)
Created page with "''Primary contributor - Dragofer'' This is an in-depth resource for scripting as a mapper in TDM. It assumes no prior knowledge of scripting and is aimed in particular at tho..."
 
Dragofer (talk | contribs)
No edit summary
Line 1: Line 1:
''Primary contributor - Dragofer''
''Primary contributor - Dragofer''
== The A to Z Scripting series ==


This is an in-depth resource for scripting as a mapper in TDM. It assumes no prior knowledge of scripting and is aimed in particular at those (like myself) who prefer to learn by looking at existing examples.
This is an in-depth resource for scripting as a mapper in TDM. It assumes no prior knowledge of scripting and is aimed in particular at those (like myself) who prefer to learn by looking at existing examples.
Line 5: Line 7:
The first sections up to "Practical exercise: subtly teleporting the player" are written more in the style of a beginner's guide, while later sections aim to collect everything related to scripting in one place and out of one hand. So the recommended usage of this resource for a beginner would be to use the initial sections to learn the basics, then gradually acquire the remaining techniques & principles whenever you need something new for what you're trying to do.
The first sections up to "Practical exercise: subtly teleporting the player" are written more in the style of a beginner's guide, while later sections aim to collect everything related to scripting in one place and out of one hand. So the recommended usage of this resource for a beginner would be to use the initial sections to learn the basics, then gradually acquire the remaining techniques & principles whenever you need something new for what you're trying to do.


== Why script? ==
Mappers in TDM are fortunate to have a large selection of entities and systems, such as the objective and stim/response systems, that allow them to access scripted effects. Those systems are already quite powerful, allowing for relatively complex setups without ever writing a single line.
Knowing your way around scripts, however, adds a whole new level of control. While a teleportation entity can only teleport something to a predetermined position, a script can automatically calculate the destination, what to teleport and whether to teleport.
A lot can be said about scripting as this series shows, but as kingsal once said, even "a little scripting goes a long way", giving access to all kinds of new scripted effects and synergising with other systems.
== The A to Z Scripting series ==


{| class="wikitable"
{| class="wikitable"
Line 50: Line 42:
| 15 || [[A to Z Scripting: Troubleshooting]] || Techniques for solving problems; commonly encountered errors.
| 15 || [[A to Z Scripting: Troubleshooting]] || Techniques for solving problems; commonly encountered errors.
|}
|}
== Why script? ==
Mappers in TDM are fortunate to have a large selection of entities and systems, such as the objective and stim/response systems, that allow them to access scripted effects. Those systems are already quite powerful, allowing for relatively complex setups without ever writing a single line.
Knowing your way around scripts, however, adds a whole new level of control. While a teleportation entity can only teleport something to a predetermined position, a script can automatically calculate the destination, what to teleport and whether to teleport.
A lot can be said about scripting as this series shows, but as kingsal once said, even "a little scripting goes a long way", giving access to all kinds of new scripted effects and synergising with other systems.

Revision as of 11:13, 21 December 2020

Primary contributor - Dragofer

The A to Z Scripting series

This is an in-depth resource for scripting as a mapper in TDM. It assumes no prior knowledge of scripting and is aimed in particular at those (like myself) who prefer to learn by looking at existing examples.

The first sections up to "Practical exercise: subtly teleporting the player" are written more in the style of a beginner's guide, while later sections aim to collect everything related to scripting in one place and out of one hand. So the recommended usage of this resource for a beginner would be to use the initial sections to learn the basics, then gradually acquire the remaining techniques & principles whenever you need something new for what you're trying to do.


# Article Contents
1 A to Z Scripting: Anatomy of a script Basic script literacy.
2 A to Z Scripting: More scripting basics Further basics, including how to use the TDM Script Reference.
3 A to Z Scripting: Setting up the .script files How to add scripts to your mission or game.
4 A to Z Scripting: Ways of calling a script Using trigger brushes, objectives and many other ways to initiate scripts.
5 A to Z Scripting: Getting map information Pulling information, such as an entity's location, from the map for use in a script.
6 A to Z Scripting: Practical exercise: subtle teleportation A guided exercise in creating a wizard's tower style teleportation.
7 A to Z Scripting: Scripts that use input variables Giving scripts input so the same script can easily be called on various entities with varying results.
8 A to Z Scripting: Conditionals Making the execution of a script depend on whether conditions are met.
9 A to Z Scripting: Looping a script Various ways of continuously running a script or until a task has been completed.
10 A to Z Scripting: Scripting with... Useful things to know when writing scripts that involve i.e. AIs or sounds.
11 A to Z Scripting: Special methods Running a script on every entity of a certain type or in a volume, spawning entities and more.
12 A to Z Scripting: Scriptobjects Creating entities with scripted behaviours.
13 A to Z Scripting: Utility scripts Writing scripts that are designed to be used like script events.
14 A to Z Scripting: Script addons for players Modifying a player's TDM experience, i.e. by getting rid of all spiders at every map start.
15 A to Z Scripting: Troubleshooting Techniques for solving problems; commonly encountered errors.


Why script?

Mappers in TDM are fortunate to have a large selection of entities and systems, such as the objective and stim/response systems, that allow them to access scripted effects. Those systems are already quite powerful, allowing for relatively complex setups without ever writing a single line.

Knowing your way around scripts, however, adds a whole new level of control. While a teleportation entity can only teleport something to a predetermined position, a script can automatically calculate the destination, what to teleport and whether to teleport.

A lot can be said about scripting as this series shows, but as kingsal once said, even "a little scripting goes a long way", giving access to all kinds of new scripted effects and synergising with other systems.