Sacred 2:Changing Weapon Models (script)

From SacredWiki
Jump to navigation Jump to search

This mod changes the appearance of weapons by exchanging the models using the game scripts. The script that will be changed it the itemtype.txt file located in the scripts/shared directory in the Sacred 2 installation directory.

Always remember to backup any files that you change.

The first thing to do is to locate the model of the weapon that you wish to change. This can be done by using Granny viewer to view the models located in the pak/graphics05.zip directory.

Say the model that we wish to change is that of the Officer's Saber. Now we have to locate the model. Because it is a weapon and one handed odds are that it will be in the models/weapons/1h directory in graphics05.zip. Then you only have to browse through the models using Granny Viewer to locate the model that looks most like the model of the Officer's Saber in the game. The the model that looks the most like Officer's Saber (shown below) is l_saebel-c1.GR2, having found the model note the name as that it what is important to us.

saber_model.jpg

The next step is to locate the model that you wish to use instead of the normal default model, and this is done in the same way as finding the model for the Officer's Saber again note the name.

After that we have to locate where this model for the Officer's Saber is located in the itemtype.txt file. This can be done by searching for the name of the model, in this case it is l_saebel-c1.GR2. The instance looks something like this. [code]mgr.typeCreate(8184, newItemType);

newItemType = { -- standard info renderfamily = "RENDERFAM_WEAPON", renderprio = 0, family = "FAMILY_WEAPON", subfamily = "SUBFAM_PRI_SABER", classification = "CLF_SABER", flags = "FLAG_HASPREVIEWIMAGE", weargroup = "WEARGROUP_INVALID", -- 3d model + animation info model0Data = { name = "models/weapons/1h/l_saebel-c1.GR2", user = "WEARGROUP_DEFAULT", }, -- logic bounding box

 logicBox = {
   minx=-3.732, miny=-18.115, minz=-1.498, 
   maxx=3.518, maxy=23.794, maxz=1.498, 

}, dangerclass = 0, } [/code] After we have located the instance change the name of the model from l_saebel-c1.GR2 to the one of the model that you have choosen. Also note that there is a path name this also needs to be changed to the location where you found the model, if it is not in the same directory as the Saber model. There might also be multiple instance of the model that you are searching for and the correct one can be found by trial and error, or you could simply change all the instances to insure that the model is changed.

Doing this should change the model of the Officer's Saber to the one of your choice. The Officer's Saber was used in this discussion, but any weapon model can be changed to any other weapon model using this technique.

Any issues or queries can be discussed in the DarkMatters Modding forum and in the thread about this topic.