Material Modding

From IvanWiki
Revision as of 10:04, 17 December 2008 by 4zb4 (talk | contribs) (New page: == HOW TO CREATE\EDIT MATERIALS IN IVAN == '''1)'''Go to "...\IVAN\Script" '''2)'''Inside that folder, open "material.dat" with notepad '''3)'''Inside the file, there are the materials ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

HOW TO CREATE\EDIT MATERIALS IN IVAN

1)Go to "...\IVAN\Script"

2)Inside that folder, open "material.dat" with notepad

3)Inside the file, there are the materials used in IVAN. Each is filed under a category. So Iron, for example would be under the "solid" category, and "water" would be under the "liquid" category. To find a category, search for its name. So "solid" for solids, and "liquid" for liquids etc.

4)Under each category is a series of entries that look like, or are similar to this:

  Config MITHRIL;
 {
   StrengthValue = 200;
   ConsumeType = CT_METAL;
   Density = 5000;
   Color = rgb16(224, 224, 224);
   PriceModifier = 2000;
   NameStem = "mithril";
   Flexibility = 2;
   AttachedGod = SOPHOS;
   HardenedMaterial = OCTIRON;
   IntelligenceRequirement = 25;
   CommonFlags = Base|IS_VALUABLE;
   CategoryFlags = Base|IS_METAL|IS_SPARKLING|IS_GOLEM_MATERIAL;
   InteractionFlags = Base&~CAN_DISSOLVE;
 }

each entry has its own specific properties:

Config _____ This is the name the script associates with the material. If you ever edit this, you must also edit the entry in "define.dat" so that it is the same as the edited name. How you do this is explained further on.

StrengthValue is how strong the weapon is, and is usually used for determining how much damage a weapon made of it will do, or how much damage an armor piece made of it will absorb.

ConsumeType is used for determining what it can be eaten by. For example, CT_Metal cannot be eaten by humans, because they are not coded to be able to consume CT_Metal, but humans can consume CT_Fruit, as it makes sense and they are programmed to do so.

Density is how thick the substance is, and therefore how heavy, or light it is. The higher the amount, the heavier the substance is.

Color is self-explanatory.

rgb16(220, 220, 0)(or similar) is used to determine what color something is, whether base color, or the emitted color.

Emitation is the color the substance emits. If there is no Emitation entry under the substance's name, it does not emit any color.

PriceModifier is how much anything made of the substance is generally sold for to vendors. This varies depending on what object is made of the substance, and can be affected by how heavy the item is.

NameStem is the prefix put before the item in the game. So if a mace was made of a substance with the NameStem "chocolate", the mace would appear in the game as a "chocolate mace".

Flexibility is used to show how flexible something is. The more flexible a substance is, the better it is for making whips and pieces of armor out of in the game. A low flexibility level is generally good for denser substances, as weapons made out of them will be much stronger, but a piece of armor made of a low flexibility will reduce dexterity and agility, but increase the amount of damage absorbed. A substance that has a balance of both density and flexibility makes for great armor.

AttachedGod the god the substance is attached to. Every material must be attached to a god. Offering an object made of a substance to a god that it is also attached to will increase how much the god likes you more than offering something not attached to that god.

HardenedMaterial is the material the material is hardened into when used by the scroll of harden material.

IntelligenceRequirement how high your intelligence must be in order to harden a material into this substance. The amount of intelligence needed to change a material directly into this material (by using a scroll of change material for example) is the IntelligenceRequirement value +5.

CommonFlags attributes the material has. e.g. IS_VALUABLE means that vendors will buy items made of this substance, and CAN_BE_WISHED means that you can wish for that substance.

CategoryFlags are similar to CommonFlags and use the same system. So for example, IS_METAL confirms that it is made of metal, and IS_GOLEM_MATERIAL means that it can be used with a scroll of golem creation to make a golem of that material. When editing the common and category flags, DO NOT get an attribute mixed up. That means don't put IS_GOLEM_MATERIAL under CommonFlags or anything like that.

