-
Notifications
You must be signed in to change notification settings - Fork 1
/
DM_GetFemForms_Botox.pas
104 lines (88 loc) · 2.35 KB
/
DM_GetFemForms_Botox.pas
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
unit DM_GetFemForms_Botox;
{
Hotkey: Ctrl+F6
}
interface
uses xEditApi;
implementation
var
addedRecs: Integer;
// Performs tests so the record can be considered valid.
// MODIFY THIS to suit your needs.
function Tests(e: IInterface): Boolean;
begin
Result := true;
Result := Result and ContainsText(GetEditValue(ElementBySignature(e, 'RNAM')), 'vampire')
end;
function GetFormId(e: IInterface): string;
begin
Result := RightStr(IntToHex(FixedFormID(e), 1), 4)
end;
function IsFem(e: IInterface): Boolean;
begin
Result := GetElementEditValues(e, 'ACBS\Flags\Female') = '1';
end;
procedure LogName(e: IInterface);
var
n: string;
begin
n := GetEditValue(ElementBySignature(e, 'FULL'));
if n = '' then
n := Format('Unnamed NPC [%s]', [GetFormId(e)]);
AddMessage(
Format('%s was added to patch', [n])
);
end;
function Initialize: integer;
begin
addedRecs := 0;
// Crear archivo esl AddNewFileName('Botox SE - ', true)
// Agregar records
end;
function ReplacePath(e: IInterface; aPath: string): string;
var
fn: string;
begin
fn := GetElementEditValues(e, aPath);
fn := StringReplace(
fn,
'actors\character\character assets\Botox\Hair\',
'KS Hairdo''s\',
[rfReplaceAll, rfIgnoreCase]
);
Result := StringReplace(fn, 'Human\', '', [rfReplaceAll, rfIgnoreCase]);
SetElementEditValues(e, aPath, Result)
end;
procedure RenamePath(e: IInterface);
begin
AddMessage(GetEditValue(ElementBySignature(e, 'FULL')));
AddMessage(ReplacePath(e, 'Model\MODL'));
// RemoveElement(e, 'Parts') // Process hairlines
// AddMessage(ReplacePath(e, 'Parts\Part #0\NAM1')); // Process hairs
end;
function Process(e: IInterface): Integer;
begin
if (Signature(e) = 'NPC_') and IsFem(e) and Tests(e) then begin
addedRecs := addedRecs + 1;
LogName(e);
// Agregar HighestOverrideOrSelf al archivo
end;
if (Signature(e) = 'HDPT') then begin
RenamePath(e);
end;
end;
function Finalize: Integer;
begin
AddMessage(Format('Finished. %d records added.', [addedRecs]));
end;
// function GenBatchMove(e: IInterface): string;
// begin
// Result := Format('robocopy "%%s%%" "%%d%%" *%s.* /S', [GetFormId(e)])
// end;
// Old method. Don't use this anymore.
// function GenRobocopy(e: IInterface): string;
// begin
// AddMessage( ':: ' + GetEditValue(ElementBySignature(e, 'FULL')) );
// AddMessage( GenBatchMove(e) );
// end;
end.