Modding:Parser Primer
LT's parser takes in text from mods and resource files, executes scripts to perform game actions or retrieve information, applies formatting, and outputs text marked up with html to display onto the game screen.
Modders will definitely want to read the #Scripting section.
See also for reference: Parser Command Reference and Parser Target and Binding Reference
In-Game Guide
The following is taken from the parser help scene in the game's debug menu:
Innoxia’s super fun and interesting guide to parsing
You put in the input, and it returns a nice output!
Input:
Everything is parsed using square brackets, split into the following pattern:
[target.command]
or, for the few special commands that require arguments:
[target.command(arguments)]
or, for parsing as a script:
[#command]
or, for parsing as a script which suppresses output:
[##command]
(This means that the command will be executed, but no String output will be displayed.)
An example of use in a sentence would be:
As you start to read Innoxia’s tedious parsing documentation, [lilaya.name] steps up behind you and wraps [lilaya.her] [lilaya.tail+] around your [pc.leg]. Leaning in over your shoulder, [lilaya.she] groans, [lilaya.speech(Oh my God. This is so boring, [#pc.getName(true)]!)]’
parses to:
As you start to read Innoxia’s tedious parsing documentation, Lilaya steps up behind you and wraps her thick tail around your legs. Leaning in over your shoulder, she groans, Oh my God. This is so boring, Vivian!
Target tag:
The target of a command is an NPC’s name, or ‘pc’ for the player character. Target tags are case-insensitive. (i.e. pc is treated the same as PC, pC, or Pc)
If an unrecognised name is passed, the output will read ‘INVALID_TARGET_NAME’.
Currently accepted target tags can be viewed in the ‘Targets’ page.
e.g.:
[lilaya.command]
[pc.command(arguments)]
[npc.command]
Command and argument tags:
Command tags determine what output is returned. They come in two varieties; with and without arguments.
Arguments are passed inside brackets that follow the command, ignoring any spaces that you may insert.
i.e. [pc.command(arguments)] is the same as [pc.command (arguments)].
Command tags are only case-sensitive for the first letter. (i.e. command is treated the same as cOMMAND, cOmMaNd, or commanD)
Arguments are specific to each command, and you’ll have to refer to the command documentation to find out what arguments a command takes. (Don’t worry, there aren’t many that take arguments.)
e.g.:
[pc.speech(Hello reader!)] outputs Hello reader!
Command modifier (a_ an_)
You may insert ‘a_’ or ‘an_’ to automatically generate the appropriate pronoun before an argument. (It’s your choice if you prefer a_ or an_, they both work in exactly the same way.)
e.g.:
[npc.height] outputs ‘tall’
[npc.a_height] outputs ‘a tall’
[npc.an_height] also outputs ‘a tall’
For some body part names, this provides a little more complexity.
e.g.:
[npc.arms] outputs ‘wings’
[npc.a_arms] outputs ‘a pair of wings’
[npc.an_arms] also outputs ‘a pair of wings’
Command modifier (Capitalisation)
Most commands are able to apply capitalisation. The ones that don’t, such as numeric output commands, will still happily take a capitalised command, but capitalisation won’t be applied.
To capitalise an output, all you have to do is capitalise the first letter of the command name.
e.g.:
[npc.height] outputs ‘tall’
[npc.hEIGHT] also outputs ‘tall’ (I’m sure nobody would ever do this…)
[npc.Height] outputs ‘Tall’
[npc.a_height] outputs ‘a tall’
[npc.A_height] outputs ‘A tall’
[npc.a_Height] also outputs ‘A tall’
Command modifier (+ D)
Most commands that return a name are able to apply additional randomised descriptors. (You can check to see what commands accept ‘+’ and ‘D’ modifiers in the ‘Commands’ page.)
To apply additional descriptors to the returned output, all you have to do is add a ‘+’, ‘d’, or ‘D’ to the end of the command.
This works in combination with ‘a_ an_’ and ‘Capitalisation’ modifiers.
e.g.:
[npc.arms] outputs ‘wings’
[npc.arms+] outputs ‘feathered wings’
[npc.armsD] also outputs ‘feathered wings’
[npc.armsd] also outputs ‘feathered wings’
[npc.ArmsD] outputs ‘Feathered wings’
[npc.a_arms+] outputs ‘a pair of feathered wings’
[npc.A_arms+] outputs ‘A pair of feathered wings’
Some outputs have more randomisation than others.
e.g.:
[npc.pussy] outputs ‘slit’
[npc.pussy] outputs ‘cunt’
[npc.pussy+] outputs ‘wet pussy’
[npc.pussy+] outputs ‘tentacle-lined twat’
Conclusion:
Valid command syntax:
[target.command]
or
[target.command(arguments)]
Examples:
[brax.name] leans back in [brax.his] chair, wondering what happened to [arthur.name] after [brax.he] handed [[arthur.him]] over to Scarlett.
outputs:
‘Brax leans back in his chair, wondering what happened to Arthur after he handed him over to Scarlett.’
[rose.name] leans back in [rose.herHuis] chair, letting out a sigh as [rose.shyeHe] takes a sip of [rose.name] coffee.
outputs:
Rose leans back in command_unknown chair, letting out a sigh as command_unknown takes a sip of Rose coffee.
Note: Typos will cause the parsing system to return an invalid command string, whereas incorrect commands (such as typing .name instead of .herHis) will not throw an error!
[lilaya.name] storms up to [innoxia.name], shouting angrily in response to finding out that [lilaya.her] sex scenes haven’t been fixed yet, [lilaya.speech(What the hell are you doing Innoxia?! You said my scenes were going to be re-written weeks ago!)]
outputs:
‘Lilaya storms up to Innoxia, shouting angrily in response to finding out that her sex scenes haven’t been fixed yet, What the hell are you doing Innoxia?! You said my scenes were going to be re-written weeks ago!’
Dialogue written by Innoxia for Lilith’s Throne v0.4.9