Author Topic: Question about importing/exporting NPCs  (Read 237 times)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9836
Question about importing/exporting NPCs
« on: April 07, 2017, 06:11:10 PM »
I've been doing a lot with importing and exporting of NPCs for several projects. There are a couple of keywords that I have noticed that I may like to use, but I do not know the format expected in the text file to be imported correctly into DC. I would like to know the formats. :) In Particular, the first one, since I would like to add or modify skills for all of the NPCs. (Yes, I could write an SA for each single NPC, load the NPC into a party, run the party to an event that fires the SA, then remove each member of the party hoping that DC is overwriting the original NPC becaue I think I have the correct box checked)

"skillAdjustments":[],

"spellAdjustments":[],
   
"spellEffects":[],
   
"spellbook":{
   "useLimits":"true",
   "spellList":[]
   },
      
"money":{
   "coins":[0,0,0,0,0,0,0,0,0,0],
   "gems":[],
   "jewels":[]
},
   
   

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2235
Re: Question about importing/exporting NPCs
« Reply #1 on: April 07, 2017, 07:20:51 PM »
Quote from: Mnikus
"skillAdjustments":[],

Here is the code for exporting and importing a Skill Adjustment:

Code: [Select]
void SKILL_ADJ::Export(JWriter& jw)
{
  NotImplemented(0xad9d, false);
  /*
    car << skillID;
    car << adjID;
    car << value;
    car << type;
    */
}
void SKILL_ADJ::Import(JReader& jr)
{
  NotImplemented(0xad9e, false);
  /*
    car << skillID;
    car << adjID;
    car << value;
    car << type;
    */
}

As you can see, it is minimal.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9836
Re: Question about importing/exporting NPCs
« Reply #2 on: April 08, 2017, 03:23:57 PM »
Thank you, Paul.

In this case, I think minimal is better.
« Last Edit: April 08, 2017, 06:24:50 PM by manikus »

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9836
Re: Question about importing/exporting NPCs
« Reply #3 on: April 20, 2017, 01:16:32 PM »
Quote from: Mnikus
"skillAdjustments":[],

Here is the code for exporting and importing a Skill Adjustment:

Code: [Select]
void SKILL_ADJ::Export(JWriter& jw)
{
  NotImplemented(0xad9d, false);
  /*
    car << skillID;
    car << adjID;
    car << value;
    car << type;
    */
}
void SKILL_ADJ::Import(JReader& jr)
{
  NotImplemented(0xad9e, false);
  /*
    car << skillID;
    car << adjID;
    car << value;
    car << type;
    */
}

As you can see, it is minimal.

What do you need from me so we can move forward on getting SkillAdj to work when importinag/exporting NPCs?

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2235
Re: Question about importing/exporting NPCs
« Reply #4 on: April 20, 2017, 01:25:00 PM »
You need to stop sending me other problems and
push this to the top of the queue.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9836
Re: Question about importing/exporting NPCs
« Reply #5 on: April 20, 2017, 01:40:40 PM »
You need to stop sending me other problems and
push this to the top of the queue.

Aside from the wall graphics error, which I did send an email saying that you should consider it done on your side until further notice, what else do I need to not send? ;)

I know that there are other issues in the forum, but until those people send me mini-mods, they are not something I consider us to be working on.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2235
Re: Question about importing/exporting NPCs
« Reply #6 on: April 20, 2017, 04:05:45 PM »
OK.  Should be ready in a few days.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2235
Re: Question about importing/exporting NPCs
« Reply #7 on: April 20, 2017, 07:43:59 PM »
SkillAdjustments can be imported/exported in editor 2.84.
(Available in ten minutes)

Sample:
Code: [Select]
   "magicResistance":"0",
   "baseclassStats":[
      {
         "baseclassID":"wiz",
         "currentLevel":"40",
         "previousLevel":"0",
         "preDrainLevel":"0",
         "experience":"11250001"
      }
   ],
   "skillAdjustments":[
      {
         "SkillID":"Climbing",
         "AdjustmentID":"asdfgh",
         "AdjustmentAmount":"5",
         "AdjustmentType":"+"
      },
      {
         "SkillID":"Peeking",
         "AdjustmentID":"17qwer",
         "AdjustmentAmount":"20",
         "AdjustmentType":"%"
      }
   ],
   "spellAdjustments":[],
   "isPregen":"1",

Offline Milos Gulan

  • Hero Member
  • *****
  • Posts: 3154
Re: Question about importing/exporting NPCs
« Reply #8 on: April 21, 2017, 12:54:21 AM »
Thank You, I have updated my files and have made mini mod will try to upload it now :)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9836
Re: Question about importing/exporting NPCs
« Reply #9 on: April 21, 2017, 12:31:10 PM »
Thank you, Paul.

I will give this a workover this weekend.
Our queue is currently empty, and will be until Monday. :) I own't be in this weekend and will not send you Milos' bug until Monday (assuming it is not something that I can't take care of).

 

anything