aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-18 10:31:59 +1000
committerDavid Walter Seikel2014-05-18 10:31:59 +1000
commite86401dc71cfb8e9d6f2dc693f90bf20f27daf01 (patch)
treeb0a6edc921fc7669d11d6e37a282b5dc5b08964a
parentllDialog() implementation almost complete. (diff)
downloadSledjHamr-e86401dc71cfb8e9d6f2dc693f90bf20f27daf01.zip
SledjHamr-e86401dc71cfb8e9d6f2dc693f90bf20f27daf01.tar.gz
SledjHamr-e86401dc71cfb8e9d6f2dc693f90bf20f27daf01.tar.bz2
SledjHamr-e86401dc71cfb8e9d6f2dc693f90bf20f27daf01.tar.xz
Big llDialog() TODO--, and embedded Lua in LSL TODO++.
-rw-r--r--docs/README.LuaSL212
1 files changed, 13 insertions, 199 deletions
diff --git a/docs/README.LuaSL b/docs/README.LuaSL
index b44b787..69bb45c 100644
--- a/docs/README.LuaSL
+++ b/docs/README.LuaSL
@@ -38,6 +38,18 @@ future.
38 38
39THIS IS WHERE WE ARE RIGHT NOW. 39THIS IS WHERE WE ARE RIGHT NOW.
40 40
41Should implement embedded Lua somehow. Probaly the best thing to do is
42to have comments like -
43
44//Lua: local t = {1, 3, 42, x='something', 'something else}
45/*Lua: print(t.x) */
46
47The LSL parser picks these up and stores them in the AST as Lua
48snippets, then the compiler output functions just inserts them in the
49Lua code it is generating. Obviously these Lua snippets can access the
50rest of the generated Lua code. They should also be able to access
51skang and thus do proper GUI stuff on viewers that support skang.
52
41Nails will be used to pump commands in and out of the LuaSL system. 53Nails will be used to pump commands in and out of the LuaSL system.
42Incoming commands invoke LSL events via the LuaSL state metatable. LL 54Incoming commands invoke LSL events via the LuaSL state metatable. LL
43and OS functions that impact the world will be converted to nails 55and OS functions that impact the world will be converted to nails
@@ -98,202 +110,4 @@ etc.
98Performance testing will have to be done on 5000 scripts, to see how 110Performance testing will have to be done on 5000 scripts, to see how
99that compares against XEngine. 111that compares against XEngine.
100 112
101 113The test harness became the love world server.
102The next goal.
103--------------
104
105The next goal is to support llDialog() in extantz. Extantz has enough
106GUI infrastructure now to support a window with a bunch of buttons.
107LuaLSL has always used MLP as the test scripts, which in turn reads some
108note cards and pops up llDialog to suit. I think I have enough bits to
109get this all linked up, or at least start to, and see what missing bits
110there are.
111
112
113 Just off the top of my head -
114 -----------------------------
115
116MLP uses llGetInventory*() functions to find out what note cards are in
117the objects inventory. Then uses llGetNotecardLine() to read the
118notecards. In response, the server sends dataserver events with each
119line, and the system loops until all lines are read.
120
121MLP sets up a listener with llListen(), then uses llDialog() to send a
122"menu" to the client. The client sends a channel message back to the
123server when the user makes a choice. These go to the listen event.
124
125
126 In "reality" -
127 --------------
128
129LuaSL
130 starts up
131 opens an Ecore_Con TCP server at 127.0.0.1:8211
132 sets up the compiler
133 starts luaproc worker thread system
134 waits for input
135 compile() -> compile the script, report warnings and errors
136 run() -> create new Lua state, put it on the worker queue
137 exit() -> shutdown
138 * -> send to SID Lua state
139
140LuaSL_test
141 starts up
142 connects to LuaSL server
143 loops through Test sim/objects looking for *.lsl
144 generates random SID
145 sends "SID compile file.lsl" to LuaSL
146 deal with returned results
147 PW warnings
148 PE errors
149 if compiled send "SID run()" to LuaSL
150 for various llGet*() functions, return random data to LuaSL
151 This includes the llGetInventory*() functions mentioned above.
152 waits for a few seconds
153 sends pretend touch events to LuaSL
154 sends quit() to LuaSL
155 sends exit() to LuaSL
156
157Test sim/objects
158 onefangs test bed
159 the usual MLP style scripts
160 .MENUITEMS
161 .POSITIONS
162 ball object
163
164MLP
165 ~run
166 llSay() to balls telling left over ones to die
167 llGetOwner()
168 loop through an internal list of script names
169 llGetInventoryType() to check if they are there and are scripts.
170 llSetScriptState() to stop them
171 llResetOtherScript()
172 llOwnerSay() to let owner know MLP is turned off
173
174 touch_start()
175 llDetectedKey() to check if it's the owner (current version of MLP doesn't do this)
176 switch to run state
177
178 run state
179 loop through scripts again, turning them on this time.
180
181
182 ~memory
183 llGetInventoryNumber() to count the notecards
184 llGetInventoryName() to find .POSITIONS cards
185 llGetNoteCardLine()
186
187 dataserver()
188 llGetNoteCardLine()
189 change to state on when finished
190
191 on state
192 llMessageLinked()
193
194 link_message()
195 llWhisper()
196
197
198 ~menucfg
199 Same as ~memory.
200 llGetScriptName()
201 llGetFreeMemory()
202
203
204 ~menu
205 llSetTimerEvent() - NOTE doesn't actually setup a timer in the default state.
206 llSleep()
207
208 link_message()
209 llGetLinkNumber()
210 switch to state on
211
212 on state
213 llGetKey() to figure out it's channel
214 llListen()
215
216 listen()
217 llSameGroup()
218 llDialog()
219 llResetTime()
220
221 link_message()
222
223 touch_start()
224 llDetectedKey()
225 llDetectedGroup()
226
227 timer()
228
229Not to mention copius use of list and string functions.
230
231
232LSL.Lua
233 All event stuff is hooked up.
234 events.detected*(list) is all hooked up to save the list in detected* tables.
235 llDetected*() functions return those tables.
236
237 copius list functions implemented, though there's a TODO about negative indexes. Dunno which ones are missing.
238
239 String functions implemented. Actually only llGetSubString() and llSubStringIndex()
240
241 llGetScriptName() implemented.
242
243 State changes implemented, with a TODO about clearing out pending events.
244
245 Bunch of ll*() functions faked.
246
247
248 Not implemented
249 llResetTime()
250 llGetNoteCardLine()
251 llGetFreeMemory()
252 llGetKey()
253 llDialog()
254 llListen()
255 llSameGroup()
256
257
258 Uses newFunc() to create all the LSL functions.
259 If there is no return type then sends function and arguments to LuaSL's client.
260 If there is a return type then sends function and arguments to LuaSL"s client, then waits for the response.
261 response should be a Lua value as a string. It gets pcall()'d
262 If we implement a function ourselves, then we override the newFunc created definition with our own function.
263
264
265 Uses waitAndProcess() as the main loop, or to wait for responses.
266 Which just runs what ever Lua strings are sent to us from the LuaSL client, unless it's waiting for a response above.
267
268
269 What needs to be done -
270 -----------------------
271
272Implement llGetNotecardLine() and generate dataserver() events.
273
274LuaSL -> love
275
276
277Fake llGetFreeMemory(), and llSameGroup().
278
279LuaSL -> love -> LuaSL
280
281
282Fake llGetKey()?
283
284LuaSL -> love -> LuaSL
285
286
287Implement llGetInventory*() by actually looking at the files in the
288"object". While we could hard code where the "object" is, since we are
289starting the run ourselves, we can track which object the scripts are
290in. Again, this should be in the love server part.
291
292LuaSL -> love -> LuaSL
293
294
295Implement llListen(), llDialog() and generate listen() events.
296
297SID.llDialog(USER_UUID, "My menu", arseBackwardsMenuList, 456)
298USER_UUID.llRegionSay(456, "button text")
299LuaSL -> love -> extantz -> love -> LuaSL