Author Topic: helmet /shield craft without cep  (Read 347 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
helmet /shield craft without cep
« on: January 18, 2011, 02:13:57 am »


               I have been working on 2 mods.One with a team that has CEP and one that is mine without CEP.

The one without cep ,I have modified to have no cost or DC for craft armor /craft weapon.I added the 4 extra robes from the vault.I added the cloak craft lever. What I need now is to add the helmet and shield craft scripts if anyone has a link or knows where to find them.I cant seem to find the right one.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
helmet /shield craft without cep
« Reply #1 on: January 18, 2011, 09:18:07 am »


               Well I can at least post some simple helmet changing scripts. You'd have to make your own convo unless you want me to mail you one or what not.
This first one would advance the helmet to the next appearance:

//change to next helmet appearance
void main()
{
object oPC = GetPCSpeaker();
object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC);
int iCurrentApp = GetItemAppearance(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0);
int iNewApp = iCurrentApp + 1;
int iMax = StringToInt(Get2DAString("baseitems", "MaxRange", BASE_ITEM_HELMET));
if (iNewApp > iMax) iNewApp = 1;

object oNewHelm = CopyItemAndModify(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0, iNewApp, TRUE);
while (!GetIsObjectValid(oNewHelm))
    {
    iNewApp++;
    if (iNewApp > iMax) iNewApp = 1;
    oNewHelm = CopyItemAndModify(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0, iNewApp, TRUE);
    }

DestroyObject(oHelm);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionEquipItem(oNewHelm, INVENTORY_SLOT_HEAD));
//test line to see appearance #
//SendMessageToPC(oPC, "Appearance # " + IntToString(iNewApp));
}


And this one to go to the previous appearance:

//change to previous helmet appearance
void main()
{
object oPC = GetPCSpeaker();
object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC);
int iCurrentApp = GetItemAppearance(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0);
int iNewApp = iCurrentApp - 1;
int iMax = StringToInt(Get2DAString("baseitems", "MaxRange", BASE_ITEM_HELMET));
if (iNewApp < 1) iNewApp = iMax;

object oNewHelm = CopyItemAndModify(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0, iNewApp, TRUE);
while (!GetIsObjectValid(oNewHelm))
    {
    iNewApp--;
    if (iNewApp < 1) iNewApp = iMax;
    oNewHelm = CopyItemAndModify(oHelm, ITEM_APPR_TYPE_ARMOR_MODEL, 0, iNewApp, TRUE);
    }

DestroyObject(oHelm);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionEquipItem(oNewHelm, INVENTORY_SLOT_HEAD));
//test line to see appearance #
//SendMessageToPC(oPC, "Appearance # " + IntToString(iNewApp));
}


Hope that helps. Good luck.

P.S. These would be easy to alter for the sheild appearances as well. You could have separate objects or NPCs that allow for changing the sheilds and helmets or you could wrap it up into one convo by setting some variable in the convo. You could also make it all one script. There are a lot of ways to go about this. Probably even some simpler versions of what I posted as well. I'm not the best scripter.':lol:'
               
               

               


                     Modifié par GhostOfGod, 18 janvier 2011 - 09:19 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
helmet /shield craft without cep
« Reply #2 on: January 18, 2011, 06:05:08 pm »


               Ahh this is great ...I will work on adding these to the craft conversation .Im not a scripter by any means ..but I'm getting pretty good at stuffing things together.Thanks GOG.
               
               

               
            

Legacy_ent.devil

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
helmet /shield craft without cep
« Reply #3 on: January 18, 2011, 07:54:12 pm »


               I'm curious why you have different model ranges to the script I have GOG.

I used a literal based on trial and error rather than looking at the 2da (errmmm mainly because I forgot it was there tbh ':unsure:') and the largest model number I could use was 35 rather than the 50 that the default 2da lists for a helm. The models after this were not helms when I tried it, then again I was using:

 oNew = CopyItemAndModify(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0, nModel, TRUE);

in my script, wonder if I'm missing some choices, the last model in the list is the funny sparkly one?
Also with the shields there are different ranges depending on what type of shield it is and again using the ITEM_APPR_TYPE_SIMPLE_MODEL I have these as the limits:

    switch(GetBaseItemType(oItem)) {
      case BASE_ITEM_TOWERSHIELD:
        if (nModel == 13) {
          nModel = 21;
        } else if (nModel == 23) {
          nModel = 31;
        } else if (nModel == 33) {
          nModel = 41;
        } else if (nModel == 43) {
          nModel = 51;
        } else if (nModel == 51) {
          nModel = 11;
        } else {
          nModel++;
        }
        break;
      case BASE_ITEM_SMALLSHIELD:
        if (nModel == 13) {
          nModel = 21;
        } else if (nModel == 23) {
          nModel = 31;
        } else if (nModel == 33) {
          nModel = 41;
        } else if (nModel == 43) {
          nModel = 11;
        } else {
          nModel++;
        }
        break;
      case BASE_ITEM_LARGESHIELD:
        if (nModel == 13) {
          nModel = 21;
        } else if (nModel == 23) {
          nModel = 31;
        } else if (nModel == 33) {
          nModel = 41;
        } else if (nModel == 43) {
          nModel = 51;
        } else if (nModel == 56) {
          nModel = 61;
        } else if (nModel == 75) {
          nModel = 11;
        } else {
          nModel++;
        }
        break;
    }

Do yours use the ITEM_APPR_TYPE_ARMOR_MODEL and do they all show the 100 shield types the 2da would suggest they would (assuming the same type script)?
               
               

               


                     Modifié par ent.devil, 18 janvier 2011 - 07:58 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
helmet /shield craft without cep
« Reply #4 on: January 19, 2011, 05:14:55 am »


               The one I posted is just a bit more universal. You should be able to use it with whatever baseitems 2da the mod is using. Then you don't have to go into your 2da to see which numbers are there and which to exclude, etc..It just looks for the max number in the 2da. And then you got the while loop there to make sure that the new helm created is a valid object. If not it just gos to the next model #. Similar to how CEP did int in their craft include.

And yes it is using  ITEM_APPR_TYPE_ARMOR_MODEL
               
               

               


                     Modifié par GhostOfGod, 19 janvier 2011 - 05:18 .
                     
                  


            

Legacy_Artistmonk

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +0/-0
helmet /shield craft without cep
« Reply #5 on: May 06, 2011, 10:54:02 pm »


               Excuse me GoG, what exactly is your script doing to helmet, changing its apperance only?