-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNBNKtoCSV.1sc
60 lines (60 loc) · 2.92 KB
/
NBNKtoCSV.1sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//------------------------------------------------
//--- 010 Editor v9.0.2 Script File
//
// File:
// Authors:
// Version:
// Purpose:
// Category:
// History:
//------------------------------------------------
int i;
int j;
int k;
int l;
local int lastParent;
local int lastWemID;
void HIRCtoCSV (){
int fileNum = GetFileNum();
FileNew("Text",true);
int newFileNum = GetFileNum();
FileSelect(fileNum);
string s;
string se;
string st;
string sa;
FPrintf(newFileNum, "Wem ID|ArrayDeclare|ScriptRun|Parent\n");
for (i = 1; i<2;i++){
if (MainBlock[i].Header.blockID == 1129466184){
for (j = 0;j<MainBlock[i].HIRCBlock.structCount;j++){
if (MainBlock[i].HIRCBlock.HIRCData[j].StructHeader.blockID == 11){
if(MainBlock[i].HIRCBlock.HIRCData[j].musictrack.unknCount!=0){
lastParent = MainBlock[i].HIRCBlock.HIRCData[j].musictrack.parentBus;
lastWemID = MainBlock[i].HIRCBlock.HIRCData[j].musictrack.wemID;
s = "";
SPrintf(s,"double array%d[%d] = {", j, MainBlock[i].HIRCBlock.HIRCData[j].musictrack.unknCount*4);
for(k=0;k<MainBlock[i].HIRCBlock.HIRCData[j].musictrack.unknCount;k++){
st = "";
SPrintf(st, "%lf, %lf, %lf, %lf,", MainBlock[i].HIRCBlock.HIRCData[j].musictrack.startingPointNegative[k],MainBlock[i].HIRCBlock.HIRCData[j].musictrack.startingPointPositive[k],MainBlock[i].HIRCBlock.HIRCData[j].musictrack.remainderOfSong[k],MainBlock[i].HIRCBlock.HIRCData[j].musictrack.songTotalLength[k]);
s += st;
};
s = StrDel(s, Strlen(s)-1,1);
s+="};";
SPrintf(se, "MusicTrackMultiVar(%d, %d, array%d);",MainBlock[i].HIRCBlock.HIRCData[j].musictrack.objectID ,MainBlock[i].HIRCBlock.HIRCData[j].musictrack.unknCount,j);
FPrintf(newFileNum, "%d|%s|%s|%d\n", MainBlock[i].HIRCBlock.HIRCData[j].musictrack.wemID, s, se, MainBlock[i].HIRCBlock.HIRCData[j].musictrack.parentBus);
};
};
if (MainBlock[i].HIRCBlock.HIRCData[j].StructHeader.blockID == 10){
if(MainBlock[i].HIRCBlock.HIRCData[j].musicsegment.objectID == lastParent){
sa = "";
SPrintf(sa, "MusicSegmentSpecificVar(%d, %lf, %lf);", MainBlock[i].HIRCBlock.HIRCData[j].musicsegment.objectID, MainBlock[i].HIRCBlock.HIRCData[j].musicsegment.loopTime1, MainBlock[i].HIRCBlock.HIRCData[j].musicsegment.loopTime2);
FPrintf(newFileNum, "||%s|%d\n", sa, MainBlock[i].HIRCBlock.HIRCData[j].musicsegment.objectID);
};
};
};
};
};
FileSelect(newFileNum);
FileSave("bgm_ingame_cmn.csv");
};
HIRCtoCSV();