-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
201 lines (167 loc) · 12.7 KB
/
index.html
File metadata and controls
201 lines (167 loc) · 12.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Main Index</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css" />
</head>
<body>
<a name="top"></a>
<div id="container">
<div style="background-color:#f0f0f0" id="main">
<div style="background-color:#f0f0f0" id="navigation_left">
<br/>
<h1 class="navigation_header"><i>Script Documentation</i></h1>
<strong> > Games Homepage</strong>
<!-- <h2 style="background-color:#e7e7e7">Search</h2>
<ul>
<form id="search" class="search_form" onsubmit="return false">
<input class="search_input" type="text" placeholder="Search.."/><br />
<div id="search_dropdown" class="search_dropdown"></div>
</form> <h2 style="background-color:#e7e7e7">Game Areas</h2>
<ul>
<li><a href="campaign/campaign_index.html">Campaign Index</a></li>
<li><a href="battle/battle_index.html">Battle Index</a></li>
<li><a href="frontend/frontend_index.html">Frontend Index</a></li>
<h2 style="background-color:#e7e7e7">Script Topics</h2>
<ul>
<li><strong> > Main Index</strong></li>
<li><a href="scripted_events.html">Scripted Events</a></li>
<li><a href="ui_scripting.html">UI Scripting</a></li>
</ul> -->
<h2 style="background-color:#e7e7e7">On this page</h2>
<ul>
<li><a href="#class:index">Main Index</a></li>
<!-- <ul>
<li>  <a href="#section:index:How To Use This Documentation">How To Use This Documentation</a></li>
<li>  <a href="#section:index:About Scripts">About Scripts</a></li>
<li>  <a href="#section:index:Lua">Lua</a></li>
<li>  <a href="#section:index:Game Environments">Game Environments</a></li>
<li>  <a href="#section:index:Script Events">Script Events</a></li>
<li>  <a href="#section:index:Game Interfaces">Game Interfaces</a></li>
<li>  <a href="#section:index:Script Output">Script Output</a></li>
<li>  <a href="#section:index:UI Scripting">UI Scripting</a></li>
<li>  <a href="#section:index:Multiplayer Scripting">Multiplayer Scripting</a></li>
</ul> -->
</ul>
</div>
<div style="background-color:#f0f0f0" id="navigation_right">
</ul>
</div>
<div id="content">
<a name="class:index"><h1 class="content_header">Main Index</h1></a>
<p>This is the front page for the guide to scripting in Total War. On the page below you will find useful links to get you started. Welcome!</p>
<p>Note: This page was written/edited. by Vandy, while the rest of these documents are created by Creative Assembly. Any community resources (and the ownership/credits therein) will be labeled as such.</p>
<div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:Documentation Links"><h2 class="section_header">Documentation links</h2></a>
</div>
<p>Click below to get the individual game scripting documents (BY CA).</p>
<ul style="margin-left: 20px;">
<p><li><a href="WH3/index.html">Warhammer III</a>
<ul>
<p><li><a href="WH3/cco/documentation.html">CCO Documentation</a></li></p>
<p><li><a href="WH3/scripting_doc.html">Events & Interfaces Documentation</a></li></p>
<p><li><a href="WH3/ui_callback_documentation.html">UI Callback Documentation</a></li></p>
</ul>
</li></p>
<p><li><a href="WH2/index.html">Warhammer II</a>
<ul>
<p><li><a href="WH2/scripting_doc.html">Events & Interfaces Documentation</a></li></p>
</ul>
</li></p>
<p><li><a href="3k/scripting_doc.html">Three Kingdoms</a></li></p>
<p><li><a href="Troy/index.html">Troy</a></li></p>
<p><li><a href="Pharaoh/index.html">Pharaoh</a></li></p>
</ul>
<p>Community resources:</p>
<ul style="margin-left: 20px;">
<p><li><a href="https://www.tw-modding.com">The Total War Modding Wiki</a></li></p>
</ul>
<!-- <p><li>Pages reated to campaign scripting feature a <span style="background-color:#ffed8c">yellow</span> navigation bar.</li></p>
<p><li>Pages related to frontend scripting feature a <span style="background-color:#ffc8a8">pink</span> navigation bar.</li></ul></p>
<p>When viewing a page within a particular environment the main homepage of this documentation can be reached by clicking the <span class="boxed">Scripting Homepage</span> link that is shown at the top of the navigation bar.</p>
<p>Links to other pages within the same environment are shown within the <span class="boxed">Code Pages</span>, <span class="boxed">Script Pages</span> or <span class="boxed">Script Topics</span> sections of the navigation bar. Pages are sometimes duplicated betwen environments where appropriate.</p>
<p>The <span class="boxed">On This Page</span> section on the navigation bar lists sections on the page currently being displayed.</p>
<div class="section_body">
</div> -->
<!-- <div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:About Scripts"><h2 class="section_header">About Scripts</h2></a>
</div>
<p>Scripts are programmatical instructions that may be loaded and run by the game in order to modify its behaviour. Scripts are easier to read and write than game code, but execute more slowly and are limited in what game information they can access. By writing scripts, designers can do complex logical tests on the game state and then execute instructions based on the results of those tests.</p>
<div class="section_body">
</div>
<div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:Lua"><h2 class="section_header">Lua</h2></a>
</div>
<p>Scripts in all Total War games since Empire have been written in Lua, version 5.1. This is a fast and lightweight interpreted language that is commonly used in videogames.</p>
<p>More information about the language is given on our dedicated page about Lua here: <code><a href="campaign/lua.html#class:lua">lua</a></code>.</p>
<p>You may also learn about the language by following tutorials on lua-users.org. Follow the link to the Tutorial Directory on this page: <a href="http://lua-users.org/wiki/LuaTutorial">http://lua-users.org/wiki/LuaTutorial</a></p>
<p>The official Lua 5.1 reference manual may be found at the following page. It is thorough, albeit daunting for the uninitiated: <a href="http://www.lua.org/manual/5.1/manual.html">http://www.lua.org/manual/5.1/manual.html</a></p>
<p>Finally you may wish to bookmark this page, which allows you to try running fragments of Lua without having to install an interpreter: <a href="https://www.lua.org/demo.html">https://www.lua.org/demo.html</a></p>
<div class="section_body">
</div>
<div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:Game Environments"><h2 class="section_header">Game Environments</h2></a>
</div>
<p>There are three main game environments in Total War games: the frontend, campaign and battle. All three support running Lua scripts in the background to modify game behaviour. There are many similarities in the way scripts work in these three environments, although there are many differences also. You may visit the homepages for each of the three main game modes here:</p>
<p><code><a href="frontend/frontend_index.html#class:frontend_index">frontend_index</a></code></p>
<p><code><a href="campaign/campaign_index.html#class:campaign_index">campaign_index</a></code></p>
<p><code><a href="battle/battle_index.html#class:battle_index">battle_index</a></code></p>
<div class="section_body">
</div>
<div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:Script Events"><h2 class="section_header">Script Events</h2></a>
</div>
<p>The game can notify scripts of changes in the state of the game by triggering script events. Scripts can listen for these events by registering lua functions to be called when a particular event occurs in order to respond to changes in the state of the game. Examples of available events include <code>FactionTurnStart</code>, <code>PanelOpenedCampaign</code>, <code>CharacterCreated</code> and <code>ComponentLClickUp</code>. In addition to triggering the event and calling the registered script listeners, the game also provides a context object to each listener which may be queried by the listener script to find out more information about the event.</p>
<p>For more information about script events see the dedicated page here: <code><a href="scripted_events.html#class:scripted_events">scripted_events</a></code></p>
<div class="section_body">
</div>
<div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:Game Interfaces"><h2 class="section_header">Game Interfaces</h2></a>
</div>
<p>Each game environment - frontend, battle and campaign - provides interface objects to which the script may make calls to query or modify the state of the game. For more information see the <code><a href="frontend/frontend_index.html#class:frontend_index">frontend_index</a></code>, <code><a href="campaign/campaign_index.html#class:campaign_index">campaign_index</a></code> and <code><a href="battle/battle_index.html#class:battle_index">battle_index</a></code> pages.</p>
<p>The <code><a href="campaign/effect.html#class:effect">effect</a></code> object is available in all game environments and can be used to query or modify information that crosses game modes (such as advice, difficulty level, and tweaker states).</p>
<p>The script libraries also provide significant extra functionality and quality of life improvements in each of the game modes.</p>
<p><img alt="game interfaces" src="images/game_interfaces.png" \></p>
<div class="section_body">
</div>
<div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:Script Output"><h2 class="section_header">Script Output</h2></a>
</div>
<p>Lua scripts can write text output to various debug console spools. These output spools are written to a series of tabs on the game console during development.. Be sure to check this console output while debugging scripted content to gain a better understanding of what the script is doing.</p>
<p>Script output can be enabled in the release version of the game, where no console is available, by create a file in the root of the <code>data/script</code> folder called <code>enable_console_logging</code>. If this file exists, all console output from script is written to a text file in the game's binaries folder.</p>
<p>For more information about outputting to the console see here: <code><a href="campaign/global.html#section:global:Output">Output</a></code></p>
<div class="section_body">
</div>
<div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:UI Scripting"><h2 class="section_header">UI Scripting</h2></a>
</div>
<p>The UI provides significant support for scripts to query or modify the state of uicomponents, which are the building blocks of the user interface. The UI hierarchy of uicomponents may be browsed in script, and, once a handle to it has been obtained, the state of an individual uicomponent may be queried or modified through the uicomponent interface. The ui scripting interface is provided in all game environments.</p>
<p>More information about UI Scripting may be found here: <code><a href="ui_scripting.html#class:ui_scripting">ui_scripting</a></code></p>
<div class="section_body">
</div>
<div>
<a style="float:right;" href="#top">Back to top</a>
<a name="section:index:Multiplayer Scripting"><h2 class="section_header">Multiplayer Scripting</h2></a>
</div>
<p>Scripts can be run in multiplayer mode, although there are significant considerations that must be taken into account when creating multiplayer script in order to make script multiplayer-safe. Script that is not multiplayer-safe may diverge when run on different machines in the same game, which can cause a desync.</p>
<p>Check the UI scripting homepage here to read more information about creating multiplayer-safe scripts.</p>
<div class="section_body">
</div> -->
</div>
</div>
<div id="about">Last updated 07/02/21 06:39:15</div>
</div>
<script src="searchdata.js"></script>
<script src="search.js"></script>
<script>const page_env = "Script"; const path_to_document_root = "";</script>
</body>
</html>