-
Notifications
You must be signed in to change notification settings - Fork 4
/
Type.psc
190 lines (145 loc) · 4.4 KB
/
Type.psc
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
ScriptName System:Type Extends System:Object Native Const Hidden
{Represents type declarations.
**See Also**
* https://docs.microsoft.com/en-us/dotnet/api/system.type
* https://docs.microsoft.com/en-us/dotnet/api/system.reflection.memberinfo
* https://docs.microsoft.com/en-us/dotnet/api/system.reflection.propertyinfo
* https://docs.microsoft.com/en-us/dotnet/api/system.reflection.typeinfo
}
; Properties
;---------------------------------------------
Group Assembly
string Property FileName Hidden
{The data file plugin name.}
string Function Get()
return GetFileName()
EndFunction
EndProperty
string Property FileExtension Hidden
{The data file plugin name.}
string Function Get()
return GetFileExtension()
EndFunction
EndProperty
string Property File Hidden
{The data file plugin.}
string Function Get()
return GetFile()
EndFunction
EndProperty
EndGroup
; @virtual
; The data file plugin name.
string Function GetFileName()
{Property}
return "Fallout4"
EndFunction
; @virtual
; The data file plugin extension.
string Function GetFileExtension()
{Property}
return "esm"
EndFunction
; @virtual
; The data file plugin.
string Function GetFile()
{Property}
return FileName+"."+FileExtension
EndFunction
; Methods
;---------------------------------------------
bool Function Exists(string filename) Global
return Game.IsPluginInstalled(filename)
EndFunction
Form Function Read(string filename, int formID) Global
return Game.GetFormFromFile(formID, filename)
EndFunction
;---------------------------------------------
ScriptObject Function Cast(System:Type this, ScriptObject object, string script) Global
return this.CastAs(script)
EndFunction
var Function GetProperty(System:Type this, ScriptObject object, string member) Global
return this.GetPropertyValue(member)
EndFunction
bool Function SetProperty(System:Type this, ScriptObject object, string member, var value) Global
this.SetPropertyValue(member, value)
return true
EndFunction
bool Function SetPropertyNoWait(System:Type this, ScriptObject object, string member, var value) Global
this.SetPropertyValueNoWait(member, value)
return true
EndFunction
var Function Call(System:Type this, ScriptObject object, string member, var[] parameters) Global
return this.CallFunction(member, parameters)
EndFunction
bool Function CallNoWait(System:Type this, ScriptObject object, string member, var[] parameters) Global
this.CallFunctionNoWait(member, parameters)
return true
EndFunction
var Function CallGlobal(string script, string member, var[] parameters) Global
return Utility.CallGlobalFunction(script, member, parameters)
EndFunction
bool Function CallGlobalNoWait(string script, string member, var[] parameters) Global
Utility.CallGlobalFunctionNoWait(script, member, parameters)
return true
EndFunction
;---------------------------------------------
Struct FormType
string File
int FormID
Form Object
EndStruct
; Struct ArmorType
; string File
; int FormID
; Armor Object
; EndStruct
; Struct WeaponType
; string File
; int FormID
; Armor Object
; EndStruct
FormType Function NewForm(string file, int formID) Global
FormType value = new FormType
value.File = file
value.FormID = formID
return value
EndFunction
bool Function ReadForm(FormType value) Global
If (Exists(value.File))
value.Object = Read(value.File, value.FormID)
return value.Object
Else
return false
EndIf
EndFunction
; Objects
;---------------------------------------------
; Casts a variable into it's concrete object type.
ObjectReference Function AsReference(var this) Global
return this as ObjectReference
EndFunction
; Casts a variable into it's concrete object type.
Actor Function AsActor(var this) Global
return this as Actor
EndFunction
; Casts a variable into it's concrete object type.
ActiveMagicEffect Function AsActiveMagicEffect(var this) Global
return this as ActiveMagicEffect
EndFunction
; Casts a variable into it's concrete object type.
Quest Function AsQuest(var this) Global
return this as Quest
EndFunction
; Casts a variable into it's concrete object type.
ObjectMod Function AsObjectMod(var this) Global
return this as ObjectMod
EndFunction
; Casts a variable into it's concrete object type.
GlobalVariable Function AsGlobalVariable(var this) Global
return this as GlobalVariable
EndFunction
; Casts a variable into it's concrete object type.
Activator Function AsActivator(var this) Global
return this as Activator
EndFunction