InterationFlags are attributes that come into play when the material comes into contact with another material. The most common is CAN_DISSOLVE which means any material that is classed as "acidous" can dissolve the material.

DigProductMaterial determines what kind of material the stones left behind after digging a wall made of the material are. This is generally the same material. This entry is not always used.

These can be edited as you see fit


However, if you want to make a new material, you must do the following:


1) Copy and paste an already existing material. This is the safest way to avoid screwing up the game when you finally get to testing out your new material.

2) make sure you leave the appropriate amount of space between the previous and following entries. It should look like this:

 Config GRAVEL;
 {
   StrengthValue = 40;
   ConsumeType = CT_MINERAL;
   Density = 2500;
   Color = rgb16(180, 180, 180);
   NameStem = "gravel";
   AttachedGod = TERRA;
   CommonFlags = Base&~CAN_BE_WISHED;
 }
 Config NEW_MATERIAL;
 {
   StrengthValue = XX;
   ConsumeType = X;
   Density = X;
   Color = rgb16(X, X, X);
   NameStem = "new material";
   DigProductMaterial = GRANITE;
   AttachedGod = TERRA;
   CommonFlags = Base&~CAN_BE_WISHED;
 }
 Config GLASS;
 {
   StrengthValue = 40;
   ConsumeType = CT_MINERAL;
   Density = 2500;
   Color = rgb16(180, 180, 255);
   NameStem = "glass";
   Alpha = 150;
   AttachedGod = LEGIFER;
   HardenedMaterial = ILLITHIUM;
   IntelligenceRequirement = 5;
   CategoryFlags = Base|IS_GOLEM_MATERIAL;
 }


3) change the name next to "Config" to whatever you want to name the material. This must be in CAPITALS. i.e Config NEW_MATERIAL;

4) You can now proceed to change the entries as you see fit. If you add or remove any lines from the entry, be sure to line everything up again after. Everything must remain between the "{" and "}" brackets. For the color, the first number is the amount of red, the second is the amount of green and the third is the amount of red. These can be any number from 0 to 255.

5) After you are done making or editing the material, save the document, exit and open "define.dat"

6) Search (ctrl + F) for the material you copied earlier and copy the entire entry found.

7) Paste it after the last entry in the sequence, and change the NAME IN CAPITALS to whatever you called your substance. After that, change the number at the end of the line into the next number in the series.

e.g. if you created the organic material "chocolate" it would look like this: note that the "#" symbols have been removed because IvanWiki didn't agree with them for some reason

define ORGANIC_ID (4096 * 2)

define BANANA_FLESH (ORGANIC_ID + 1) define SCHOOL_FOOD (ORGANIC_ID + 2) define BANANA_PEEL (ORGANIC_ID + 3) define KIWI_FLESH (ORGANIC_ID + 4) define PINEAPPLE_FLESH (ORGANIC_ID + 5) define PLANT_FIBER (ORGANIC_ID + 6) define MUTANT_PLANT_FIBER (ORGANIC_ID + 7) define BONE (ORGANIC_ID + 8) define BREAD (ORGANIC_ID + 9) define HOLY_BANANA_FLESH (ORGANIC_ID + 10) define CARROT_FLESH (ORGANIC_ID + 11) define OMMEL_CERUMEN (ORGANIC_ID + 12) define OMMEL_BONE (ORGANIC_ID + 13) define OMMEL_TOOTH (ORGANIC_ID + 14) define CHOCOLATE (ORGANIC_ID + 15)


8) Save the document.

9) Congratulations! You have created your own new material! To test if the material works, start a new game in IVAN, enter New Attnam, activate wizard mode and read a scroll of wishing. Wish for any item, then use another scroll of wishing to wish for a scroll of change material. Next, use the scroll of change material to change the previously wished for item into your new material.

10) If it works without any problems, have fun!


Tutorial by 4zb4. Hope you liked it.