SHARE
TWEET

Untitled

a guest Apr 26th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     "Ramar" : async function() {
  2.  
  3.         let plMod = await NinjaFile.API.load("pldnj.bml");
  4.         let plTex = await NinjaFile.API.load("pldtex.afs");
  5.         let plMot = await NinjaFile.API.load("plymotiondata.pr2");
  6.  
  7.         let bml = NinjaFile.API.bml(plMod);
  8.         let afs = NinjaFile.API.afs(plTex, true);
  9.         let mot = NinjaFile.API.prc(plMot);
  10.  
  11.         console.log("--- Parse All Textures ---");
  12.  
  13.         let texList = new Array(afs.length);
  14.         for(let i = 0; i < afs.length; i++) {
  15.             texList[i] = NinjaTexture.API.parse(afs[i]);
  16.         }
  17.  
  18.         console.log("--- Load Body ---");
  19.  
  20.         console.log(afs[0]);
  21.  
  22.         let bdyTex = [
  23.             texList[123],
  24.             texList[4],
  25.             texList[5],
  26.             texList[6],
  27.             texList[111]
  28.         ];
  29.  
  30.         let bdyLoader = new NinjaModel(this + "_body", bdyTex);
  31.         bdyLoader.parse(bml["plDbdy00.nj"]);
  32.         bdyLoader.plyMotion(mot);
  33.         let body = bdyLoader.getModel();
  34.  
  35.         console.log("--- Load Head ---");
  36.  
  37.         let hedTex = [
  38.             texList[63],
  39.             texList[64]
  40.         ];
  41.  
  42.         let hedLoader = new NinjaModel(this + "_head", hedTex);
  43.         hedLoader.parse(bml["plDhed00.nj"]);
  44.         let head = hedLoader.getModel();
  45.  
  46.         console.log("--- Load Hair ---");
  47.  
  48.         let haiTex = [
  49.             texList[103],
  50.             texList[104],
  51.             texList[105]
  52.         ];
  53.  
  54.         let haiLoader = new NinjaModel(this + "_hair", haiTex);
  55.         haiLoader.parse(bml["plDhai00.nj"]);
  56.         let hair = haiLoader.getModel();
  57.  
  58.         console.log("--- Load Cap ---");
  59.  
  60.         let capTex = [
  61.             texList[2],
  62.             texList[3]
  63.         ];
  64.  
  65.         let capLoader = new NinjaModel(this + "_cap", haiTex);
  66.         capLoader.parse(bml["plDcap00.nj"]);
  67.         let cap = capLoader.getModel();
  68.  
  69.         let meshList = [head, hair, cap];
  70.  
  71.         for(let key in bml) {
  72.  
  73.             bml[key].seekSet(0);
  74.             let ldr = new NinjaModel(key.replace(".nj", ""));
  75.             ldr.parse(bml[key]);
  76.             meshList.push(ldr.getModel());
  77.  
  78.         }
  79.  
  80.         console.log("--- Display Model ---");
  81.  
  82.         body.skeleton.bones[59].add(head);
  83.         body.skeleton.bones[59].add(hair);
  84.         body.skeleton.bones[59].add(cap);
  85.  
  86.         NinjaPlugin.API.setPlayer(this, body, meshList, texList);
  87.  
  88.     },
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top