Author Topic: Changing Robes  (Read 321 times)

Legacy_WhenTheNightComes

  • Jr. Member
  • **
  • Posts: 53
  • Karma: +0/-0
Changing Robes
« on: June 07, 2013, 08:19:51 pm »


               I can't quite seem to get ahold of how to change the robe model of the currently equiped armor from a conversation. I would like to make an option for both previous, and next robe model. Help? Thanks.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Changing Robes
« Reply #1 on: June 07, 2013, 11:21:54 pm »


               CopyItemAndModify(oArmor,
ITEM_APPR_TYPE_ARMOR_MODEL,
ITEM_APPR_ARMOR_MODEL_ROBE,
nRobeType, TRUE);

BioWare uses the following values in its craft armor dialogue:
0: no robe
3: casual robe
4: formal robe
5: sleeveless wizard's robe
6: wizard's robe

EDIT: To get what the current robe model is use GetItemAppearance().
               
               

               


                     Modifié par WhiZard, 07 juin 2013 - 10:39 .
                     
                  


            

Legacy_WhenTheNightComes

  • Jr. Member
  • **
  • Posts: 53
  • Karma: +0/-0
Changing Robes
« Reply #2 on: June 08, 2013, 01:37:55 am »


               This is what I have so far..

void main()
{

object oPC = GetPCSpeaker();
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
int nRobeType = GetItemAppearance(oArmor,ITEM_APPR_TYPE_ARMOR_MODEL,ITEM_APPR_ARMOR_MODEL_ROBE);
CopyItemAndModify(oArmor,ITEM_APPR_TYPE_ARMOR_MODEL,ITEM_APPR_ARMOR_MODEL_ROBE,nRobeType + 1, TRUE);

}

Doesn't seem to work! Tips?
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Changing Robes
« Reply #3 on: June 08, 2013, 03:44:40 am »


               Robe types 1 and 2 are undefined (have the same appearance as the no robe appearance) so going from 0 up would take multiple iterations.  Here's a quick change that will keep your return within the proper bounds.


void main()
{

object oPC = GetPCSpeaker();
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
int nRobeType = GetItemAppearance(oArmor,ITEM_APPR_TYPE_ARMOR_MODEL,ITEM_APPR_ARMOR_MODEL_ROBE);
nRobeType++;
if(nRobeType < 4) nRobeType = 3;
if(nRobeType > 6) nRobeType = 0;
CopyItemAndModify(oArmor,ITEM_APPR_TYPE_ARMOR_MODEL,ITEM_APPR_ARMOR_MODEL_ROBE,nRobeType, TRUE);

}
               
               

               


                     Modifié par WhiZard, 08 juin 2013 - 02:45 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Changing Robes
« Reply #4 on: June 09, 2013, 06:47:25 pm »


               An additional way in which the issue might not be seen as working is if you are expecting the equipped item to change appearance itself.  It is the copy that has the appearance change and the original item is best destroyed; allowing you to equip the replacement.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Changing Robes
« Reply #5 on: June 10, 2013, 04:24:51 am »


               A few years ago I put together a robe swapping conversation and set of scripts that does much more than you are asking for.  I uploaded an erf of the conversation and scripts here:

http://social.biowar...t_file_id=14508

These files (in an ERF) are not set up for a novice. A skille scripter however could make good use of them.

What they do:
- in order to wear a particular robe or coat a PC must have them in their inventory
- when putting on a robe or coat, the underlying armor, if it uses a robe model (such as the DLA elven chain armor or many of the Project Q armors) for its appearance, will not be damaged. It saves the robe model for the underlying armor so that it can be restored when the player removes their coat/robe again.
- the coat when worn retains its own color, and displays properly. the armor underneath retains its color. if dye is applied while the coat is worn, it is applied properly. (Each robe gets its own mask values that a builder/scripter will have to define, and this mask determines how colors are applied and presented)

That is generally all the system does. I did have a few extra things in there, and more planned such as the ability to separate armors into pieces so that players could mix and match chain shirts with leather or padding etc... but never finished that code as it gets complicated with armors that have special properties/magical abilities.

Anyway, the upload/erf I have linked for you is for advanced users. Someday I may organize it to be an easy to implement system. At present however there is some assembly required. All are free to make use of it.