Crafting Table JSON

Hints and Guidelines, How To's on Registration, Activation, NWN, etc.

Moderators: Forum Moderators, Active DMs

Post Reply
Morderon
Technical Lead
Technical Lead
Posts: 1271
Joined: Mon Sep 08, 2014 2:24 am

Crafting Table JSON

Post by Morderon » Wed May 30, 2018 5:41 pm

https://pastebin.com/2knD3fWV

Craft values:
CARPENTER = 1;
COOK/Herbology = 2;
ART = 3;
FORGE = 4;
Alchemy = 5;
SEW = 6;


Class & SubRace & Settings use bitwise

Settings:

LVLADDITIVE = 0x08; Adds all associated class levels to see if they meet requirements
ONESKILL = 0x10; If set only need to pass one skill check
ONEFEAT = 0x20; If set only need to have one feat
ABILITY = 0x40; //If set, adds ability modifier to skill
SKILLFEAT = 0x80; //If set adds applicable feats to skill

Class:
BARB = 0x01;
BARD = 0x02;
CLERIC = 0x04;
DRUID = 0x08;
FIGHT = 0x10;
MONK = 0x20;
PALADIN = 0x40;
RANGER = 0x80;
ROGUE = 0x100;
SORC = 0x200;
WIZARD = 0x400;
ARCANE_ARCHER = 0x800;
ASSASSIN = 0x1000;
CHAMPION = 0x2000;
DRAG_DISCIPLE = 0x4000;
DWARVENDEFENDER = 0x8000;
BLACKGUARD = 0x10000;
HARPER = 0x20000;
SHIFTER = 0x80000;
WEAPONMASTER = 0x100000;
SHADOWDANCER = 0x200000;
PDK = 0x1000000;
//And a few paths
WARLOCK = 0x400000;
FAVSOUL = 0x800000;

Subraces:

DWARF = 0x01; //use for shield as well!
ELF = 0x02; //use for moon as well!
HORC = 0x04;
HUMAN = 0x08;
HELF = 0x10;
HLING = 0x20; //use for lightfoot
GNOME = 0x40; //use for rock gnomes too
//Now monster subraces
DUERGAR = 0x80;
DROW = 0x100;
DEEP_GNOME = 0x200;
OROG = 0x400;
GNOLL = 0x800;
FEY = 0x1000;
GOBLIN = 0x2000;
KOBOLD = 0x4000;
FOREST_GNOME = 0x8000;
SUN_ELF = 0x10000;
WOOD_ELF = 0x20000;
WILD_ELF = 0x40000;
DWARF_GOLD = 0x80000;
AASIMAR = 0x100000;
TIEFLING = 0x200000;
HL_STR = 0x400000;
HL_GHOST = 0x800000;
HOBGOBLIN = 0x1000000;
IMP = 0x2000000;
OGRE = 0x4000000;
DWARF_WILD = 0x8000000;
DEEP_IMASKARI = 0x10000000;

Feats - Value matches corresponding value in Feats.2da

Skills - Value matches corresponding value in Skills.2da
Last edited by Morderon on Tue Jan 15, 2019 8:50 pm, edited 1 time in total.

Morderon
Technical Lead
Technical Lead
Posts: 1271
Joined: Mon Sep 08, 2014 2:24 am

Re: Crafting Table JSON

Post by Morderon » Wed May 30, 2018 5:52 pm

Google app script example below, which is a language based off of javascript. Set var response to the contents of the json file iin whatever method you choose.

Code: Select all

function myFunction() {

    var response = <jsonfiletextcontents>


 //Logger.log(response);
  var payload = JSON.parse(response);
  
  
  var item;
  
  var typeLine;
  var name;
  var inname;
  var holder;
  
  for(var i = 0; i < payload.length; i++)
  {
    item = payload[i];
    name = item["Name"];
    holder = item["Input"];
    inname = "";
    for(var x = 0; x < holder.length; x++)
    {
      inname += " " + holder[x]["Name"];
    }
    Logger.log("Recipe " + name + " Input Name(s): " + inname);
  } 
}

User avatar
Mattamue
Arelith Silver Supporter
Arelith Silver Supporter
Posts: 468
Joined: Mon Dec 10, 2018 1:45 am

Re: Crafting Table JSON

Post by Mattamue » Fri Jan 11, 2019 10:04 pm

Would running this somehow let me check recipes outside of the server, or is this just showing how it was done?

Who is the audience for this post?


Morderon
Technical Lead
Technical Lead
Posts: 1271
Joined: Mon Sep 08, 2014 2:24 am

Re: Crafting Table JSON

Post by Morderon » Tue Jan 15, 2019 8:52 pm

It can be used to get recipe list (and more) outside of the server.

The code snippet doesn't do it for you, at least not in a good/useable format. The purpose of the snippet is just to show how the json can be read/accessed.

Updated the json above.

Post Reply