Brought to you by PCGamingWiki

Mods

From Sir, You Are Being Hunted Wiki
Jump to: navigation, search

This is a guide to modding Sir, You Are Being Hunted. This guide is intended to show you how to add Items to the game, such as a rifle with 1000 ammo.

To start we need a basic inventory, which can be found in sir_alpha -> Savegames -> World# -> Dynamic -> PlayerInv.xml This is the player inventory.

Make sure the game is not running.

Here is a copy of the inventory with nothing in it.

<?xml version="1.0" encoding="utf-8"?>
<C_InventoryData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <m_InventoryName>PlayerInventory</m_InventoryName>
  <m_PickupItemList>
  </m_PickupItemList>
  <m_PickupItemValueList>
  </m_PickupItemValueList>
  <m_PickupPositionList>
  </m_PickupPositionList>
</C_InventoryData>

As you can see, there is nothing in it as you have nothing in your inventory, unless you have done the starting "quest" in which you examine the dead robot. In order to add something, you must add all 3 categories which are

 <m_PickupItemList>
 </m_PickupItemList>
 <m_PickupItemValueList>
 </m_PickupItemValueList>
 <m_PickupPositionList>
 </m_PickupPositionList>


The value of an item works differently for each type of item. For throwable items, the value is a quantity of that item. For guns, value determines rounds chambered. On other items that do not stack, like bandages and food, value does nothing. Multiples of these items must be added on separate lines.

Let's add a rifle and 1000 rifle ammo.

Remember we need to add things in all 3 categories.

<?xml version="1.0" encoding="utf-8"?>
<C_InventoryData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <m_InventoryName>PlayerInventory</m_InventoryName>
  <m_PickupItemList>
    <string>Rifle</string>
    <string>RifleAmmo</string>
  </m_PickupItemList>
  <m_PickupItemValueList>
    <int>0</int>
    <int>1000</int>
  </m_PickupItemValueList>
  <m_PickupPositionList>
    <S_InvPoint>
      <x>0</x>
      <y>0</y>
    </S_InvPoint>
    <S_InvPoint>
      <x>0</x>
      <y>1</y>
    </S_InvPoint)
  </m_PickupPositionList>
</C_InventoryData>


Note the position list. The game will hang on "Rebuilding Inventories" if you do not space items properly.

The inventory is 5 by 10, and ordered by x and y coordinates. Grid coordinates start with 0. Here is an example:

-------------------------------
| 0,0 | 1,0 | 2,0 | 3,0 | 4,0 |
-------------------------------
| 0,1 | 1,1 | 2,1 | 3,1 | 4,1 |
-------------------------------
| 0,2 | 1,2 | 2,2 | 3,2 | 4,2 |
-------------------------------
| 0,3 | 1,3 | 2,3 | 3,3 | 4,3 |
-------------------------------
| 0,4 | 1,4 | 2,4 | 3,4 | 4,4 |
-------------------------------
| 0,5 | 1,5 | 2,5 | 3,5 | 4,5 |
-------------------------------
| 0,6 | 1,6 | 2,6 | 3,6 | 4,6 |
-------------------------------
| 0,7 | 1,7 | 2,7 | 3,7 | 4,7 |
-------------------------------
| 0,8 | 1,8 | 2,8 | 3,8 | 4,8 |
-------------------------------
| 0,9 | 1,9 | 2,9 | 3,9 | 4,9 |
-------------------------------


There are 2 spaces when a new comment is set. [1]

Save this, and when you start the game, you will have a rifle and 1000 rounds of rifle ammo.

You can add other items in much the same way.

Remember, you need things in all 3 categories.


The code to add throwable weapons, like dynamite, is slightly different. We do not need separate ammo for the dynamite.


<?xml version="1.0" encoding="utf-8"?>
<C_InventoryData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <m_InventoryName>PlayerInventory</m_InventoryName>
  <m_PickupItemList>
    <string>Dynamite</string>
</m_PickupItemList>
  <m_PickupItemValueList>
    <int>10</int>
  </m_PickupItemValueList>
  <m_PickupPositionList>
    <S_InvPoint>
      <x>0</x>
      <y>0</y>
    </S_InvPoint>
  </m_PickupPositionList>
</C_InventoryData>

Here is a helpful XML tutorial.