Custom Files

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

Sprite

Place your images inside the folder <root>/store/sprites/

e.g. /store/sprites/Filename.png

Then use the function GUISprite() in your client-side script like so:

::mySprite <- null;

function Script::ScriptLoad()
{
     ::mySprite = GUISprite("Filename.png", VectorScreen(x, y));
     ::mySprite.Size = VectorScreen(sizex,sizey);
}

Maps

Inside your root server folder create the following folders:

<root>/store/maps

<root>/store/objects

Inside the maps folder place an xml file with any name you want with the following structure:

<?xml version="1.0" encoding="ASCII" ?>
<itemlist>
	<item model="6000" name="drugstoreint">
		<position x="-856.7597046" y="-79.71799469" z="12.73265266" />
		<rotation format="axisangle" x="0.0" y="0.0" z="0.0" angle="1.0" />
	</item>

	<item model="6001" name="drugstoreext">
		<position x="-856.3429565" y="-79.98773956" z="12.64423846" />
		<rotation format="axisangle" x="0.0" y="0.0" z="0.0" angle="1.0" />
	</item>
</itemlist>

The IPL files have the following structure:

1474, drugstoreint, 0,        -856.7597046, -79.71799469, 12.73265266, 1,        1,        1,        0,     0,    0,    1
model name          (useless) x             y             z            (useless) (useless) (useless) rot.x  rot.y rot.z rot.angle

Objects

Custom object models start with ID 6000.

Create a file called objects.xml in the objects folder with the following structure:

<?xml version="1.0" encoding="ASCII"?>
<objectlist>
	<object id="0">
		<flags value="0" />
		<collision path="drugstoreint.col" />
		<texture path="chem2.txd" />
		<model path="drugstoreint.dff" distance="350" />
	</object>
	<object id="1">
		<flags value="0" />
		<collision path="drugstoreext.col" />
		<texture path="chem.txd" />
		<model path="drugstoreext.dff" distance="350" />
	</object>
</objectlist>

After you've done all that, zip up your col, diff and txd files using 7zip. The file extension must be .7z

Place the .7z with a filename like <somename>_unp.7z in the store folder.

You can also forget the map file and use the custom model IDs (6000+) inside your script.

Weapons

