forums | blogs | polls | tutorials | downloads | rules | help

Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in remember_me_form_alter() (line 78 of /var/www/siegetheday.org/sites/all/modules/contrib/remember_me/remember_me.module).

Creating A Simple Item - Chain Mail

Creating A Simple Item - Chain Mail

This was written for DS1 but will apply to the other games as well. This tutorial also assumes that you understand about directories in resource files when creating a mod.

Making a simple item helps to understand the bare necessities for more complex ones. Open up any text editor that you want (notepad is fine) and create a new file. Follow these steps to create a simple chain mail using template 1 below as a reference model:

1. Create a template header in the format of [t:template,n:TEMPLATE_NAME] : Replace TEMPLATE_NAME with a unique name of your own. This is used by the game to uniquely identify your item, but is never seen by the normal user.

2. Each new [] tag must be enclosed by a set of braces { } to begin and end each block, so keep that in mind throughout your creation.

3. You'll now want to specificy the doc tag in the format of doc= "TEXT"; : Replace TEXT with any name you wish, it is not the name of your item and will never be seen except by those using the Siege Editor choosing to look at documentation over names.

4. Notice that after each line except those with { } or [] in them, there is always a semi-colon ;. Your item will not compile right if you forget one.

5. All your items will need some type of base specialization in the format of specializes = SPEC : Replace SPEC with a template name of your choice. In our case we would use base_body_armor_chain and a complete list of commonly used ones will be available in a later section.

6. Common to all armor is the defend tag. It is always specified by [defend]. It is also the most important part of the armor in which you specify the armor defense as well as the mesh style and texture.

7. First inside the defend tag you'll need to specify armor_style = TEXTURE; : Replace TEXTURE with the name of that which you want. In our example we will use the one for Dark Scale.

8. Second inside the defend tag you'll need to specify armor_type = MESH_TYPE; : Replace MESH_TYPE with the name of the armor type mesh you want. This must correspond with the texture you are using as well, or it will not wrap right on the character. For simplicity we will use a3, which goes with our 018 texture for Dark Scale.

9. Last inside the defend tag you need to specify a defense rating by f defense = DEF; : Replace DEF with the amount of defense you want on the armor.

10. Next is the common tag which is always specified as [common]. It includes a few details, but is mostly used for naming the item.

11. Inside the common tag you will need to specify the screen_name = "NAME" of your item. This is the name that shows up to the user in game. : Replace NAME with any name you wish, it does not have to be unique to the item also.

12. The most visually important tag is the gui one, which is specified by [gui]. It containts all the information about displaying the object other than on the actual character model.

13. Now the requriements to equip your weapon are in the form of equip_requirements = TYPE:VALUE; : Replace TYPE with the attribute (strength, dexterity, intelligence) and VALUE with the amount to require. You can also require multiple attributes by seperating each with a , as I've done below.

14. The inventory_height = VALUE; and inventory_width = VALUE; are very important attributes that set how much inventory space your item will take up. It is best to use a general guess value and then change it if needed later. : Replace VALUE in both cases as needed. Setting to a low value does not resize the icon for the inventory and creates wierd looking results. In this case, I know the Dark Scale icon of the armor is 3 x 2 already, so use it.

15. Lastly, an inventory icon needs to be specified in the form of inventory_icon = GRAPHIC;. This is the actual icon for your inventory and equip slot that shows up. : Replace GRAPHIC with the name of the inventory graphic. In our case use b_gui_ig_i_a_pos_a3_018 which is the one for Dark Scale. The ending number usually, but not always, matches up to the texture we used above with the default game grahpics.

16. You have now completed the code for a very simple chain mail that the game uses. You'll need to save it as a .gas file in your items directory you created in Part 1 of the tutorial (Figure 3.2). It must be in this directory and saved with a .gas extension. The name of the file otherwise is unimportant, but should be unique.

17. The last step is to tank the directory. Go here for instructions: Handling tanks and resource directories.


[t:template,n:nivisec_simple_chain_mail]
{
	doc = "Dark Chain Mail";
	specializes = base_body_armor_chain;
	
	[defend]
	{
		armor_style = 018;
		armor_type = a3;
		f defense = 128;
	}
	[common]
	{
		screen_name = "Dark Chain Mail";
	}
	[gui]
	{
		equip_requirements = strength:21;
		inventory_height = 3;
		inventory_width = 2;
		inventory_icon = b_gui_ig_i_a_pos_a3_018;
	}
}

template 1



figure 1



(the original text for this tutorial was written by Nivisec, and is published here with permission)

tutorials: