forked from llde/xOBSE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobse_command_doc.html
7736 lines (5948 loc) · 655 KB
/
obse_command_doc.html
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<style type="text/css">
/* body */
body {
padding: 10%;
}
/* headings */
h1 {
font-size: 150%;
font-weight: normal;
}
h2 {
font-size: 130%;
font-weight: normal;
margin-top: 40px;
}
h3 {
font-size: 110%;
font-weight: normal;
margin-top: 30px;
color: #000099;
background-color: #ffffff;
}
h4 {
font-size: 100%;
font-weight: bold;
margin-bottom: 0px;
}
h5 {
font-size: 100%;
font-weight: bold;
margin-bottom: 0px;
color: #000099;
background-color: #ffffff;
}
/* tables */
table {
border: 1px solid black;
margin: 20px 0px 20px 0px;
}
caption {
text-align: left;
margin-bottom: 10px;
}
td, th {
padding: 5px;
}
tr.alt {
color: black;
background-color: #dedede;
}
code.alt {
color: 770000;
background-color: #dedede;
}
table.functionIndex td{
padding: 0px 30px 0px 5px;
}
/* lists */
ul {
list-style-type: none;
}
/* box highlighting */
.boxhl {
border: 1px dotted black;
padding: 8px;
color: #000000;
background-color: #eeeeff;
}
/* box hl for calling conventions */
.code {
border: 1px solid black;
padding: 20px;
font-family: monospace;
color: #770000;
background-color: #ffffff;
}
/* code box */
pre {
color: #770000;
background-color: #ffffff;
}
/* code syntax */
code.s {
margin-left: 40px;
font-weight: normal;
color: #770000;
background-color: #ffffff;
}
/* code syntax in descriptive text */
code {
color: #000000;
background-color: #ffffff;
}
/* optional parameters */
span.op {
font-style: italic;
color: #666666;
background-color: #ffffff;
}
/* message box examples */
pre.msgbox {
color: #777700;
background-color: #ffffff;
font-family: serif;
}
/* indentation and text alignment */
.ind {
margin-left: 40px;
}
.c {
text-align: center;
}
.l {
text-align: left;
}
/* links */
.f {
color: #3333cc;
background-color: white;
}
a:link.f{
text-decoration: none;
color: #3333cc;
background-color: white;
}
a:visited.f {
text-decoration: none;
color: #3333cc;
background-color: white;
}
a:focus.f {
text-decoration: underline;
color: #0000ff;
background-color: white;
}
a:hover.f {
text-decoration: underline;
color: #0000ff;
background-color: white;
}
a:active.f {
text-decoration: none;
color: #ff0000;
background-color: white;
}
a:link.cf{
text-decoration: none;
color: #3333cc;
background-color: white;
}
a:visited.cf {
text-decoration: none;
color: #3333cc;
background-color: white;
}
a:focus.cf {
text-decoration: underline;
color: #0000ff;
background-color: white;
}
a:hover.cf {
text-decoration: underline;
color: #0000ff;
background-color: white;
}
a:active.cf {
text-decoration: none;
color: #ff0000;
background-color: white;
}
a:link img {
border-style: none;
}
a:visited img {
border-style: none;
}
</style>
<title>OBSE Command Documentation</title>
<meta name="keywords" content="OBSE, oblivion, script, extender, mod, modding" />
</head>
<body>
<h1>xOBSE v0022.5.0 Command Documentation</h1>
<p><a href="http://cs.elderscrolls.com/index.php?title=Category:Oblivion_Script_Extender">OBSE @ Oblivion Construction Set Wiki</a> - follow the links throughout this documentation to gain access to additional information on the official Oblivion Construction Set Wiki. Users are encouraged to add to the wiki.<br />
<a href="https://github.com/llde/xOBSE">xOBSE @ GitHub</a> is is a community maintained up-to-date fork of Oblivion Script Extender (OBSE).
<h2>Table of Contents</h2>
<ul>
<li><a href="#New_xOBSE_Features">New xOBSE Features</a></li>
<li><a href="#New_Functions">New Features</a></li>
<li><a href="#Function_Syntax_Format">Function Syntax Format</a></li>
<li><a href="#Function_Calling_Conventions">Function Calling Conventions</a></li>
<li><a href="#Qualities">Qualities</a></li>
<li><a href="#Oblivion_Types">Types</a></li>
<li><a href="#General_Functions">General Functions</a></li>
<li><a href="#Cloning_Functions">Cloning Functions</a></li>
<li><a href="#Flow_Control_Functions">Flow Control Functions</a></li>
<li><a href="#Ref_Walking_Functions">Ref Walking Functions</a></li>
<li><a href="#Console_Functions">Console Functions</a></li>
<li><a href="#Input_Functions">Input Functions</a></li>
<li><a href="#Math_Functions">Math Functions</a></li>
<li><a href="#Trigonometry_Functions">Trig Functions</a></li>
<li><a href="#Linear_Algebra_Functions">Linear Algebra Functions</a></li>
<li><a href="#Bitwise_Manipulation_Functions">Bitwise Manipulation Functions</a></li>
<li><a href="#Output_Functions">Output Functions</a></li>
<li><a href="#Spam_Blocking_Functions">Spam-Blocking Functions</a></li>
<li><a href="#Mod_Functions">Mod Functions</a></li>
<li><a href="#Hotkey_Functions">Hotkey Functions</a></li>
<li><a href="#File_Functions">File Functions</a></li>
<li><a href="#UI_Functions">UI Functions</a></li>
<li><a href="#Text_Input_Functions">Text Input Functions</a></li>
<li><a href="#String_Variables">String Variables</a></li>
<li><a href="#Format_Specifiers">Format Specifiers</a></li>
<li><a href="#Array_Variables">Array Variables</a></li>
<li><a href="#OBSE_Expressions">OBSE Expressions</a></li>
<li><a href="#User_Defined_Functions">User-Defined Functions</a></li>
<li><a href="#Events">Event Handlers</a></li>
<li><a href="#Inventory_Reference">Inventory References</a></li>
<li><a href="#Temporary_Functions">Temporary Functions</a></li>
<li><a href="#Physics_Functions">Physics Functions</a></li>
<li><a href="#Type_Codes">Type Codes</a></li>
<li><a href="#Deprecated_Functions">Deprecated Functions</a></li>
</ul>
<h2><a id="New_xOBSE_Features">New xOBSE Features</a></h2>
<p>Besides fixing some long standing bugs and adding new game versions (like the GOG version) to the launcher, xOBSE adds a couple of new functions (and deprecates some others):</p>
<ul>
<li><h3>xOBSE v0022.5</h3></li>
<li><a href="#IsMiscItem">IsMiscItem</a></li>
<li><h3>xOBSE v0022.4</h3></li>
<li><a href="#SetAltControl2">SetAltControl2</a></li>
<li>SetAltControl, GetAltControl and RefreshControlMap marked as deprecated</li>
<li><h3>xOBSE v0022.3</h3></li>
<li>Add experimental support for OnKeyEvent and OnControlEvent for Event Manager</li>
<li><a href="#OnKeyEvent">OnKeyEvent</a></li>
<li><a href="#OnControlEvent">OnControlEvent</a></li>
<li><h3>xOBSE v0021.8</h3></li>
<li><a href="#GetBaseAV3">GetBaseAV3(C)</a></li>
<li>GetBaseAV2(C) functions are deprecated</li>
<li><a href="#IsNaked">IsNaked</a></li>
<li><h3>xOBSE v0021.5</h3></li>
<li><a href="#EventHandlerExist">EventHandlerExist</a></li>
</ul>
<h2><a id="New_Functions">New Features in OBSE v0021</a></h2>
<p>Being from 2013, the additions of OBSE v0021 aren't exactly new, but since the online documentation still links to the v0020 one, the changes of v0021 will remain listed here for now, for convenience.<br>
OBSE v0021 introduces <a href="#Events">new event types</a>, support for <a href="#User_Defined_Events">user-defined events</a>, and includes the following new commands:</p><ul>
<li><a href="#HasTail">HasTail</a></li>
<li><a href="#GetLuckModifiedSkill">GetLuckModifiedSkill</a></li>
<li><a href="#SetCellMusicType">SetCellMusicType</a></li>
<li><a href="#GetSoundAttenuation">GetSoundAttenuation</a></li>
<li><a href="#SetSoundAttenuation">SetSoundAttenuation</a></li>
<li><a href="#GetStageIDs">GetStageIDs</a></li>
<li><a href="#GetStageEntries">GetStageEntries</a></li>
<li><a href="#SetStageText">SetStageText</a></li>
<li><a href="#UnsetStageText">UnsetStageText</a></li>
<li><a href="#SetStageDate">SetStageDate</a></li>
<li><a href="#GetTailModelPath">GetTailModelPath</a></li>
<li><a href="#UpdateContainerMenu">UpdateContainerMenu</a></li>
<li><a href="#UpdateSpellPurchaseMenu">UpdateSpellPurchaseMenu</a></li>
<li><a href="#LinkToDoor">LinkToDoor</a></li>
<li><a href="#sv_ToUpper">sv_ToUpper</a></li>
<li><a href="#sv_ToLower">sv_ToLower</a></li>
<li><a href="#CopyRace">CopyRace</a></li>
<li><a href="#SetCreatureType">SetCreatureType</a></li>
<li><a href="#DispatchEvent">DispatchEvent</a></li>
<li><a href="#GetGroundSurfaceMaterial">GetGroundSurfaceMaterial</a></li>
<li><a href="#GetSkillSpecializationC">GetSkillSpecializationC</a></li>
<li><a href="#SetSkillSpecializationC">SetSkillSpecializationC</a></li>
<li><a href="#GetRequiredSkillExpC">GetRequiredSkillExpC</a></li>
<li><a href="#GetAVSkillMasteryLevel">GetAVSkillMasteryLevel</a></li>
<li><a href="#GetAVSkillMasteryLevelC">GetAVSkillMasteryLevelC</a></li>
<li><a href="#GetFactions">GetFactions</a></li>
<li><a href="#GetLowActors">GetLowActors</a></li>
<li><a href="#GetLevCreatureTemplate">GetLevCreatureTemplate</a></li>
<li><a href="#SetLevCreatureTemplate">SetLevCreatureTemplate</a></li>
<li><a href="#GetActorSwimBreath">GetActorSwimBreath</a></li>
<li><a href="#SetActorSwimBreath">SetActorSwimBreath</a></li>
<li><a href="#GetActorMaxSwimBreath">GetActorMaxSwimBreath</a></li>
<li><a href="#SetActorMaxSwimBreath">SetActorMaxSwimBreath</a></li>
<li><a href="#OverrideActorSwimBreath">OverrideActorSwimBreath</a></li>
<li><a href="#SetFlyCameraSpeedMult">SetFlyCameraSpeedMult</a></li>
</ul>
<h2><a id="Function_Syntax_Format">Function Syntax Format</a></h2>
<pre class="code">(returnValueName:returnValueType) reference.FunctionName parameter1:type parameter2:type</pre>
<p><span class="op">optional</span> - optional parameters or references are in italics</p>
<table>
<caption>Vanilla parameter Types: designated after colon</caption>
<tr>
<th>float</th>
<td>a positive or negative decimal number*</td>
<td>3.1415</td>
</tr>
<tr class="alt">
<th>short</th>
<td>a positive or negative integer in range -32768 to 32767**</td>
<td>100, -15765</td>
</tr>
<tr>
<th>long</th>
<td>a positive or negative integer in range -2147483648 to 2147483647***</td>
<td>123987</td>
</tr>
<tr class="alt">
<th>int</th>
<td>an alias for short</td>
<td>100, -15765</td>
</tr>
<tr>
<th>ref</th>
<td>a ref</td>
<td>objectID</td>
</tr>
<tr class="alt">
<th>chars</th>
<td>a 4 character magic effect code</td>
<td>FIDG, Z001</td>
</tr>
<tr>
<th>string</th>
<td>a set of characters in quotes</td>
<td>"Uriel Septim"</td>
</tr>
<tr class="alt">
<th>bool</th>
<td>a short with only 2 values: 1 for true and 0 for false</td>
<td>1, 0</td>
</tr>
</table>
<p>*A float will not accurately display more than 7 digits.</p>
<p>**Longer short/int variables don't actually get cut off, but some functions might behave unpredictable if the value doesn't match the parameter type.</p>
<p>***In Oblivion, all ints are actually stored as floats, so they experience the same limitations as floats, and so cannot actually reach the ranges that a long should be able to reach. The largest integer you can reliably store in a long var is 16,777,216.</p>
<p>Assinging a float value to an integer will cut them off, not round them (both 2.1 and 2.7 will become 2, while -1,5 will become -1). If a variable is a Global, then it will always be a float and therefore will not cut off the decimal values. Keep that in mind when using variables as parameter.</p>
<table>
<caption>Additional OBSE parameter types</caption>
<tr>
<th>formatString</th>
<td>a string containing zero or more <a href="#Format_Specifiers">format specifiers</a> followed by up to twenty variables</td>
</tr>
<tr class="alt">
<th>string_var</th>
<td>a variable defined as a <a href="#String_Variables">string_var</a>, with a unique ID representing a string of characters</td>
</tr>
<tr>
<th>array_var</th>
<td>an <a href="#Array_Variables">array_var</a> variable, with a unique ID representing an array of keys and values</td>
</tr>
<tr class="alt">
<th>array</th>
<td>an array, not necessarily stored in a variable. (ex: <strong>someArr[1:4]</strong> is an array but not an array_var)</td>
</tr>
<tr>
<th>arrayKey</th>
<td>an array key (either a string, integer, or float)</td>
</tr>
<tr class="alt">
<th>Array</th>
<td>an array of type Array, with integer keys</td>
</tr>
<tr>
<th>StringMap</th>
<td>an array of type StringMap, with string keys</td>
</tr>
<tr class="alt">
<th>Map</th>
<td>an array of type Map, with floating point keys</td>
</tr>
<tr>
<th>
<em>expr</em>
</th>
<td>an OBSE <a href="#OBSE_Expressions">expression</a></td>
</tr>
<tr class="alt">
<th>multi</th>
<td>a value of any type float, short, string, or array, e.g. an array element or a function return value</td>
</tr>
</table>
<h2><a id="Function_Calling_Conventions">Function Calling Conventions:</a></h2>
<h3>By Reference or ObjectID</h3>
<p class="code"><span class="op">reference.</span>FunctionName someParameters <span class="op">objectID:ref</span></p>
<h4>Examples:</h4>
<pre> (health:int) <span class="op">reference.</span>GetObjectHealth <span class="op">objectID:ref</span>
(oldEnchantment:ref) <span class="op">reference.</span>SetEnchantment nuEnchantment:ref <span class="op">objectID:ref</span></pre>
<p>These functions can either be called on a reference or have an objectID passed in as an argument. The optional reference is there for the scripter's convenience. If the function is called on a reference, the objectID will be retrieved from the reference. If an objectID is passed in, it takes precedence over a calling reference.</p>
<p>The following are equivalent:</p><pre> ref.doSomething</pre>
<p>and</p><pre> base = ref.getBaseObject
doSomething base</pre>
<p>These functions always perform their operations on the base object.</p>
<h3>By Reference Only</h3>
<p class="code">reference.FunctionName someParameters</p>
<h4>Examples:</h4>
<pre> (oldPoison:ref) reference.SetEquippedWeaponPoison nuPoison:ref</pre>
<p>These functions <em>must</em> be called on a reference.</p>
<h3>By ObjectID Only</h3>
<p class="code">FunctionName someParamters objectID:ref</p>
<h4>Examples:</h4>
<pre> (masterLevel:int) GetSpellMasteryLevel spell:ref (effectCode:int) GetNthEffectItemCode magicItem:ref whichEffect:int</pre>
<p>These functions <em>must</em> have an ObjectID passed as an argument.</p>
<h2><a id="Qualities">Qualities</a></h2>
<p>Qualities are a set of related values and functions which apply to multiple Oblivion object types. For documentation purposes I have gathered the related values together. Any type which has a given quality has all of the values listed and all of the quality's functions may be applied to the type.</p><ul>
<li><a href="#Actor">Actor</a></li>
<li><a href="#Actor_Value_Functions">Actor Values</a></li>
<li><a href="#Attacking">Attacking</a></li>
<li><a href="#Audible">Audible</a></li>
<li><a href="#Breakable">Breakable</a></li>
<li><a href="#Class">Class</a></li>
<li><a href="#Container">Container</a></li>
<li><a href="#Description">Description</a></li>
<li><a href="#Edible">Edible</a></li>
<li><a href="#Enchantable">Enchantable</a></li>
<li><a href="#Equippable">Equippable</a></li>
<li><a href="#Inventory">Inventory</a></li>
<li><a href="#Lockable">Lockable</a></li>
<li><a href="#Magic">Magic</a></li>
<li><a href="#Magic_Target">Magic Target</a></li>
<li><a href="#Named">Named</a></li>
<li><a href="#Ownable">Ownable</a></li>
<li><a href="#Race">Race</a></li>
<li><a href="#Scriptable">Scriptable</a></li>
<li><a href="#Simple">Simple</a></li>
<li><a href="#Wearable">Wearable</a></li>
</ul>
<h3><a id="Actor">Actor</a></h3>
<p>Includes creatures and NPCs. All changes to actor flags such as Respawn and Low Level Processing are saved in the savegame.</p>
<h4>Functions:</h4>
<p><a id="IsRefEssential" class="f" href="http://cs.elderscrolls.com/index.php?title=IsRefEssential">IsRefEssential</a> - returns whether the referenced actor is essential<br />
<code class="s">(isEssential:bool) reference.IsRefEssential</code></p>
<p><a id="SetRefEssential" class="f" href="http://cs.elderscrolls.com/index.php?title=SetRefEssential">SetRefEssential</a> - sets the calling ref to be essential or not<br />
<b>Note: </b>Although used on a reference, this function changes the Essential flag on the Base Object, thus affecting all references from that Base Object.<br />
<code class="s">reference.SetRefEssential isEssential:bool</code></p>
<p><a id="GetActorLightAmount" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorLightAmount">GetActorLightAmount</a> - returns a float describing the amount of light falling on an actor, or 100 if the actor is not in high/medium-high process.<br />
<b>Note: </b>The values appear to range from 0.00 for complete darkness to 100.00 for very bright light.<br />
<b>Note: </b>Without EngineBugFixes, some creatures (like horses and trolls) will always report a light level of 0.<br />
<code class="s">(lightAmount:float) reference.GetActorLightAmount</code></p>
<p><a id="CanCorpseCheck" class="f" href="http://cs.elderscrolls.com/index.php?title=CanCorpseCheck">CanCorpseCheck</a> - returns 1 if the Can Corpse Check flag is set on the actor<br />
<code class="s">(canCorpseCheck:bool) <span class="op">reference.</span>CanCorpseCheck <span class="op">actor:ref</span></code></p>
<p><a id="SetCanCorpseCheck" class="f" href="http://cs.elderscrolls.com/index.php?title=SetCanCorpseCheck">SetCanCorpseCheck</a> - changes the Can Corpse Check flag on the actor<br />
<code class="s">(nothing) <span class="op">reference.</span>SetCanCorpseCheck flag:int <span class="op">actor:ref</span></code></p>
<p><a id="GetActorMinLevel" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorMinLevel">GetActorMinLevel</a> - returns the minimum level of the actor if the PC Level Offset flag is set<br />
<code class="s">(minLevel:int) <span class="op">reference.</span>GetActorMinLevel <span class="op">actor:ref</span></code><br />
<code class="s">(minLevel:int) <span class="op">reference.</span>GetMinLevel <span class="op">actor:ref</span></code></p>
<p><a id="GetActorMaxLevel" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorMaxLevel">GetActorMaxLevel</a> - returns the maximum level of the actor if the PC Level Offset flag is set<br />
<code class="s">(maxLevel:int) <span class="op">reference.</span>GetActorMaxLevel <span class="op">actor:ref</span></code><br />
<code class="s">(maxLevel:int) <span class="op">reference.</span>GetMaxLevel <span class="op">actor:ref</span></code></p>
<p><a id="GetNumFactions" class="f" href="http://cs.elderscrolls.com/index.php?title=GetNumFactions">GetNumFactions</a> - returns the number of factions to which the actor belongs<br />
<code class="s">(numFactions:int) <span class="op">reference.</span>GetNumFactions <span class="op">actor:ref</span></code></p>
<p><a id="GetNthFaction" class="f" href="http://cs.elderscrolls.com/index.php?title=GetNthFaction">GetNthFaction</a> - returns the nth faction to which the actor belongs<br />
<code class="s">(faction:ref) <span class="op">reference.</span>GetNthFaction whichFaction:short <span class="op">actor:ref</span></code></p>
<p><a id="GetActorSoulLevel" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorSoulLevel">GetActorSoulLevel</a> - returns the soul level of any actor. If an NPC it returns Grand, otherwise if a creature it returns the creature's soul level.<br />
<code class="s">(<a href="#Soul_Level">soulLevel</a>:int) <span class="op">reference.</span>GetActorSoulLevel <span class="op">actor:ref</span></code></p>
<p><a id="HasLowLevelProcessing" class="f" href="http://cs.elderscrolls.com/index.php?title=HasLowLevelProcessing">HasLowLevelProcessing</a> - returns 1 if the actor has low level processing enabled<br />
<code class="s">(hasLowProc:bool) <span class="op">reference.</span>HasLowLevelProcessing <span class="op">actor:ref</span></code></p>
<p><a id="HasNoPersuasion" class="f" href="http://cs.elderscrolls.com/index.php?title=HasNoPersuasion">HasNoPersuasion</a> - returns 1 if the No Persuasion flag is set on the actor<br />
<code class="s">(hasNoPers:bool) <span class="op">reference.</span>HasNoPersuasion <span class="op">actor:ref</span></code></p>
<p><a id="SetNoPersuasion" class="f" href="http://cs.elderscrolls.com/index.php?title=SetNoPersuasion">SetNoPersuasion</a> - changes the No Persuasion flag on the actor<br />
<code class="s">(nothing) <span class="op">reference.</span>SetNoPersuasion flag:int <span class="op">actor:ref</span></code></p>
<p><a id="IsActorRespawning" class="f" href="http://cs.elderscrolls.com/index.php?title=IsActorRespawning">IsActorRespawning</a> - returns 1 if the Respawn flag is set on the actor<br />
<code class="s">(respawns:bool) <span class="op">reference.</span>IsActorRespawning <span class="op">actor:ref</span></code></p>
<p><a id="IsPCLevelOffset" class="f" href="http://cs.elderscrolls.com/index.php?title=IsPCLevelOffset">IsPCLevelOffset</a> - returns 1 if the actor's level is calculated relative to the player's level<br />
<code class="s">(isLevOffset:bool) <span class="op">reference.</span>IsPCLevelOffset <span class="op">actor:ref</span></code></p>
<p><a id="GetActorBaseLevel" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorBaseLevel">GetActorBaseLevel</a> - returns the level of the base actor. In the editor, for creatures this is the "Level Offset" field; for NPCs it is the "Level" field. For either, the meaning of the return value depends on whether or not the PC Level Offset flag is set for the base actor.<br />
<code class="s">(level:int) <span class="op">reference.</span>GetActorBaseLevel <span class="op">actorBase:ref</span></code></p>
<p><a id="IsSummonable" class="f" href="http://cs.elderscrolls.com/index.php?title=IsSummonable">IsSummonable</a> - returns 1 if the Summonable flag is set on the actor<br />
<code class="s">(isSummonable:bool) <span class="op">reference.</span>IsSummonable <span class="op">actor:ref</span></code></p>
<p><a id="SetSummonable" class="f" href="http://cs.elderscrolls.com/index.php?title=SetSummonable">SetSummonable</a> - changes the Summonable flag on the actor<br />
<code class="s">(nothing) <span class="op">reference.</span>SetSummonable flag:int <span class="op">actor:ref</span></code></p>
<p><a id="SetActorRespawns" class="f" href="http://cs.elderscrolls.com/index.php?title=SetActorRespawns">SetActorRespawns</a> - changes the Respawn flag on the actor<br />
<code class="s">(nothing) <span class="op">reference.</span>SetActorRespawns flag:int <span class="op">actor:ref</span></code></p>
<p><a id="SetFemale" class="f" href="http://cs.elderscrolls.com/index.php?title=SetFemale">SetFemale</a> - changes the Female flag on the actor. Changes are saved but may not be immediately visible.<br />
<code class="s">(nothing) <span class="op">reference.</span>SetFemale flag:int <span class="op">actor:ref</span></code></p>
<p><a id="SetLowLevelProcessing" class="f" href="http://cs.elderscrolls.com/index.php?title=SetLowLevelProcessing">SetLowLevelProcessing</a> - turns low level processing on or off for the actor. Note that this sets the No Low Level Processing flag to the opposite of the passed value.<br />
<code class="s">(nothing) <span class="op">reference.</span>SetLowLevelProcessing flag:int <span class="op">actor:ref</span></code></p>
<p><a id="SetPCLevelOffset" class="f" href="http://cs.elderscrolls.com/index.php?title=SetPCLevelOffset">SetPCLevelOffset</a> - changes the PC Level Offset flag on the actor, and optionally specifies the minimum andmaximum levels. If minLevel or maxLevel is omitted or passed as -1, the existing value will be retained.<br />
<b>Note:</b> Changes to the min/max levels are not saved in the savegame.<br />
<code class="s">(nothing) <span class="op">reference.</span>SetPCLevelOffset flag:int <span class="op">minLevel:int maxLevel:int actor:ref</span></code></p>
<p><a id="GetNumPackages" class="f" href="http://cs.elderscrolls.com/index.php?title=GetNumPackages">GetNumPackages</a> - returns the number of AI packages in the actor's package list<br />
<code class="s">(numPackages:int) <span class="op">reference.</span>GetNumPackages <span class="op">actor:ref</span></code></p>
<p><a id="GetNthPackage" class="f" href="http://cs.elderscrolls.com/index.php?title=GetNthPackage">GetNthPackage</a> - returns the Nth AI package in the NPC's package list, in the order in which they were added in the editor.<br />
<code class="s">(package:ref) <span class="op">reference.</span>GetNthPackage whichPackage:short <span class="op">actor:ref</span></code></p>
<p><a id="GetSpellEffectiveness" class="f" href="http://cs.elderscrolls.com/index.php?title=GetSpellEffectiveness">GetSpellEffectiveness</a> - returns the actor's spell effectiveness based on the armor he or she has equipped as a floating point value from 0 to 1.0. The return value is always 1.0 for creatures and NPCs other than the player. When calledon the player, this command returns the player's base spell effectiveness as calculated by the game plus any script modifier applied by ModPCSpellEffectiveness.<br />
<code class="s">(spellEffectiveness:float) reference.GetSpellEffectiveness</code></p>
<p><a id="CanCastPower" class="f" href="http://cs.elderscrolls.com/index.php?title=CanCastPower">CanCastPower</a> - returns false if the calling actor has already used the specified greater power within the last 24 hours. This command does not check for the presence of the greater power in the actor's spellbook.<br />
<code class="s">(CanCast:bool) ref.CanCastPower spell:ref</code></p>
<p><a id="SetCanCastPower" class="f" href="http://cs.elderscrolls.com/index.php?title=SetCanCastPower">SetCanCastPower</a> - indicates whether the calling actor can cast the specified greater power. Passing 1 allows the actor to cast the power even if he has already used it within the past 24 hours. Passing 0 disallows the actor from casting the spell for the next 24 hours, unless the actor has already cast the power, in which case the power will become usable as normal 24 hours after the last casting.<br />
<code class="s">(nothing) ref.SetCanCastPower spell:ref allowCasting:bool</code></p>
<p><a id="SetPowerTimer" class="f" href="http://cs.elderscrolls.com/index.php?title=SetPowerTimer">SetPowerTimer</a> - sets the amount of time that must pass until the calling actor can cast the specified power. The time is a float representing the number of real-time seconds until the power becomes usable. When an actor uses a power, the game calculates the 24-hour timer as <strong>3600 / TimeScale 24</strong> where TimeScale is a global variable representing the number of game-time minutes which elapse per real-tme minute. The timer value passed to this function should similarly take TimeScale into account. Passing a value of zero or less will cause the power to become usable the very next frame.<br />
<code class="s">(nothing) ref.SetPowerTimer spell:ref timer:float</code></p>
<p><a id="GetUsedPowers" class="f" href="http://cs.elderscrolls.com/index.php?title=GetUsedPowers">GetUsedPowers</a> - returns an Array containing information about all greater powers which the calling actor has used. This includes powers cast by the actor within the last 24 hours as well as any powers flagged as used by SetCanCastPower and SetPowerTimer. The return value is an Array of StringMaps:<br />
<span class="ind" style="font-family: monospace;">GetUsedPowers[n]["power"] := <strong>ref</strong></span> <span style="font-style: italic;">; the greater power</span><br />
<span class="ind" style="font-family: monospace;">GetUsedPowers[n]["timer"] := <strong>float</strong></span> <span style="font-style: italic;">; number of real-time seconds until the power becomes usable again</span><br />
<code class="s">(powers:Array) ref.GetUsedPowers</code></p>
<p><a id="HasSpell" class="f" href="http://cs.elderscrolls.com/index.php?title=HasSpell">HasSpell</a> - returns whether the actor has the specified spell<br />
<b>Notes: </b>Before xOBSE 21.5 return always 0 on Creatures. <br />
<code class="s">(hasSpell:bool) reference.HasSpell spell:ref</code></p>
<p><a id="RemoveBaseSpell" class="f" href="http://cs.elderscrolls.com/index.php?title=RemoveBaseSpell">RemoveBaseSpell</a> - the game's RemoveSpell removes a spell from a base actor but must be called on a reference. This command does the same thing as RemoveSpell but takes a base object as an argument, returning 1 if the spell was removed.<br />
<code class="s">(bRemoved:bool) RemoveBaseSpell actor:ref</code></p>
<p><a id="GetLeveledSpells" class="f" href="http://cs.elderscrolls.com/index.php?title=GetLeveledSpells">GetLeveledSpells</a> - returns an Array containing all of the leveled spells in the base actor's spell list.<br />
<code class="s">(spells:Array) <span class="op">reference.</span>GetLeveledSpells <span class="op">actorBase:ref</span></code></p>
<p><a id="GetActorPackages" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorPackages">GetActorPackages</a> - returns an Array containing the AI packages defined in the base actor's package list, in the order in which they are listed in the editor.<br />
<code class="s">(packages:Array) <span class="op">reference.</span>GetActorPackages <span class="op">actorBase:ref</span></code></p>
<p><a id="GetCurrentPackage" class="f" href="http://cs.elderscrolls.com/index.php?title=GetCurrentPackage">GetCurrentPackage</a> - returns the actor ref's currently executing package<br />
<code class="s">(package:ref) reference.GetCurrentPackage</code></p>
<p><a id="GetCurrentPackageProcedure" class="f" href="http://cs.elderscrolls.com/index.php?title=GetCurrentPackageProcedure">GetCurrentPackageProcedure</a> - returns the name of the <a href="#Package_Procedures">AI procedure</a> currently being executed by the calling actor, or "NONE".<br />
<code class="s">(procedure:string) reference.GetCurrentPackageProcedure</code></p>
<p><a id="GetCurrentEditorPackage" class="f" href="http://cs.elderscrolls.com/index.php?title=GetCurrentEditorPackage">GetCurrentEditorPackage</a> - returns the actor ref's executing non-dynamic package<br />
<code class="s">(package:ref) reference.GetCurrentEditorPackage</code></p>
<p><a id="EquipItem2" class="f" href="http://cs.elderscrolls.com/index.php?title=EquipItem2">EquipItem2</a> - duplicates the behavior of the vanilla <code>EquipItem</code> command, but also causes the object's <code>OnEquip</code> script block to run if one exists<br />
<code class="s">(nothing) ref.EquipItem2 item:ref lockEquip:bool</code></p>
<p><a id="EquipItem2NS" class="f" href="http://cs.elderscrolls.com/index.php?title=EquipItem2NS">EquipItem2NS</a> - behaves identically to <code>EquipItem2</code>, but suppresses the UI message generated by that command<br />
<code class="s">(nothing) ref.EquipItem2NS item:ref lockEquip:bool</code></p>
<p><a id="GetSpecialAnims" class="f" href="http://cs.elderscrolls.com/index.php?title=GetSpecialAnims">GetSpecialAnims</a> - returns an Array containing the filenames of any special animations for the actor. Animations for creatures, and those in the SpecialAnims folder for NPCs, can be toggled on and off in the actor's animation list in the editor.<br />
<code class="s">(anims:Array) <span class="op">reference.</span>GetSpecialAnims <span class="op">actorBase:ref</span></code></p>
<p><a id="ToggleSpecialAnim" class="f" href="http://cs.elderscrolls.com/index.php?title=ToggleSpecialAnim">ToggleSpecialAnim</a> - adds or removes an animation from the base actor's animation list. For creatures, the animations must appear in the creature's model folder; for NPCs they must be located in the Special Anims folder. Changes made using this command have no effect on the animations of reference's to the base actor which are currently in middle-high or high process.<br />
<code class="s">(bSucceeded:bool) <span class="op">reference.</span>ToggleSpecialAnim animFileName:string toggleOn:bool <span class="op">actorBase:ref</span></code></p>
<p><a id="GetGroundSurfaceMaterial" class="f" href="http://cs.elderscrolls.com/index.php?title=GetGroundSurfaceMaterial">GetGroundSurfaceMaterial</a> - returns the <a href="#Surface_Type">surface type</a> that the actor ref is currently standing on. Returns -1 if the ref is not in middle-high or high process.<br />
<code class="s">(surfaceType:int) <span class="op">reference.</span>GetGroundSurfaceMaterial</code></p>
<p><a id="GetFactions" class="f" href="http://cs.elderscrolls.com/index.php?title=GetFactions">GetFactions</a> - returns an array containing the factions the calling ref or base actor is a member of.<br />
<code class="s">(factions:Array) <span class="op">reference.</span>GetFactions <span class="op">actorBase:ref</span></code></p>
<p><a id="GetActorSwimBreath" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorSwimBreath">GetActorSwimBreath</a> - returns the calling high process actor's swimming breath level in seconds.<br />
<code class="s">(breathLevel:float) <span class="op">reference.</span>GetActorSwimBreath</code></p>
<p><a id="SetActorSwimBreath" class="f" href="http://cs.elderscrolls.com/index.php?title=SetActorSwimBreath">SetActorSwimBreath</a> - sets the calling high process actor's swimming breath level.<br />
<code class="s">(nothing) <span class="op">reference.</span>SetActorSwimBreath newBreath:float</code></p>
<p><a id="GetActorMaxSwimBreath" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorMaxSwimBreath">GetActorMaxSwimBreath</a> - returns the calling high process actor's maximum swimming breath level in seconds.<br />
<code class="s">(breathLevel:float) <span class="op">reference.</span>GetActorMaxSwimBreath</code></p>
<p><a id="SetActorMaxSwimBreath" class="f" href="http://cs.elderscrolls.com/index.php?title=SetActorMaxSwimBreath">SetActorMaxSwimBreath</a> - sets the calling high process actor's maximum swimming breath level. Overrides are automatically cleared when the actor leaves the high process AI processing band.<br />
<code class="s">(nothing) <span class="op">reference.</span>SetActorMaxSwimBreath newBreath:float</code></p>
<p><a id="OverrideActorSwimBreath" class="f" href="http://cs.elderscrolls.com/index.php?title=OverrideActorSwimBreath">OverrideActorSwimBreath</a> - overrides the <a href="#Swim_Breath_State">swimming breath behaviour</a> of the calling high process actor. Overridden actors will revert to their normal behaviour when they leave the high process AI processing band.<br />
<code class="s">(nothing) <span class="op">reference.</span>OverrideActorSwimBreath override:int</code></p>
<h3><a id="Actor_Value_Functions">Actor Value Functions</a></h3>
<p>Actor values are determined by several factors including the attributes defined for the base actor, several dynamic modifiers, and the effects of game settings. For a detailed description of how actor values are calculated see the <a href="http://cs.elderscrolls.com/index.php?title=Category:Actor_Values">wiki entry</a>. OBSE provides commands to retrieve and modify the modifiers applied to an actor value, retrieve the actor value as defined for a base actor, and retrieve the maximum value of an actor value.</p>
<p><a id="GetAVMod" class="f" href="http://cs.elderscrolls.com/index.php?title=GetAVMod">GetAVMod</a> - returns one of the calling actor's modifiers for the specified actor value. The modifier is specified as a string: "script" refers to the script (or "offset") modifier applied by the <strong>script</strong> versions of ModAV and ForceAV; "max" refers to the modifier applied by magic effects like feather, drain, and fortify; and "damage" refers to that applied by effects like damage and restore, and by the <strong>console</strong> version of ModAV/ForceAV as well as ModAV2.<br />
<code class="s">(modifierValue:float) ref.GetAVMod actorValueName:string whichModifier:string</code><br />
<code class="s">(modifierValue:float) ref.GetAVModC actorValueCode:int whichModifier:string</code></p>
<p><a id="SetAVMod" class="f" href="http://cs.elderscrolls.com/index.php?title=SetAVMod">SetAVMod</a> - sets the value of one of the calling actor's modifiers for the specified actor value. The modifier is specified as a string: "script" refers to the script (or "offset") modifier applied by the <strong>script</strong> versions of ModAV and ForceAV; "max" refers to the modifier applied by magic effects like feather, drain, and fortify; and "damage" refers to that applied by effects like damage and restore, and by the <strong>console</strong> version of ModAV/ForceAV as well as ModAV2. To encourage compatibility between mods, prefer using ModAVMod over SetAVMod.<br />
<code class="s">(nothing) ref.SetAVMod actorValueName:string whichModifier:string amount:float</code><br />
<code class="s">(nothing) ref.SetAVModC actorValueCode:int whichModifier:string amount:float</code></p>
<p><a id="ModAVMod" class="f" href="http://cs.elderscrolls.com/index.php?title=ModAVMod">ModAVMod</a> - modifies the value of one of the calling actor's modifiers for the specified actor value by the specified amount. The modifier is specified as a string: "script" refers to the script (or "offset") modifier applied by the <strong>script</strong> versions of ModAV and ForceAV; "max" refers to the modifier applied by magic effects like feather, drain, and fortify; and "damage" refers to that applied by effects like damage and restore, and by the <strong>console</strong> version of ModAV/ForceAV as well as ModAV2.<br />
<code class="s">(nothing) ref.ModAVMod actorValueName:string whichModifier:string amount:float</code><br />
<code class="s">(nothing) ref.ModAVModC actorValueCode:int whichModifier:string amount:float</code></p>
<p><a id="GetMaxAV" class="f" href="http://cs.elderscrolls.com/index.php?title=GetMaxAV">GetMaxAV</a> - returns the maximum possible value of the specified actor value for the calling actor.<br />
<code class="s">(maxValue:float) ref.GetMaxAV actorValueName:string</code><br />
<code class="s">(maxValue:float) ref.GetMaxAVC actorValueCode:int</code></p>
<p><a id="GetAVForBaseActor" class="f" href="http://cs.elderscrolls.com/index.php?title=GetAVForBaseActor">GetAVForBaseActor</a> - returns the value of the specified actor value as defined for the base actor. If the second argument is omitted, the base object for the calling actor is used. Note that not all actor values are defined for base actors, in which case this command returns 0.<br />
<code class="s">(value:int) <span class="op">ref.</span>GetAVForBaseActor actorValueName:string <span class="op">actorBase:ref</span></code><br />
<code class="s">(value:int) <span class="op">ref.</span>GetAVForBaseActorC actorValueCode:int <span class="op">actorBase:ref</span></code></p>
<p><a id="GetActorValueC" class="f" href="http://cs.elderscrolls.com/index.php?title=GetActorValueC">GetActorValueC</a> - returns the actor value specified by the actor value code<br />
<code class="s">(actorValue:int) reference.GetActorValueC <a href="#Actor_Value_Codes">actorValueCode</a>:int</code><br />
<code class="s">(actorValue:int) reference.GetAVC <a href="#Actor_Value_Codes">actorValueCode</a>:int</code></p>
<p><a id="ModActorValueC" class="f" href="http://cs.elderscrolls.com/index.php?title=ModActorValueC">ModActorValueC</a> - modifies the actor value without changing the base value. Acts like a spell: a negative number reduces the value which can be restored and a positive value restores values without exceeding the maximum of the stat.<br />
<code class="s">(nothing) reference.ModActorValueC <a href="#Actor_Value_Codes">actorValueCode</a>:int value:int</code><br />
<code class="s">(nothing) reference.ModAVC <a href="#Actor_Value_Codes">actorValueCode</a>:int value:int</code></p>
<p><a id="SetActorValueC" class="f" href="http://cs.elderscrolls.com/index.php?title=SetActorValueC">SetActorValueC</a> - sets the actor value specified by the actor value code<br />
<code class="s">(nothing) reference.SetActorValueC <a href="#Actor_Value_Codes">actorValueCode</a>:int value:int</code><br />
<code class="s">(nothing) reference.SetAVC <a href="#Actor_Value_Codes">actorValueCode</a>:int value:int</code></p>
<p><a id="ModActorValue2" class="f" href="http://cs.elderscrolls.com/index.php?title=ModActorValue2">ModActorValue2</a> - modifies the current value without changing the base value. Acts like a spell: a negative number reduces the value which can be restored and a positive value restores values without exceeding the maximum of the stat.<br />
<b>Note: </b>The value is an unrounded integer; ModAV2 StatName 3.9 would result in a 3 point change.<br />
<b>Note: </b>Attempting to mod a positive-only stat like health and attributes to negative values will crash the game. (TODO: Verify)<br />
<code class="s">(nothing) reference.ModActorValue2 actorValueName:string value:int</code><br />
<code class="s">(nothing) reference.ModAV2 actorValueName:string value:int</code></p>
<p><a id="GetLuckModifiedSkill" class="f" href="http://cs.elderscrolls.com/index.php?title=GetLuckModifiedSkill">GetLuckModifiedSkill</a> - the game applies a modifier to all skills based on an actor's luck attribute. This command takes an actual skill value and a luck attribute value and calculates the effective level of the skill after the luck modifier has been applied. The third parameter can be used to return an uncapped value - The result is capped at 100 by default.<br />
<code class="s">(modifiedSkill:int) GetLuckModifiedSkill skillLevel:int luck:int <span class="op">capped:bool</span></code></p>
<p><a id="GetAVSkillMasteryLevel" class="f" href="http://cs.elderscrolls.com/index.php?title=GetAVSkillMasteryLevel">GetAVSkillMasteryLevel</a> - returns the current mastery level of an actor's skill. The mastery level is an integer from 0 (Novice) to 4 (Master).<br />
<code class="s">(masteryLevel:int) reference.GetAVSkillMasteryLevel skill:actorValue </code></p>
<p><a id="GetAVSkillMasteryLevelC" class="f" href="http://cs.elderscrolls.com/index.php?title=GetAVSkillMasteryLevelC">GetAVSkillMasteryLevelC</a> - alternate version of GetAVSkillMasteryLevel taking an actor value for the skill.<br />
<code class="s">(masteryLevel:int) reference.GetAVSkillMasteryLevelC skillCode:int </code></p>
<h3><a id="Attacking">Attacking</a></h3>
<p>Types with this quality are used for attacks.</p>
<h4>Values:</h4>
<p class="boxhl"><strong>Attack Damage</strong> (<span class="op">long</span>) - the base damage of the type; used in a forumla with the appropriate skill to determine damage actually done<br />
<strong>Speed</strong> (<span class="op">float</span>) - the speed factor of the type; used in a forumla to determine the rate of attack<br />
<strong>Ignores Resistance</strong> (<span class="op">bool</span>) - determines whether the type will ignore normal damage resistance.<br />
</p>
<h4>Functions:</h4>
<p><a id="GetAttackDamage" class="f" href="http://cs.elderscrolls.com/index.php?title=GetAttackDamage">GetAttackDamage</a> - returns the base attack damage<br />
<code class="s">(damage:int) <span class="op">reference.</span>GetAttackDamage <span class="op">objectID:ref</span></code></p>
<p><a id="SetAttackDamage" class="f" href="http://cs.elderscrolls.com/index.php?title=SetAttackDamage">SetAttackDamage</a> - sets the base attack damage<br />
<code class="s">(nothing) <span class="op">reference.</span>SetAttackDamage nuDamage:int <span class="op">objectID:ref</span></code></p>
<p><a id="ModAttackDamage" class="f" href="http://cs.elderscrolls.com/index.php?title=ModAttackDamage">ModAttackDamage</a> - modifies the base attack damage up or down<br />
<code class="s">(nothing) <span class="op">reference.</span>ModAttackDamage modifyBy:float <span class="op">objectID:ref</span></code></p>
<p><a id="GetWeaponSpeed" class="f" href="http://cs.elderscrolls.com/index.php?title=GetWeaponSpeed">GetWeaponSpeed</a> - returns the weapon speed<br />
<code class="s">(speed:float) <span class="op">reference.</span>GetWeaponSpeed <span class="op">objectID:ref</span></code></p>
<p><a id="SetWeaponSpeed" class="f" href="http://cs.elderscrolls.com/index.php?title=SetWeaponSpeed">SetWeaponSpeed</a> - sets the weapon speed<br />
<code class="s">(nothing) <span class="op">reference.</span>SetWeaponSpeed nuSpeed:float <span class="op">obejctID:ref</span></code></p>
<p><a id="ModWeaponSpeed" class="f" href="http://cs.elderscrolls.com/index.php?title=ModWeaponSpeed">ModWeaponSpeed</a> - modifies the weapon speed up or down<br />
<code class="s">(nothing) <span class="op">reference.</span>ModWeaponSpeed modifyBy:float <span class="op">obejctID:ref</span></code></p>
<p><a id="GetIgnoresResistance" class="f" href="http://cs.elderscrolls.com/index.php?title=GetIgnoresResistance">GetIgnoresResistance</a> - returns whether the object ignores normal damage resistance<br />
<code class="s">(ignores:bool) <span class="op">reference.</span>GetIgnoresResistance <span class="op">objectID:ref</span></code></p>
<p><a id="SetIgnoresResistance" class="f" href="http://cs.elderscrolls.com/index.php?title=SetIgnoresResistance">SetIgnoresResistance</a> - sets whether the object ignores normal damage resistance<br />
<code class="s">(nothing) <span class="op">reference.</span>SetIgnoresResistance shouldIgnore:bool <span class="op">objectID:ref</span></code></p>
<h3><a id="Audible">Audible</a></h3>
<p>Types with this quality have one or more sounds associated with them.</p>
<h4>Values:</h4>
<p class="boxhl"><strong>Open Sound</strong> (<span class="op">ref</span>) - the sound played upon opening. (Containers and Doors)<br />
<strong>Close Sound</strong> (<span class="op">ref</span>) - the sound played upon closing. (Containers and Doors)<br />
<strong>Loop Sound</strong> (<span class="op">ref</span>) - the looping sound associated with an object. (Doors, Lights, and Activators)<br />
</p>
<h4>Functions:</h4>
<p><a id="GetOpenSound" class="f" href="http://cs.elderscrolls.com/index.php?title=GetOpenSound">GetOpenSound</a> - Returns the "open" sound<br />
<code class="s">(sound:ref) <span class="op">reference.</span>GetOpenSound <span class="op">baseObject:ref</span></code></p>
<p><a id="GetCloseSound" class="f" href="http://cs.elderscrolls.com/index.php?title=GetCloseSound">GetCloseSound</a> - Returns the "close" sound<br />
<code class="s">(sound:ref) <span class="op">reference.</span>GetCloseSound <span class="op">baseObject:ref</span></code></p>
<p><a id="GetLoopSound" class="f" href="http://cs.elderscrolls.com/index.php?title=GetLoopSound">GetLoopSound</a> - Returns the looping sound<br />
<code class="s">(sound:ref) <span class="op">reference.</span>GetLoopSound <span class="op">baseObject:ref</span></code></p>
<p><a id="SetOpenSound" class="f" href="http://cs.elderscrolls.com/index.php?title=SetOpenSound">SetOpenSound</a> - Sets the "open" sound<br />
<code class="s">(nothing) <span class="op">reference.</span>SetOpenSound sound:ref <span class="op">baseObject:ref</span></code></p>
<p><a id="SetCloseSound" class="f" href="http://cs.elderscrolls.com/index.php?title=SetCloseSound">SetCloseSound</a> - Sets the "close" sound<br />
<code class="s">(nothing) <span class="op">reference.</span>SetCloseSound sound:ref <span class="op">baseObject:ref</span></code></p>
<p><a id="SetLoopSound" class="f" href="http://cs.elderscrolls.com/index.php?title=SetLoopSound">SetLoopSound</a> - Sets the looping sound<br />
<code class="s">(nothing) <span class="op">reference.</span>SetLoopSound sound:ref <span class="op">baseObject:ref</span></code></p>
<h3><a id="Breakable">Breakable</a></h3>
<p>Types with this quality can be broken.</p>
<h4>Values:</h4>
<p class="boxhl"><strong>Health</strong> (<span class="op">long</span>) - the base health of the object. Cannot be negative.<br />
<strong>Current Health</strong> (<span class="op">float</span>) - the current health of the object. The object is damaged when the current value is less than the base object value and is broken when the current health reaches 0. The effectiveness of the object may be decreased as damage increases.</p>
<h4>Functions:</h4>
<p><a id="GetObjectHealth" class="f" href="http://cs.elderscrolls.com/index.php?title=GetObjectHealth">GetObjectHealth</a> - returns the base object health<br />
<code class="s">(health:int) <span class="op">reference.</span>GetObjectHealth <span class="op">objectID:ref</span></code></p>
<p><a id="SetObjectHealth" class="f" href="http://cs.elderscrolls.com/index.php?title=SetObjectHealth">SetObjectHealth</a> - sets the base object health<br />
<code class="s">(nothing) <span class="op">reference.</span>SetObjectHealth nuHealth:int <span class="op">objectID:ref</span></code></p>
<p><a id="ModObjectHealth" class="f" href="http://cs.elderscrolls.com/index.php?title=ModObjectHealth">ModObjectHealth</a> - modifies the base object health up or down<br />
<code class="s">(nothing) <span class="op">reference.</span>ModObjectHealth modifyBy:float <span class="op">objectID:ref</span></code></p>
<p><a id="GetCurrentHealth" class="f" href="http://cs.elderscrolls.com/index.php?title=GetCurrentHealth">GetCurrentHealth</a> - returns the current health of the calling reference<br />
<code class="s">(health:float) reference.GetCurrentHealth</code></p>
<p><a id="SetCurrentHealth" class="f" href="http://cs.elderscrolls.com/index.php?title=SetCurrentHealth">SetCurrentHealth</a> - sets the current health of the calling reference<br />
<code class="s">(nothing) reference.SetCurrentHealth nuHealth:float</code></p>
<p><a id="GetEquippedCurrentHealth" class="f" href="http://cs.elderscrolls.com/index.php?title=GetEquippedCurrentHealth">GetEquippedCurrentHealth</a> - gets the current health of the object in the specified equipment slot<br />
<code class="s">(health:float) reference.GetEquippedCurrentHealth <a href="#Equipment_Slot_IDs">slot</a>:int</code></p>
<p><a id="SetEquippedCurrentHealth" class="f" href="http://cs.elderscrolls.com/index.php?title=SetEquippedCurrentHealth">SetEquippedCurrentHealth</a> - sets the current health of the object in the specified equipment slot<br />
<code class="s">(nothing) reference.SetEquippedCurrentHealth nuHealth:int <a href="#Equipment_Slot_IDs">slot</a>:int</code></p>
<p><a id="ModEquippedCurrentHealth" class="f" href="http://cs.elderscrolls.com/index.php?title=ModEquippedCurrentHealth">ModEquippedCurrentHealth</a> - modifies the current health of the object in the specified equipment slot up or down <br />
<code class="s">(nothing) reference.ModEquippedCurrentHealth modifyBy:float <a href="#Equipment_Slot_IDs">slot</a>:int</code></p>
<h3><a id="Class">Class</a></h3>
<p>Types with this quality have a player class.</p>
<h4>Qualities:</h4>
<p class="boxhl"><a href="#Description">Description</a></p>
<h4>Values:</h4>
<p class="boxhl"><strong>Attributes</strong> (<span class="op">short</span>) - the two attributes of the class<br />
<strong>Skills</strong> (<span class="op">short</span>) - the five major skills of the class<br />
<strong>Specialization</strong> (<span class="op">short</span>) - the specialization of the class<br />
</p>
<h4>Functions:</h4>
<p><a id="GetClass" class="f" href="http://cs.elderscrolls.com/index.php?title=GetClass">GetClass</a> - returns the class of the NPC <br />
<code class="s">(class:ref) <span class="op">reference.</span>GetClass <span class="op">npc:ref</span></code></p>
<p><a id="GetClassAttribute" class="f" href="http://cs.elderscrolls.com/index.php?title=GetClassAttribute">GetClassAttribute</a> - returns the Nth attribute of the class. If called on a reference it will attempt to find the class from that referenced NPC and use that. If a class FormID is passed, that takes precedence.<br />
<code class="s">(<a href="#Actor_Value_Codes">attribute</a>:int) <span class="op">reference.</span>GetClassAttribute whichAttribute:int <span class="op">class:ref</span></code></p>
<p><a id="GetClassSkill" class="f" href="http://cs.elderscrolls.com/index.php?title=GetClassSkill">GetClassSkill</a> - returns the Nth skill of the class. If called on a reference it will attempt to find the class from that referenced NPC and use that. If a class FormID is passed, that takes precedence.<br />
<code class="s">(<a href="#Actor_Value_Codes">skill</a>:int) <span class="op">reference.</span>GetClassSkill whichSkill:int <span class="op">class:ref</span></code></p>
<p><a id="GetClassSpecialization" class="f" href="http://cs.elderscrolls.com/index.php?title=GetClassSpecialization">GetClassSpecialization</a> - returns the class specialization. If called on a reference it will attempt to find the class from that referenced NPC and use that. If a class FormID is passed, that takes precedence.<br />
<code class="s">(<a href="#Class_Specialization_Codes">specialization</a>:int) <span class="op">reference.</span>GetClassSpecialization <span class="op">class:ref</span></code></p>
<p><a id="IsClassSkill" class="f" href="http://cs.elderscrolls.com/index.php?title=IsClassSkill">IsClassSkill</a> - returns whether the passed skill is a skill of the class. If called on a reference it will attempt to find the class from that referenced NPC and use that. If a class FormID is passed, that takes precedence.<br />
<code class="s">(isClassSkill:bool) <span class="op">reference.</span>IsClassSkill skill:string <span class="op">class:ref</span></code><br />
<code class="s">(isClassSkill:bool) <span class="op">reference.</span>IsMajor skill:string <span class="op">class:ref</span></code></p>
<p><a id="IsClassSkillC" class="f" href="http://cs.elderscrolls.com/index.php?title=IsClassSkill">IsClassSkillC</a> - alternate version of IsClassSkill taking a skill code instead of the name of a skill.<br />
<code class="s">(isClassSkill:bool) <span class="op">reference.</span>IsClassSkillC <a href="#Actor_Value_Codes">skill</a>:int <span class="op">class:ref</span></code><br />
<code class="s">(isClassSkill:bool) <span class="op">reference.</span>IsMajorC <a href="#Actor_Value_Codes">skill</a>:int <span class="op">class:ref</span></code></p>
<p><a id="IsClassAttribute" class="f" href="http://cs.elderscrolls.com/index.php?title=IsClassAttribute">IsClassAttribute</a> - returns whether the passed attribute is an attribute of the class. If called on a reference it will attempt to find the class from that referenced NPC and use that. If a class FormID is passed, that takes precedence. (available in v0011)<br />
<code class="s">(isClassAttribute:bool) <span class="op">reference.</span>IsClassAttribute <a href="#Actor_Value_Codes">attribute</a>:int <span class="op">class:ref</span></code></p>
<p><a id="IsClassAttributeC" class="f" href="http://cs.elderscrolls.com/index.php?title=IsClassAttribute">IsClassAttributeC</a> - alternate version of <code>IsClassAttribute</code> taking an actor value code instead of the name of an actor value<br />
<code class="s">(isClassAttribute:bool) <span class="op">reference.</span>IsClassAttributeC <a href="#Actor_Value_Codes">actorValueCode</a>:int <span class="op">class:ref</span></code></p>
<p><a id="GetClassSkills" class="f" href="http://cs.elderscrolls.com/index.php?title=GetClassSkills">GetClassSkills</a> - returns an Array containing the seven major skills associated with the class. If the parameter is omitted, the class of the calling NPC is used.<br />
<code class="s">(skills:Array) <span class="op">reference.</span>GetClassSkills <span class="op">class:ref</span></code></p>
<p><a id="SetClassSkills" class="f" href="http://cs.elderscrolls.com/index.php?title=SetClassSkills">SetClassSkills</a> - accepts an Array of seven different skill codes and sets them as the class's major skills. If fewer or more than seven skills are found in the array or duplicate skills are found, the function will return zero with no changes made to the class. If the class argument is omitted, the calling NPC's class is used.<br />
<code class="s">(bSkillsSet:bool) <span class="op">reference.</span>SetClassSkills skills:Array <span class="op">class:ref</span></code></p>
<p><a id="SetClassSkills2" class="f" href="http://cs.elderscrolls.com/index.php?title=SetClassSkills2">SetClassSkills2</a> - Identical to SetClassSkills, except it allows duplicate skills.<br />
<code class="s">(bSkillsSet:bool) <span class="op">reference.</span>SetClassSkills2 skills:Array <span class="op">class:ref</span></code></p>
<p><a id="SetClassSpecialization" class="f" href="http://cs.elderscrolls.com/index.php?title=SetClassSpecialization">SetClassSpecialization</a> - sets the class specialization. If the class argument is omitted thecalling NPC's class is used.<br />
<code class="s">(nothing) <span class="op">reference.</span>SetClassSpecialization <a href="#Class_Specialization_Codes">specialization</a>:int <span class="op">class:ref</span></code></p>
<p><a id="SetClassAttribute" class="f" href="http://cs.elderscrolls.com/index.php?title=SetClassAttribute">SetClassAttribute</a> - sets one of the two favored attributes for the class. Both class attributes must be unique. If the class argument is omitted the calling NPC's class is used.<br />
<code class="s">(bAttributeSet:bool) <span class="op">reference.</span>SetClassAttribute which:int attribute:string <span class="op">class:ref</span></code></p>
<p><a id="SetClassAttributeC" class="f" href="http://cs.elderscrolls.com/index.php?title=SetClassAttributeC">SetClassAttributeC</a> - as SetClassAttribute but takes an actor value code instead of an actor value string.<br />
<code class="s">(bAttributeSet:bool) <span class="op">reference.</span>SetClassAttributeC which:int <a href="#Actor_Value_Codes">attribute</a>:int <span class="op">class:ref</span></code></p>
<h3><a id="Container">Container</a></h3>
<p>Something that holds inventory items.</p>
<h4>Functions:</h4>
<p><a id="GetNumItems" class="f" href="http://cs.elderscrolls.com/index.php?title=GetNumItems">GetNumItems</a> - returns the number of different object types in the container or actor's inventory.<br />
<b>Note: </b>This function can be used to check if a container is empty.<br />
<b>Note: </b>Keep in mind that gold counts as an item.<br />
<code class="s">(count:int) reference.GetNumItems</code></p>
<p><a id="GetInventoryObject" class="f" href="http://cs.elderscrolls.com/index.php?title=GetInventoryObject">GetInventoryObject</a> - returns the objectID of the Nth item type in the container or actor's inventory<br />
<b>Note: </b>For most use cases, this function is deprecated. If you need to find all objects in a certain container, check out <a href="#Inventory_Reference">Inventory References</a>.<br />
<code class="s">(objectID:ref) reference.GetInventoryObject whichObject:int</code></p>
<p><a id="IsContainer" class="f" href="http://cs.elderscrolls.com/index.php?title=IsContainer">IsContainer</a> - returns whether the reference or passed objectID is a container.<br />
<b>Note: </b>Actors do not count as containers.<br />
<code class="s">(isContainer:bool) <span class="op">reference.</span>IsContainer <span class="op">objectID:ref</span></code></p>
<p><a id="GetContainerRespawns" class="f" href="http://cs.elderscrolls.com/index.php?title=GetContainerRespawns">GetContainerRespawns</a> - returns whether the container's contents repawn.<br />
<code class="s">(respawns:bool) <span class="op">reference</span>.GetContainerRespawns <span class="op">objectID:ref</span></code><br />
<code class="s">(respawns:bool) <span class="op">reference</span>.IsUnsafeRespawns <span class="op">objectID:ref</span></code></p>
<p><a id="SetContainerRespawns" class="f" href="http://cs.elderscrolls.com/index.php?title=SetContainerRespawns">SetContainerRespawns</a> - sets whether the container's contents respawn.<br />
<b>Note: </b>This change is not persisted in the save game.<br />
<code class="s">(nothing) <span class="op">reference.</span>SetContainerRespawns respawns:bool <span class="op">objectID:ref</span></code><br />
<code class="s">(nothing) <span class="op">reference.</span>SetUnsafeContainer respawns:bool <span class="op">objectID:ref</span></code></p>
<p><a id="GetItems" class="f" href="http://cs.elderscrolls.com/index.php?title=GetItems">GetItems</a> - returns an Array containing all of the items in a container's or actor's inventory. Up to 10 form types may be passed in to restrict the returned items to only include items matching those type(s).<br />
<code class="s">(items:Array) reference.GetItems <span class="op">type1:int type2:int ... type10:int</span></code></p>
<p><a id="GetBaseItems" class="f" href="http://cs.elderscrolls.com/index.php?title=GetBaseItems">GetBaseItems</a> - returns an Array of StringMaps containing the items present in a base container or actor's inventory and the quantity of each. These are the items added to the base object in the editor and may include leveled items. Some, all, or none of the items may be present in the inventory of a specific reference to the base object. Each element of the returned Array is a StringMap with two elements:<br />
<span class="ind" style="font-family: monospace;">"item" : <strong>ref</strong></span> <span style="font-style: italic;">; the item</span><br />
<span class="ind" style="font-family: monospace;">"count" : <strong>short</strong></span> <span style="font-style: italic;">; the quantity of this item</span><br />
<code class="s">(items:Array) <span class="op">reference.</span>GetBaseItems <span class="op">baseContainer:ref</span></code></p>
<p>Values are accessed like:</p><pre> array_var baseItems
let baseItems := someChestRef.GetBaseItems
Print "First item: " + GetName baseItems[0][item] + " Quantity: " + ToString baseItems[0][count]</pre>
<h3><a id="Description">Description</a></h3>
<p>Types with this quality have descriptive text and include objects like books, skills, races, classes, and effect settings. Skills are unique in possessing five descriptions: one describing the skill and four associated with the text displayed when attaining a new rank in the skill.</p>
<h4>Values:</h4>
<p class="boxhl"><strong>Description</strong> (<span class="op">string</span>) - the text of the description</p>
<h4>Functions:</h4>
<p><a id="GetDescription" class="f" href="http://cs.elderscrolls.com/index.php?title=GetDecription">GetDescription</a> - returns the text of the description for the object. In the case of skills, an optional second parameter indicates the skill rank (0-3); if omitted, the skill's general description is returned.<br />
<code class="s">(description:string) <span class="op">ref</span>.GetDescription <span class="op">object:ref skillrank:int</span></code></p>
<p><a id="SetDescription" class="f" href="http://cs.elderscrolls.com/index.php?title=SetDescription">SetDescription</a> - modifies the text of a TESDescription (e.g. book, class, skill, skill level, etc). The modified description will be used for the remainder of the game session. To modify the text displayed when achieving a new level of mastery (Apprentice, Journeyman, etc) in a skill, pass the skill as the second argument and a skill level as the third, where skill level ranges from 0 (Apprentice) to 3 (Master)<br />
<b>Note: </b>Calling <code>SetDescription</code> on a skill while omitting the optional skillLevel argument sets the general description of the skill as well as all 4 mastery levels. Currently there is no way to only set the general skill description.<br />
<b>Note: </b>For books, setting a description longer than 65535 characters crashes the game when the book is opened in game. (TODO: Verify)<br />
<code class="s">(success:bool) <span class="op">reference.</span>SetDescription description:string<span class="op"> form:ref</span><span class="op"> skillLevel:int</span></code></p>
<h3><a id="Edible">Edible</a></h3>
<p>Types with this quality may be considered food.</p>
<h4>Values:</h4>
<p class="boxhl"><strong>Is Food flag</strong> (<span class="op">bool</span>) - is the object considered to be food</p>
<h4>Functions:</h4>
<p><a id="IsFood" class="f" href="http://cs.elderscrolls.com/index.php?title=IsFood">IsFood</a> - returns whether the object is considered to be food<br />
<code class="s">(isFood:bool) <span class="op">reference</span>.IsFood <span class="op">objectID:ref</span></code></p>
<p><a id="SetIsFood" class="f" href="http://cs.elderscrolls.com/index.php?title=SetIsFood">SetIsFood</a> - sets whether the object is considered to be food<br />
<code class="s">(nothing) <span class="op">reference</span>.SetIsFood isFood:bool <span class="op">objectID:ref</span></code></p>
<h3><a id="Enchantable">Enchantable</a></h3>
<p>Types with this quality may be enchanted. A couple notes: Enchantments and the ranges of their effects need to be appropriate for the enchantable object's type. The Enchantment Type needs to match the object the enchantment applies to. Also, when adding an enchantment to an object, be sure that the object has a charge, or the enchantment cannot work. If the object was not previously enchanted, call SetObjectCharge to assign a charge to the object.</p>
<h4>Values:</h4>
<p class="boxhl"><strong>Enchantment</strong> (<span class="op">ref</span>) - the specific enchantment on the enchantable item<br />