http://ufoai.org/w/index.php?title=UFO-Scripts/skins.ufo&feed=atom&action=historyUFO-Scripts/skins.ufo - Revision history2024-03-29T05:47:39ZRevision history for this page on the wikiMediaWiki 1.35.4http://ufoai.org/w/index.php?title=UFO-Scripts/skins.ufo&diff=41103&oldid=prevMattn: /* Sharing actor skin */2012-12-14T05:38:34Z<p><span dir="auto"><span class="autocomment">Sharing actor skin</span></span></p>
<p><b>New page</b></p><div>The '''<code>skin</code>''' script allow to describe skins the engine will use for actor models (at the moment, only for human skins). It is not used for the gameplay, but only for the look and feel.<br />
<br />
Model file embed a list of skin name. The engine only use the first one to find image file name. Others are not used, but can be, anyway, useful for third party model viewers and editors.<br />
The engine <br />
<br />
==Script==<br />
Each skin is describe with the keyword <code>actorskin</code>. It contain a string id (used to find image file name), a name (displayed in the user interface) which is translatable, and some properties.<br />
<br />
;singleplayer: [[V_BOOL]]: Describe if we can use this skin in single player mode.<br />
;multiplayer: [[V_BOOL]]: Describe if we can use this skin in multiplayer mode.<br />
<br />
==Example==<br />
This example register a <code>foo</code> skin to the game. The game will search for skins using <code>_foo</code> suffix. This skin is available in both multiplayer and singleplayer game.<br />
<br />
<pre><br />
actorskin foo {<br />
name "_My foo skin"<br />
singleplayer true<br />
multiplayer true<br />
}<br />
</pre><br />
<br />
==Resolution of image skin name==<br />
The engine use three things to found the file name used for a skin.<br />
*The first image defined of the embedded skin defined inside model file. Most of the time it is the name of the model itself.<br />
*The separator <code>_</code> (underscore) for readability.<br />
*The actor skin id as suffix.<br />
<br />
For example: It exists a model called <code>body.md2</code>. It embedded the skin file name <code>body</code>. And it exists an actor skin name called <code>forest</code>. The engine will check the image filename <code>body_forest</code>. If this image do not exists, the engine will use the default skin name.<br />
<br />
*<code>base/models/soldiers/foo</code><br />
**<code>body.md2</code><br />
**<code>body.jpg</code><br />
**<code>body_forest.jpg</code><br />
<br />
==Script order==<br />
The engine use the first embedded skin from models. It is a special case cause here - it doesn't use any suffix. To avoid loading error, the engine must read this skin entry on first, and this skin must be called <code>default</code>.<br />
<br />
<pre><br />
actorskin default {<br />
name "_Urban"<br />
singleplayer true<br />
multiplayer true<br />
}<br />
</pre><br />
<br />
It is anyway an artificial order limitation. We should fix it with code. '''Patch is welcome.'''<br />
<br />
==Sharing actor skin==<br />
[[File:Swat4.png|thumb|Elite skin by turkana.]]<br />
We can share an own actor skin with a [[pk3]] file. You can check {{http|mattn.ninex.info/files/eliteskin_turkana.pk3}} for an example of skin.<br />
<br />
To use this file, we can move it on the game {{path|base}} directory, or on the home {{path|base}} directory. It add a new "Elite" skin, for the multiplayer mode only.<br />
<br />
Some notes:<br />
*A [[pk3]] can contain more than one new actor skin.<br />
*It should not overwrite official content.<br />
*The script should be prefixed with <code>skins_</code>.<br />
*Actor skin name and script should avoid conflict name.<br />
<br />
==Multiplayer limitation==<br />
The game engine only share numerical skin id, and not named skin id. If a player use a custom actor skin, we don't know if other people will see the same model. Anyway the player himself will see the right model. '''Patch is welcome'''.<br />
<br />
If all players use the same [[pk3]] files, and the same game content, all players will have the same right result.<br />
<br />
[[Category:UFO-Scripts]]</div>Mattn