Jump to content

How To Apply Your Own Mod Using Gme


Gordius

Recommended Posts

If you decide to use this MOD read the notes at the bottom or risk losing Inventory Items! This post is intended to explain something of how GME can be used by you rather than to give you a wonderful MOD

 

In this example I have reduced the size of the Seraphim's Spiked Defender when in the inventory so that it occupies only one inventory square rather than six to save myself inventory space. This works only when playing in Singleplayer or LAN! I have used the Generic MOD Enabler which can be downloaded here Download.

 

This example involves adding one script file called "shield" and replaces the "autoexec.txt" file, nothing has been removed from any files so, unless you have another MOD which has changed "autoexec.txt" it can be used safely. Although I have spent time testing the MOD and had no problems use it at your own risk. When enabling a MOD using GME game files are overwritten so take care and backup those files you intend to overwrite before you begin!

 

For this example backup autoexec.txt before you start, GME should keep a backup of that file but in my opinion it is always better to manually back it up yourself.

 

The Spiked Defender is a common drop in the game. It uses a lot of space in your inventory, six squares, but is grey and useless so I decided it was time to find a way to stop filling my inventory with it.

 

Back to the Generic MOD Enabler. When you first start using it GME will ask you to create a folder called "MODS" within the game's folder, I am assuming you followed its advice and did so.

 

First you will need to duplicate the folder structure of the game for those folders in which your files should be copied. Give your first Folder a meaningful name, mine is called "Shrink Spiked Defender". My MOD changes autoexec.txt which is in the folder "C:\Program Files\Deep Silver\Sacred 2 - Fallen Angel\scripts\" and adds a file called shield.txt to the folder "C:\Program Files (x86)\Deep Silver\Sacred 2 - Fallen Angel\scripts\shared\" therefore the structure of my MOD folders is like this

 

folders.jpg

 

At this point the folder "Shrink Spiked Defender" existed only on my Desktop where it was easy to find and work with.

 

I copied my autoexec.txt file into the "scripts" folder and the file shield.txt into the "shared" folder (within my MOD folders NOT the game folders).

 

Lastly I copied the Folder I named "Shrink Spiked Defender" into the MODS folder of the game ("C:\Program Files\Deep Silver\Sacred 2 - Fallen Angel\MODS\).

 

Upon opening GME I now see a new MOD using the folder name I gave it of "Shrink Spiked Defender" (now you understand the reason for the meaningful folder name).

 

My example MOD and how it works. How to shrink the Spiked Defender to occupy only one square of the Inventory.

 

First I had to find the item I wanted to shrink. I did that by looking through graphics05 in the pak folder using Granny Viewer Download until I found that used for the shield, c_ancientshield.GR2.

Next I searched the file "C:\Program Files\Deep Silver\Sacred 2 - Fallen Angel\scripts\shared\itemtype.txt" for c_ancientshield.GR2 which found the entry

 

newItemType = {

-- standard info

renderfamily = "RENDERFAM_SHIELD",

family = "FAMILY_SECONDARY",

subfamily = "SUBFAM_SEC_ARMSHIELD",

classification = "CLF_SPIKEDSHIELD",

flags = "FLAG_HASPREVIEWIMAGE",

weargroup = "WEARGROUP_INVALID",

-- 3d model + animation info

model0Data = {

name = "models/heroes/seraphim/sets/ancient/c_ancientshield.GR2",

user = "WEARGROUP_SERAPHIM",

},

-- logic bounding box

logicBox = {

minx=-15.174, miny=-5.29, minz=-1.474,

maxx=15.125, maxy=5.328, maxz=1.66,

},

dangerclass = 0,

}

mgr.typeCreate(1774, newItemType);

Note the newItemType number, 1774. My search for c_ancientshield.GR2 was thorough, I needed to be sure I would only be MODing the Spiked Defender and no other items which were the same GR2 file, there are none.

 

Next I found the entry for type=1774 in ItemInfo.txt, here it is unedited. The number for width is 2 and for height is 3.

 

newItemInfo = {

type = 1774,

material = "S_shield_leather_hardened",

usability = 0,

invbreite = 2,

invhoehe = 3,

}

mgr.itemInfoCreate(newItemInfo);

 

I copied that entry into my new shield.txt file as below and edited it. Note that I have changed the width to 1 and the height to 1. Yes, the file shield.txt really is that small!

 

local newItemType = {}

---------------------------------------------------------------------

-- Iteminfo for shrunken shield

---------------------------------------------------------------------

newItemInfo = {

type = 1774,

material = "S_shield_leather_hardened",

usability = 0,

invbreite = 1,

invhoehe = 1,

}

mgr.itemInfoCreate(newItemInfo);

 

Lastly, I edited the "Client & Server shared scripts" section of autoexec.txt file to include shield.txt (only the important bit shown)

 

"shared/shield.txt", -- changes size of shield to 1x1

"shared/itemInfo.txt", -- add item info

"shared/staticInfo.txt", -- add static info

"shared/spells.txt", -- initialize spells/moves system

 

Remember, there is an entry for the shield (item 1774) in ItemInfo.txt. I wanted to avoid editing that script because I have another MOD which overwrites that file so I did not want to edit it for my own MOD. The nice thing is that the item is only created once. Because the item has already been created by shield.txt the game ignores it within ItemInfo.txt when it finds it for the second time. That explains why shields.txt comes first within autoexec.txt.

 

Here are two screenshots showing how the shield looks before and after applying the MOD.

 

Original size

 

big.jpg

 

Shrunken

 

small.jpg

 

When I started writing I told you to read the note at the bottom, here it is!

 

It is possible that if you do not use this MOD as I intended it to be used you will lose items from your Inventory when the MOD is disabled, here is how that could happen. If you disable this MOD with the shield in your Inventory it will return to its original size, 2 across and 3 down, anything occupying any part of the 2x3 grid after disabling the MOD is sometimes lost forever. Of the 2x3 grid the shrunken shield takes up the top left square so before you disable the MOD simply make sure there are enough empty squares in the grid to allow for the growth of the shield. The safest thing to do is make sure you have either sold all of the shields or your character is holding those you want to keep, ie keep them out of your inventory altogether. I either do not pick up the shield or sell them when I get them, I keep them only for as long as it takes to sell them so in theory I should never have any of those shields before disabling the MOD. The shield size also changes in the Chest so take care there too.

Edited by Gordius
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
Please Sign In or Sign Up