<section id="dev-script"><title>Public Scripts</title>
<simpara>The <application>Public Scripts</application> are built with a modular design that allows a single set of source files to be compiled for all three games. The classes are compact enough to be self-documenting. And, by virtue of the pre-processor, only three extra lines of code are needed to add a new script.</simpara>

</section>

<section id="dev-scriptlib"><title>ScriptLib</title>
<simpara>There are many simple procedures that scripts use often enough to justify creating a library out of.</simpara>

  <refentry id="scrlib-getobjectparams">
   <refnamediv><refname>GetObjectParams</refname>
    <refpurpose>Get the contents of the design note.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <funcsynopsis>
     <funcprototype>
      <funcdef>char* <function>GetObjectParams</function></funcdef>
      <paramdef>int <parameter>iObject</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
   </refsynopsisdiv>
   <refsection>
    <para>Retrieves the contents of the <link linkend="designnote">design note</link> for a particular object. The return value, if non-<literal>NULL</literal>, will have been allocated by <varname>g_pMalloc</varname> and should be free’d by the same.</para>
   </refsection>
  </refentry>

  <refentry id="scrlib-getobjectparam">
   <refnamediv>
    <refname>GetObjectParamString</refname>
    <refname>GetObjectParamInt</refname>
    <refname>GetObjectParamFloat</refname>
    <refname>GetObjectParamBool</refname>
    <refname>GetObjectParamObject</refname>
    <refname>GetObjectParamTime</refname>
    <refpurpose>Get the value of a design note parameter.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <funcsynopsis>
     <funcprototype>
      <funcdef>char* <function>GetObjectParamString</function></funcdef>
      <paramdef>int <parameter>iObject</parameter></paramdef>
      <paramdef>const char* <parameter>pszParam</parameter></paramdef>
     </funcprototype>
     <funcprototype>
      <funcdef>int <function>GetObjectParamInt</function></funcdef>
      <paramdef>int <parameter>iObject</parameter></paramdef>
      <paramdef>const char* <parameter>pszParam</parameter></paramdef>
     </funcprototype>
     <funcprototype>
      <funcdef>float <function>GetObjectParamFloat</function></funcdef>
      <paramdef>int <parameter>iObject</parameter></paramdef>
      <paramdef>const char* <parameter>pszParam</parameter></paramdef>
     </funcprototype>
     <funcprototype>
      <funcdef>bool <function>GetObjectParamBool</function></funcdef>
      <paramdef>int <parameter>iObject</parameter></paramdef>
      <paramdef>const char* <parameter>pszParam</parameter></paramdef>
     </funcprototype>
     <funcprototype>
      <funcdef>int <function>GetObjectParamObject</function></funcdef>
      <paramdef>int <parameter>iObject</parameter></paramdef>
      <paramdef>const char* <parameter>pszParam</parameter></paramdef>
     </funcprototype>
     <funcprototype>
      <funcdef>int <function>GetObjectParamTime</function></funcdef>
      <paramdef>int <parameter>iObject</parameter></paramdef>
      <paramdef>const char* <parameter>pszParam</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
   </refsynopsisdiv>
   <refsection>
    <para>Retrieves a <link linkend="designnote">design note</link> parameter for a particular object. If the parameter doesn’t exist, the return value is <literal>NULL</literal> or <literal>0</literal>. For <function>GetObjectParamString</function>, a non-<literal>NULL</literal> value will have been allocated by <varname>g_pMalloc</varname>.</para>
   </refsection>
  </refentry>

</section>

<section id="dev-lglib"><title>lg Library</title>
<simpara>This library contains the interface definitions required for scripts to interact with the game. The most significant interfaces are found in <filename>scrservices.h</filename>.</simpara>

</section>

<section id="dev-dh2"><title>Dark Hook 2</title>
<simpara>Scripts can register to receive notification of changes to an object, but this requires a callback function. OSM modules are too volatile for this. The <application>Dark Hook 2</application> module can be loaded to provide the necessary functions. Scripts are then notified using script messages.</simpara>

</section>
