/usr/share/doc/sludge/SLUDGEDevKitHelp/File_Handling.html is in sludge-doc 2.2.1-2build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<TITLE>File Handling</TITLE>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<BODY>
<HR>
<div align="center"><img id="headerGraphic" src="images/sludge300.png" alt="SLUDGE"/></div>
<h2>File Handling</h2>
<HR>
<P>
If you've used C++ or Perl, you'll be used to the idea that text in double quotes "like this" and text in single quotes 'like this' can have different meanings. In SLUDGE, strings in single quotes are interpreted as file handles. That is, during compilation, instead of including the text in your finished game the <a href="About_the_SLUDGE_Compiler.html">SLUDGE compiler</a> includes the file itself. Therefore, "Hello.tga" represents the string Hello.tga (which can then be spoken, printed on the screen and so on). Alternatively, 'Hello.tga' represents the contents of the file Hello.tga (which can then be drawn on the screen or - for other file types - played as a sound or a piece of music, set as the new floor and so on).
</P>
<P>
Files which are referenced more than once are only included in your finished game in one place. If you have a huge file mentioned anywhere in a script and then mentioned again in another (or in the same script) you don't need to worry about it bumping up the size of your finished file with duplicated data - this is taken care of, and each referenced file will be added only once. Files which are not referenced will, of course, not be added at all.
</P>
<P>
It is also worth noting that storing a file handle does not open the file. The line...
</P>
<P>
<pre>var myHandle = 'bigImageFile.tga';</pre>
</P>
<P>
...does not read the file into memory. It is only when a handle is used by a built-in function (such as <a href="addOverlay.html">addOverlay</a> in this case) that the file is loaded.
</P>
<H3>Built-in functions which load files from file handles:</H3>
<P>
<a href="addOverlay.html">addOverlay</a>
</P>
<P>
<a href="anim.html">anim</a>
</P>
<P>
<a href="cacheSound.html">cacheSound</a>
</P>
<P>
<a href="loopSound.html">loopSound</a>
</P>
<P>
<a href="mixOverlay.html">mixOverlay</a>
</P>
<P>
<a href="playSound.html">playSound</a>
</P>
<P>
<a href="playMovie.html">playMovie</a>
</P>
<P>
<a href="say_and_think.html">say and think</a>
</P>
<P>
<a href="setFloor.html">setFloor</a>
</P>
<P>
<a href="setFont.html">setFont</a>
</P>
<P>
<a href="setLightMap.html">setLightMap</a>
</P>
<P>
<a href="setZBuffer.html">setZBuffer</a>
</P>
<P>
<a href="startMusic.html">startMusic</a>
</P>
<H3>Other built-in functions which use file handles:</H3>
<P>
<a href="freeSound.html">freeSound</a>
</P>
<P>
<a href="getSoundCache.html">getSoundCache</a>
</P>
<P>
<a href="setSoundLoopPoints.html">setSoundLoopPoints</a>
</P>
<P>
<a href="setSoundVolume.html">setSoundVolume</a>
</P>
<P>
<a href="stopSound.html">stopSound</a>
</P>
<H3>Curiously, these functions don't use file handles:</H3>
<P>
<a href="deleteFile.html">deleteFile</a>
</P>
<P>
<a href="fileExists.html">fileExists</a>
</P>
<P>
<a href="getMatchingFiles.html">getMatchingFiles</a>
</P>
<P>
<a href="launch_and_launchWith.html">launch and launchWith</a>
</P>
<P>
<a href="loadCustomData_and_saveCustomData.html">loadCustomData and saveCustomData</a>
</P>
<P>
<a href="loadGame.html">loadGame</a>
</P>
<P>
<a href="renameFile.html">renameFile</a>
</P>
<P>
<a href="saveGame.html">saveGame</a>
</P>
<P>
<a href="showThumbnail.html">showThumbnail</a>
</P>
<P class="copyright-notice">SLUDGE and this SLUDGE documentation are <A HREF="Copyright.html">copyright</A> Hungry Software and contributors 2000-2012
</P>
<HR>
</BODY>
</html>
|