forked from reyhard/o2scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
renameSoundMemoryPoints.bio2s
90 lines (80 loc) · 2.37 KB
/
renameSoundMemoryPoints.bio2s
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include "std\lodNames.inc"
#include "std\o2config.inc"
#include "std\paramFile.inc"
#include "CheckMat.inc.bio2s"
#include "std\flags.inc"
_toFind = [
"sound_WindObjectInner0SpotFallingDirt_1",
"sound_WindObjectInner0SpotFallingDirt_2",
"sound_RainObjectInner0SpotMetal2_1",
"sound_RainObjectInner0SpotMetal2_2",
"sound_RainObjectInner3Metal3_1",
"sound_RainObjectInner1Tile_1",
"sound_WindObjectInner0SpotMetalGate_1",
"sound_WindObjectInner0SpotWoodGate_1"
];
_toReplace =
[
"sound_wind_debris_light_01",
"sound_wind_debris_light_02",
"sound_rain_metalTin_small_narrow_1",
"sound_rain_metalTin_small_narrow_2",
"sound_rain_metalTin_small_1",
"sound_rain_tiles_small_1",
"sound_wind_gate_metal",
"sound_wind_gate_wood"
];
scopeName "CheckAll";
console = openStandardIO;
if (typename this=="STRING") then
{
p3d=newLODObject;
p3dname=this;
if (!(p3d loadP3d this)) then { console<<"Unable to open:"<<this<<eoln;BreakTo "CheckAll";};
runFromO2=false;
texpath=((splitPath p3dname) @ 0);
console<<"----------------------------------------------------------------------"<<eoln;
console<<"Checking file: "<<p3dname<<eoln;
}
else
{
p3dname=nameof this;
p3dname=splitPath p3dname;
p3dname=p3dname @ 2 + p3dname @ 3;
runFromO2=true;
p3d=this;
texpath=o2GetConfig IDS_CFGPATHFORTEX;
console<<"--------- Checking "<<p3dname<<" ------"<<eoln;
};
_found = false;
_LODs = getObjects p3d;
_resolutions = getResolutions p3d;
_objects = getObjects p3d;
_memoryPointsList = [];
for "_i" from 0 to ((count p3d) - 1) do
{
_currentLOD = _LODs @ _i;
_currentResolution = _resolutions @ _i;
_currentObject = _objects @ _i;
if(LOD_MEMORY == _currentResolution)then
{
{
_searchIndex = _toFind find _x;
if(_searchIndex >= 0)then
{
console<< "index name"<<str(_searchIndex) << str(_x) <<eoln << eoln;
_sel = _currentLOD loadSelection _x;
_currentLOD save _sel as (_toReplace select _searchIndex);
_currentLOD deleteSelection _x;
_found = true;
};
}forEach (getSelections _currentObject);
};
};
if (_found and !runFromO2) then
{
console<< eoln << p3dname << eoln<<" --------- Memory points found & replaced ------" << eoln << eoln;
if (!save p3d)then {console <<"unable to SAVE "<<p3dname<<eoln;};
}else{
console<< p3dname <<" --------- No memory points found ------" << eoln << eoln;
};