The weapons file is same as MVL(Maxo's Vehicle Loader), so you can use the mod you find on the internet.

Create a new 7-Zip (7z) archive in <root>/store/weapons with a filename in this format:

w<id>_s<slot>_l<weapon>_name.7z

<id> - starting from 100 and increasing with each weapon you add; the ID used by the weapon in-game.

<slot> - the weapon slot the weapon uses, with 0 being fist, 1 being melee, etc.

<weapon> - the ID of the weapon your custom weapon behaves like; putting 6 in here will make your weapon behave like a baseball bat.

Note: If <weapon> is 81, it will act as a hat, and the player will use fists for melee.


The contents of the file are as follows:

weaponname.xml

Describes the weapon and its settings, like in weapon.dat. logicalid is the same as the <weapon> specified in the filename. The following describes a pike used in the public beta server that acts as a baseball bat. If you are specifying a firearm, you will need to modify this.

<?xml version="1.0" encoding="ASCII"?>
<weapon>
	<basic>
		<name>Pike</name>
		<logicalid>6</logicalid>
	</basic>

	<properties>
		<type>melee</type>
		<range>2.000000</range>
		<firerate>450</firerate>
		<reload>100</reload>
		<clipsize>1000</clipsize>
		<damage>21</damage>
		<speed>-1.000000</speed>
		<radius>0.800000</radius>
		<lifespan>-1.000000</lifespan>
		<spread>-1.000000</spread>
		<offset>
			<x>0.100000</x>
			<y>1.800000</y>
			<z>0.300000</z>
		</offset>
		<animgroup>baseball</animgroup>
		<animstart>5</animstart>
		<animend>20</animend>
		<animfire>16</animfire>
		<anim2start>3</anim2start>
		<anim2end>17</anim2end>
		<anim2fire>11</anim2fire>
		<animbreak>99</animbreak>
		<modelindex>-1</modelindex>
		<model2index>-1</model2index>
		<flags>00102000</flags>
		<weaponslot>1</weaponslot>
	</properties>
</weapon>
  • weaponname_icon.png (optional) The icon for the weapon that will be used in-game. If not specified, a blank icon is used.
  • animgroup.ifp (optional) The animation group file used for the weapon. If not given, the client will use the default animation group provided by Vice City.
  • weaponname.dff (optional) The model for the weapon. If not given, the client will use the same model as the logical weapon ID, i.e. the baseball bat in this example.
  • weaponname.txd (optional) The texture for the weapon. If not given, the client will use default textures for the logical weapon ID.
  • scope.png (optional) For sniper rifles and RPGs; the texture used for the scope when zoomed in. If not given, the client will use default scopes.
  • gunshot.wav (optional) The sound when weapon shooting. If not given, the client will use default sound.

Vehicles

Each custom vehicle is one .7z archive (similar to .zip, but created with 7-Zip) in store/vehicles folder, where the file name format is v<modelid>_t<vehicletype>_p<maxpassengers>_<vehiclename>.7z. Model ID is the ID you will use to create vehicles that use this custom vehicle model. They have to be in the range 6400-6499. Vehicle type is a number, where 0 means a car (or a helicopter), 1 means a bike and 2 means a boat.

Archives can contain the following files (only the file extension matters):

  • .xml (required) The file containing all the IDE and handling information for your vehicle plus some extra options.
  • .dff (required) The main model file of your vehicle - this can also be a model file in SA format (may include collision).
  • .txd (required) The texture file for your vehicle - this can also be a texture file in SA format.
  • .col (required if .dff doesn't contain collision model) The collision model to be used with your vehicle.
  • .ifp (optional) Custom animations for your vehicle.

This is what the .xml file looks like (this one is for PCJ 600):

<?xml version="1.0" encoding="ASCII"?>
<vehicle>
    <basic>
        <type>bike</type>
        <name>PCJ 600</name>
        <anims>bikes</anims>
        <comprules>0</comprules>
        <extraflags>0000</extraflags>
        <wheelrotangle>16</wheelrotangle>
        <wheelscale>0.670000</wheelscale>
        <immunity>0</immunity>
    </basic>

    <aidata>
        <class>motorbike</class>
        <freq>10</freq>
        <level>7</level>
    </aidata>

    <colors>
        <carcol>13,13</carcol>
        <carcol>22,22</carcol>
        <carcol>35,35</carcol>
        <carcol>38,38</carcol>
        <carcol>2,2</carcol>
        <carcol>3,3</carcol>
        <carcol>48,48</carcol>
        <carcol>51,51</carcol>
    </colors>

    <audio>
        <enginefarsample>287</enginefarsample>
        <enginenearsample>23</enginenearsample>
        <hornsample>0</hornsample>
        <hornfreq>27000</hornfreq>
        <sirensample>0</sirensample>
        <sirenfreq>9600</sirenfreq>
        <doorsounds>1</doorsounds>
    </audio>

    <handling>
        <mass>500.000000</mass>
        <percentsubmerged>103</percentsubmerged>
        <steeringlock>35.000000</steeringlock>
        <seatoffset>0.300000</seatoffset>
        <damagemultiplier>0.150000</damagemultiplier>
        <value>10000</value>
        <flags>00010102</flags>

        <dimensions>
            <x>0.800000</x>
            <y>1.800000</y>
            <z>1.200000</z>
        </dimensions>

        <centreofmass>
            <x>0.000000</x>
            <y>0.050000</y>
            <z>-0.090000</z>
        </centreofmass>

        <traction>
            <multiplier>1.600000</multiplier>
            <loss>0.900000</loss>
            <bias>0.480000</bias>
        </traction>

        <transmission>
            <numofgears>5</numofgears>
            <maxspeed>190.000000</maxspeed>
            <acceleration>50.000000</acceleration>
            <drivetype>R</drivetype>
            <enginetype>P</enginetype>
        </transmission>

        <brakes>
            <deceleration>15.000000</deceleration>
            <bias>0.500000</bias>
            <abs>0</abs>
        </brakes>

        <suspension>
            <forcelevel>0.850000</forcelevel>
            <dampening>0.150000</dampening>
            <upperlimit>0.150000</upperlimit>
            <lowerlimit>-0.160000</lowerlimit>
            <bias>0.500000</bias>
            <antidive>0.000000</antidive>
        </suspension>

        <lights>
            <front>1</front>
            <rear>1</rear>
        </lights>
    </handling>

    <bikehandling>
        <leanfwdcom>0.330000</leanfwdcom>
        <leanfwdforce>0.150000</leanfwdforce>
        <leanbackcom>0.280000</leanbackcom>
        <leanbackforce>0.150000</leanbackforce>
        <maxlean>44.999996</maxlean>
        <fullanimlean>38.000004</fullanimlean>
        <deslean>0.930000</deslean>
        <speedsteer>0.700000</speedsteer>
        <slipsteer>0.500000</slipsteer>
        <noplayercomz>0.100000</noplayercomz>
        <wheelieang>35.000008</wheelieang>
        <stoppieang>-40.000000</stoppieang>
        <wheeliesteer>-0.009000</wheeliesteer>
        <wheeliestabmult>0.700000</wheeliestabmult>
        <stoppiestabmult>0.600000</stoppiestabmult>
    </bikehandling>

</vehicle>

This feature is ported from the singleplayer modification Maxo's Vehicle Loader, so I won't be creating a separate thorough documentation for it right now. Here is the original modification: http://gtaforums.com/topic/477801-maxos-vehicle-loader/ . It contains .xml files for all the default VC vehicles and some documentation. In that thread you can find more specific explanation for various settings from the changelog (vehicle weapons are disabled in multiplayer though, and tuning parts cannot be controlled by the server). If you can't find an answer to your question about some xml field in there, feel free to ask here.

It also contains also links to applications and websites which help in creating the .xml files, for example by automatically converting handling file lines to .xml file handling format. One of these helping sites can be found here: http://almost610.ucoz.com/blog/welcome/2012-12-23-4 .

You can find existing vehicles already in the right format from GTAGarage and GTAInside sites (search with MVL as keyword). If you decide to use any of those for your server, make sure to ask the authors for permission if possible. You should also add a <author> line to the .xml file (in the <basic> section) which contains the original author of the vehicle - it will be shown to players when they enter that vehicle.

Skins

Each custom skin is one .7z archive in store/skins folder, where the file name format is z<skinid>_<skinname>.7z. Skin ID is in the range 200-249, and the custom skins can be used in-game with the same IDs that are specified in the file name.

Archives must contain the following files (only the file extension matters):

  • .xml XML file that contains the name and animation info for the skin.
  • .dff The model file for the skin.
  • .txd The texture file for the skin.

This is what the .xml file may look like:

<?xml version="1.0" encoding="ASCII"?>
<skin>
 <basic>
  <name>Awesome Skin</name>
  <animgroup>man</animgroup>
  <animfile>null</animfile>
 </basic>
</skin>

The animation group and animation file values are the same as you would use in default.ide.

Some Custom Skin Download Link: https://files.thijn.ovh/download/e017630ce5ac6fd93fe52f3f8c94b4e8/skins.zip

Sounds

Add .wav or .ogg files to <root>/store/sounds/. Each sound added will have an ID starting with 50000 which can be played through PlaySound as usual. Filenames should be in the format of s<id>_NAME.wav where ID starts with 50000.

e.g. /store/sounds/s50000_name.wav

Then use the function PlaySound in your script like so:

PlaySound( world, 50000, pos );

Map icons

Put the icon file at 'store/mapicons/' folder. Icon name should be m< icon id>_<name>. Id begins with 100 and you an write anything at <name>. Icon's format should be .png .

Create the icon with

CreateMarker(int world,Vector position, int zise (most times 5),RGB(0,0,0),int icon's ID)