Difference between revisions of "Scribe"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Shademe
m (SEO)
imported>Shademe
(Updated with the newer details)
Line 2: Line 2:


'''Syntax:'''
'''Syntax:'''
  (nothing) Scribe formatString:string var1 var2 ... var20 printToConsole:bool scribeOperation:integer
  (nothing) Scribe formatString:string var1 var2 ... var20 printToConsole:bool


Primary output function. Prints output to a log file and, optionally, to the console.
Primary output function. Prints output to a log file and, optionally, to the console. The log name can optionally be passed after the message, following a '''|''' delimiter, to write to a particular log.


 
When calling the command without a log name, the plugin will look for a default log registered by the mod. If it finds one, it will write the output to it. If not, it will write the output to a script log.
{| style="width: 35%; border-collapse: collapse" border="2"
!| Scribe Operation
!| Integer
|-
| Post to Script Log
| 0
|-
| Post to Registered Log
| 1
|}




Line 24: Line 14:
* The calling mod must have a log registered to use scribe operation 1.
* The calling mod must have a log registered to use scribe operation 1.
* String variables can be passed using the '''%z''' format specifier.
* String variables can be passed using the '''%z''' format specifier.
* The pipe '''|''' character mustn't be used in the message unless the log name is to be passed. The plugin automatically considers the string following the delimiter to be the log name.
* The command may be forced to write to the script log by passing the string "Script" as the log name.


==Example==
==Example==
Line 31: Line 24:
begin gameMode
begin gameMode
   scribe "This will be printed to the Script log, but not to the console" 0
   scribe "This will be printed to the Script log, but not to the console" 0
   scribe "This will be printed to the console alone" 1
  registerLog "Log A"
  registerLog "Log B" 1
   scribe "This will be printed to the default log, Log B" 1


   let svLog := "Con" + $player + "Scribe"
   let svLog := "Con" + $player + "Scribe"
   scribe "String Var - %z" svLog 1
   scribe "String Var - %z. Will be printed to the Log A|Log A" svLog 1


   scribe "This will be printed to the registered log, if any" 1 1
   scribe "This will be printed to the script log|script" 1
end
end
</pre>
</pre>

Revision as of 22:38, 3 February 2010

A command for ConScribe.

Syntax:

(nothing) Scribe formatString:string var1 var2 ... var20 printToConsole:bool

Primary output function. Prints output to a log file and, optionally, to the console. The log name can optionally be passed after the message, following a | delimiter, to write to a particular log.

When calling the command without a log name, the plugin will look for a default log registered by the mod. If it finds one, it will write the output to it. If not, it will write the output to a script log.


Notes

  • Script logs are created in the ConScribe Logs > Per-Script folder. Logs names follow the convention: <Mod Name> - [XX]<Calling script's truncated formID>.

    Registered logs are created in the ConScribe Logs > Per-Mod folder.

  • The calling mod must have a log registered to use scribe operation 1.
  • String variables can be passed using the %z format specifier.
  • The pipe | character mustn't be used in the message unless the log name is to be passed. The plugin automatically considers the string following the delimiter to be the log name.
  • The command may be forced to write to the script log by passing the string "Script" as the log name.


Example

string_var svLog

begin gameMode
   scribe "This will be printed to the Script log, but not to the console" 0
   registerLog "Log A"
   registerLog "Log B" 1
   scribe "This will be printed to the default log, Log B" 1

   let svLog := "Con" + $player + "Scribe"
   scribe "String Var - %z. Will be printed to the Log A|Log A" svLog 1

   scribe "This will be printed to the script log|script" 1
end

See also

RegisterLog