Xcom 2 Modding Tutorial
XCOM 2 was released yesterday across all territories, and brings with it the promise of a glorious strategy renaissance. But not all players are able to fully enjoy the game–a minority of players have, as with every PC title, been experiencing issues with XCOM 2.
The issues in the game range from crashes, errors, low framerate, and more.
We’ve prepared this guide to provide solutions for these issues. These fixes have been confirmed by players on reddit and the Steam forums to work, though your mileage may vary.
XCOM 2 Crashes on Startup
If your game crashes on startup, there’s a good chance your installation of XCOM 2 is corrupted. To fix this, simply go to your Library in Steam, right-click on XCOM 2 and select Local Files > Verify integrity of game cache, and let Steam redownload any files you’re missing.
XCOM 2 Crashes at the End of the Tutorial
If you’re running the game on an AMD graphics card, you may experience a crash when the game tries to play the cutscene immediately following the basic unit movements tutorial. To fix this issue, download the AMD Crimson Drivers 15.12 or newer.
Error 41
This error only occurs if you have a virus scanner running in the background. Disable Norton, Kaspersky, McAfee, or whatever antivirus software you have on your computer before running the game.
VCOMP120.DLL Crash
Official Map Modding Tutorial (Part 2): Making a custom ydr! This topic has been deleted. Only users with topic management privileges can see it. Background Info: Whats up modders back at you with my second tutorial for gta V map modding. In this one we will be making a custom.ydr.
If your game crashes with this error, you’ll need reinstall some run-time components on your PC. Grab it directly from Microsoft and avoid any other websites. There’s a lot of malware out there.
Geoscape Crash
If your game hangs upon loading up the Geoscape interface after you complete the two tutorial missions, simply reload a combat autosave from the most recent battle and finish the mission again.
Stuttering Cutscenes and Low Framerate
You should disable Ambient Occlusion and Screen Space Reflections, and turn your Anti-Aliasing (AA) down to FXAA or off. By default, the game will set your AA to the highest settings possible, which introduces a lot of performance issues.
- 2Programs and Tools
- 3Details
Overview
[The following is based upon wghost81's pseudo-code decompiler.]
When examining decompiled hex code that has been rendered in UnrealScript, it is often necessary to identify the hex code of certain operators and functions ('tokens'). So the following tables are often called 'token tables'.
Rev: Apr 2015
Programs and Tools
Though not required for use with this article, see reference Modding Tools - XCOM:EU 2012 for links. Here are short descriptions of the necessary tools.
UE Explorer
An Unreal Engine decompiler. For more information on decompilers in general, see this Decompiler Wikipedia article. This program lets you see the decompiled code almost as their creators wrote it, providing key information you will need to change UPK files, such as getting its hex representation, etc.
HxD HEX Editor
A general purpose hex editor. This is the program used to actually change the UPK files with the compiled hex codes.
Details
These tables show the decompiled UnrealScript and it's compiled hex code equivalent.
See Native Tables - XCOM:EU 2012 for the interpretation guidelines for byte-codes into decompiled code used within the UE Explorer (UEE) tool, which in turn is described and linked in Modding Tools - XCOM:EU 2012.
See Hex editing UPK files for information on how to apply this information. Basically these tables are used to interpret what a particular hex code means in terms of program function (using UE Explorer), and also how to convert an intended functionality into the necessary hex code to modify or replace the existing code (using a hex editor such as HxD).
Tokens
Since tokens are 1 byte in size, they can hold values from 0x00 to 0xFF, which gives 256 possible values. And there are way more native functions in the Unreal Engine (UE) than 256. To solve this problem UE uses the 0x60-0x6F tokens as markers which indicate that the index of that function exceeds the 0x00-0xFF range and that the next token should be used to identify a native function with an index greater than 0xFF. This effectively makes extended native function tokens 2 bytes long and increases the possible index range up to 0xFFF.
The thing with the 0x61-0x6F tokens is that they allow extending the native table beyond 256 functions.
Token 0x60 marks the beginning of the extended native tokens group and is never actually used in scripts. I believe they did it to save memory space, as the most frequently used tokens are 1 byte long and less frequently used extended tokens are 2 bytes long.
So, indexes 0x00-0x5F belong to the most frequently used tokens, which define basic UnrealScript operators. Those operators are defined in C++ code and are not declared inside Core and EngineUnrealScript classes. Indexes 0x70 to 0xFF are used for common operations, like comparison and summation. Corresponding functions are declared in base UnrealScript classes (like Object and Actor) but defined in C++ code. All the other functions with indexes from 0x100 to 0xFFF are declared in UnrealScript classes and defined in C++ code. Such functions have native(XXX) keyword, which indicates that they are a part of the native table ('XXX' is a placeholder for a native table index).
Basic UnrealScript functions have a specific hex data format and all the other native functions follow the same pattern:
This pattern holds for tokens 0x70 through 0xFF <ExtendedNativeToken>. (Token 0x60 is omitted to save space.)
For tokens 0x100 through 0xFFF the pattern is:
So as an example, for the 0x60 extended function with index 921 (= 0x399) the UnrealScript is:
Xcom 2 Modding Tutorial Episode 3
The shortened version of this explanation is given inside the tokens table on this page. Since all the extended functions follow the same pattern, their hex data format is identical.
In the same way, Cast Tokens belong in a different table, as they are not reused tokens but a second part of the PrimitiveCast token0x38.
Since tokens 0x00 through 0x5F do not have an associated Package.Class and have a different hex format and a lot of notes, they are placed in a separate table just for them alone.
NativeTableIndex
Actual size of the Native Table is 0x1000 (4096 dec) possible native functions. NativeTableIndex is the value in parentheses in their UnrealScript code. Example:
By looking at this definition we can see that the boolean equal-equal comparison operator is a native function with NativeTableIndex=242 (dec).
Here is another example:
This definition means that Vector2D multiply operator has NativeTableIndex=2513 (dec). (In the ODS tableNativeTableIndex is given in column D in dec and in column E in hex representation.) So, every native function has its own unique index in between 0x000 and 0xFFF.
Now let's look at how those indexes are represented in bytecode. Each 'expression' in bytecode starts with one or two tokens, which represent the corresponding native function call: <ExtendedNativeToken> <FunctionToken>.
If NativeTableIndex is less than 256 (indexes from 0x000 to 0x0FF) then <FunctionToken>=NativeTableIndex and <ExtendedNativeToken> is entirely omitted. So, boolean equal-equal comparison operator with NativeTableIndex=242 is represented by one byte: F2 in bytecode. Stock and commodity market bcom notes.
If NativeTableIndex is greater than 255 (indexes from 0x100 to 0xFFF) then both <ExtendedNativeToken> and <FunctionToken> are present as two bytes in the bytecode:
So, the Vector2D multiply operator with NativeTableIndex=2513 (dec; 0x9D1) is represented by two bytes in bytecode: 69 D1, so it will appear in the 0x69 Extended Function table. That is: for indexes 256 (0x100) through 4095 (0xFFF), the first byte is equal to one of the 'NativeFunctionX' tokens (0x61-0x6F) and the second byte is equal to the rightmost byte of NativeTableIndex for this function.
They could just use 2 bytes for each token, but this wouldn't be as effective as it is now, because on average each script would be twice as long.
UnrealScript Code Table
Values from this table are used directly; no additional prefix token is needed.
Example (LocalVariable):
<FunctionToken> = 1 byte NativeTableIndex
FToken | |||||
Dec | Hex | Name | Expression | Hex data format | Notes |
0 | 00 | LocalVariable | 00 <ObjRef> | ||
1 | 01 | InstanceVariable | 01 <ObjRef> | ||
2 | 02 | DefaultVariable | default. | 02 <ObjRef> | |
3 | 03 | StateVariable | 03 <ObjRef> | ||
4 | 04 | Return | return | 04 <Expr> | |
5 | 05 | Switch | switch | 05 <ObjRef> <Byte> <Expr> | ObjRef can be Null, if Expr is function call ObjRef = ReturnValRef, byte is 00 in most cases (02 in switch(arr.Len)) |
6 | 06 | Jump | goto | 06 <MemOff> | |
7 | 07 | JumpIfNot | if | 07 <MemOff> <Expr> | |
8 | 08 | Stop | stop | 08 | |
9 | 09 | Assert | assert | 09 <Short> <Byte> <Expr> | |
10 | 0A | Case | case | 0A <MemOff> <Expr> | if MemOff0xFFFF, Expr is omitted |
11 | 0B | Nothing | 0B | ||
12 | 0C | LabelTable | 0C <Labels> | Each label entry is NameRef + 4 bytes of memory offset, last entry is NoneRef + 0x0000FFFF | |
13 | 0D | GotoLabel | goto | 0D <Expr> | |
14 | 0E | EatString | 0E <ObjRef> <Expr> | ||
15 | 0F | Let | = | 0F <Expr(Left)> <Expr(Right)> | |
16 | 10 | DynArrayElement | [] | 10 <Expr(Index)> <Expr(Array)> | |
17 | 11 | New | new | 11 <Expr> <Expr> <Expr> <Expr> <Expr> | 0B for omitted parm |
18 | 12 | ClassContext | Class. | 12 <Expr> <MemSize> <RetValRef> <Byte> <Expr> | MemSize is a memory size of Expr, If Expr is variable, RetValRef = VarRef |
19 | 13 | MetaCast | class<Name>(Obj) | 13 <ObjRef(Class)> <Expr> | |
20 | 14 | LetBool | = | 14 <Expr(Left)> <Expr(Right)> | |
21 | 15 | EndParmValue | 15 | marks the end of default parm value | |
22 | 16 | EndFunctionParms | ) | 16 | marks the end of function parms |
23 | 17 | Self | self | 17 | |
24 | 18 | Skip | 18 <MemSize> | MemSize bytes to skip | |
25 | 19 | Context | . | 19 <Expr(Left)> <MemSize> <RetValRef> <Byte> <Expr(Right)> | MemSize is a memory size of Expr, If Expr is variable, RetValRef = VarRef |
26 | 1A | ArrayElement | [] | 1A <Expr(Index)> <Expr(Array)> | |
27 | 1B | VirtualFunction | Function( | 1B <NameRef> <Parms> 16 | |
28 | 1C | FinalFunction | Function( | 1C <ObjRef> <Parms> 16 | |
29 | 1D | IntConst | 5 | 1D <Int32> | |
30 | 1E | FloatConst | 5.0 | 1E <Float32> | |
31 | 1F | StringConst | '5.0' | 1F <NullTerminatedString> | |
32 | 20 | ObjectConst | Object | 20 <ObjRef> | |
33 | 21 | NameConst | 'Name' | 21 <NameRef> | |
34 | 22 | RotatorConst | rot(1,2,3) | 22 <Int32> <Int32> <Int32> | |
35 | 23 | VectorConst | vect(1.0,2.0,3.0) | 23 <Float32> <Float32> <Float32> | |
36 | 24 | ByteConst | 5 | 24 <Byte> | |
37 | 25 | IntZero | 0 | 25 | |
38 | 26 | IntOne | 1 | 26 | |
39 | 27 | True | true | 27 | |
40 | 28 | False | false | 28 | |
41 | 29 | NativeParm | unconfirmed | 29 | |
42 | 2A | NoObject | none | 2A | |
43 | 2B | Unknown_Deprecated | none | 2A | |
44 | 2C | IntConstByte | 5 | 2C <Byte> | |
45 | 2D | BoolVariable | 2D <Expr> | ||
46 | 2E | DynamicCast | ClassName(Object) | 2E <ObjRef(Class)> <Expr> | |
47 | 2F | Iterator | foreach IteratorFunc(..) | 2F <Expr> <MemOff> | MemOff is a memory offset of IteratorPop token |
48 | 30 | IteratorPop | 30 | ||
49 | 31 | IteratorNext | 31 | ||
50 | 32 | StructCmpEq | 32 <Expr> <Expr> | ||
51 | 33 | StructCmpNe | != | 33 <Expr> <Expr> | |
52 | 34 | UniStringConst | Not used in XCOM? | 34 <NullTerminatedString> | |
53 | 35 | StructMember | . | 35 <ObjRef(Member)> <ObjRef(Struct)> <Byte> <Byte> <Expr> | |
54 | 36 | DynArrayLen | arrName.Length | 36 <Expr> | |
55 | 37 | GlobalFunction | global. | 37 <Expr> | |
56 | 38 | PrimitiveCast | int(ENamed_Value) | 38 <CastToken> <Expr> | |
57 | 39 | DynArrayInsert | arrName.Insert(Index,Count) | 39 <Expr(Array)> <Expr(Index)> <Expr(Count)> 16 | |
58 | 3A | ReturnNothing | return ReturnValue | 3A <RetValRef> | |
59 | 3B | DelegateCmpEq | 3B <Expr(Left)> <Expr(Right)> 16 | ||
60 | 3C | DelegateCmpNe | != | 3C <Expr(Left)> <Expr(Right)> 16 | |
61 | 3D | DelegateFunctionCmpEq | 3D <Expr(Left)> <Expr(Right)> 16 | ||
62 | 3E | DelegateFunctionCmpNE | != | 3E <Expr(Left)> <Expr(Right)> 16 | |
63 | 3F | NoDelegate | 3F | ||
64 | 40 | DynArrayRemove | arrName.Remove(Index,Count) | 40 <Expr(Array)> <Expr(Index)> <Expr(Count)> 16 | |
65 | 41 | DebugInfo | 41 <Int32> <Int32> <Int32> <Byte> | ||
66 | 42 | DelegateFunction | DelegateName(..) | 42 <Byte> <ObjRef> <NameRef> <Params> 16 | |
67 | 43 | DelegateProperty | Sort(Delegate) | 43 <NameRef> <ObjRef> | |
68 | 44 | LetDelegate | = | 44 <Expr(Left)> <Expr(Right)> | |
69 | 45 | TernaryCondition | x > y ? 5 : 10 | 45 <Expr(Cond)> <MemSize> <Expr(IfTrue)> <MemSize> <Expr(IfFalse)> | |
70 | 46 | DynArrFind | arrName.Find(Value) | 46 <Expr(Array)> <MemSize> <Expr(Value)> 16 | MemSize is a memory size of Expr + 1 (for 16 token) |
71 | 47 | DynArrayFindStruct | arrName.Find(PropertyName,Value) | 47 <Expr(Array)> <MemSize> <Expr(Name)> <Expr(Value)> 16 | MemSize is a memory size of Expr + Expr + 1 (for 16 token) |
72 | 48 | OutVariable | out | 48 <ObjRef> | |
73 | 49 | DefaultParmValue | 49 <MemSize> <Expr(Value)> 15 | MemSize is a memory size of Expr + 1 (for 16 token) | |
74 | 4A | NoParm | 4A | empty (default) parm value in function call | |
75 | 4B | InstanceDelegate | unconfirmed | 4B <NameRef> | |
76 | 4C | DynamicVariable | |||
77 | 4D | DynamicVariable | |||
78 | 4E | DynamicVariable | |||
79 | 4F | DynamicVariable | |||
80 | 50 | DynamicVariable | |||
81 | 51 | InterfaceContext | 51 <Expr> | ||
82 | 52 | InterfaceCast | ClassName(Object) | 52 <ObjRef(Class)> <Expr> | |
83 | 53 | EndOfScript | 53 | ||
84 | 54 | DynArrAdd | arrName.Add(Count) | 54 <Expr(Array)> <Expr(Count)> | |
85 | 55 | DynArrAddItem | arrName.AddItem(Item) | 55 <Expr(Array)> <MemSize> <Expr(Item)> 16 | MemSize is a memory size of Expr + 1 (for 16 token) |
86 | 56 | DynArrRemoveItem | arrName.RemoveItem(Item) | 56 <Expr(Array)> <MemSize> <Expr(Item)> 16 | MemSize is a memory size of Expr + 1 (for 16 token) |
87 | 57 | DynArrInsertItem | arrName.InsertItem(Index,Item) | 57 <Expr(Array)> <MemSize> <Expr(Index)> <Expr(Item)> 16 | MemSize is a memory size of Expr + Expr + 1 (for 16 token) |
88 | 58 | DynArrIterator | foreach Array(Var,Index) | 58 <Expr(Array)> <Expr(Var)> <Byte> <Expr(Index)> <MemOff> | MemOff is a memory offset of IteratorPop token |
89 | 59 | DynArrSort | arrName.Sort(SortDelegate) | 59 <Expr(Array)> <MemSize> <DelegateProperty> 16 | MemSize is a memory size of DelegateProperty + 1 (for 16 token) |
90 | 5A | FilterEditorOnly | |||
91 | 5B | ||||
92 | 5C | ||||
93 | 5D | ||||
94 | 5E | ||||
95 | 5F |
Xcom 2 Modding Tutorial Pc
UnrealScript Code Table - Extended Native Functions
Values from this table are never used directly, they are used as prefix tokens for calling Extended Native Functions with indexes > 255.
2 byte NativeTableIndex = <ExtendedNativeToken 'x'> <FunctionToken>
FToken | |||
Dec | Hex | Name | Notes |
96 | 60 | ExtendedNative | This number marks the beginning of the Extended Native Functions table |
97 | 61 | NativeFunction1 | NativeTableIdx = (NativeFunctionX-ExtendedNative)*256+NextToken |
98 | 62 | NativeFunction2 | NativeTable max size = 16 * 256 = 4096 |
99 | 63 | NativeFunction3 | NativeTable max index = 0xFFF = 4095 |
100 | 64 | NativeFunction4 | Starting with index 256 (0x100) native function call is preceded with |
101 | 65 | NativeFunction5 | 0x61-0x6F token and the following function index is shifted to |
102 | 66 | NativeFunction6 | 0x00-0xFF range |
103 | 67 | NativeFunction7 | Native function call (70 to FF): <Token> <Params> 16 |
104 | 68 | NativeFunction8 | Native function call (100 to FFF): <NativeFunctionX> <Token> <Params> 16 |
105 | 69 | NativeFunction9 | |
106 | 6A | NativeFunctionA | |
107 | 6B | NativeFunctionB | |
108 | 6C | NativeFunctionC | |
109 | 6D | NativeFunctionD | |
110 | 6E | NativeFunctionE | |
111 | 6F | NativeFunctionF |
UnrealScript Code Table (continued)
Values from this table are used directly, no additional prefixing token is needed. Function call follows this pattern:
Example (GotoState):
<FunctionToken> = 1 byte NativeTableIndex
FToken | ||||
Dec | Hex | Name | Expression | Package.Class |
112 | 70 | Concat_StringString | string1$string2 | Core.Object |
113 | 71 | GotoState | GotoState(Name) | Core.Object |
114 | 72 | EqualEqual_ObjectObject | Core.Object | |
115 | 73 | Less_StringString | < | Core.Object |
116 | 74 | Greater_StringString | > | Core.Object |
117 | 75 | Enable | Enable(ProbeFuncName) | Core.Object |
118 | 76 | Disable | Disable(ProbeFuncName) | Core.Object |
119 | 77 | NotEqual_ObjectObject | != | Core.Object |
120 | 78 | LessEqual_StringString | <= | Core.Object |
121 | 79 | GreaterEqual_StringString | >= | Core.Object |
122 | 7A | EqualEqual_StringString | Core.Object | |
123 | 7B | NotEqual_StringString | != | Core.Object |
124 | 7C | ComplementEqual_StringString | ~= | Core.Object |
125 | 7D | StringLen | Len(String) | Core.Object |
126 | 7E | InStr | InStr(String,Substring) | Core.Object |
127 | 7F | Mid | Mid(String,Index,Count) | Core.Object |
128 | 80 | Left | Left(String,Count) | Core.Object |
129 | 81 | Not_PreBool | ! | Core.Object |
130 | 82 | AndAnd_BoolBool | && | Core.Object |
131 | 83 | XorXor_BoolBool | ^^ | Core.Object |
132 | 84 | OrOr_BoolBool | Core.Object | |
133 | 85 | MultiplyEqual_ByteByte | *= | Core.Object |
134 | 86 | DivideEqual_ByteByte | /= | Core.Object |
135 | 87 | AddEqual_ByteByte | += | Core.Object |
136 | 88 | SubtractEqual_ByteByte | -= | Core.Object |
137 | 89 | AddAdd_PreByte | ++ | Core.Object |
138 | 8A | SubtractSubtract_PreByte | -- | Core.Object |
139 | 8B | AddAdd_Byte | ++ | Core.Object |
140 | 8C | SubtractSubtract_Byte | -- | Core.Object |
141 | 8D | Complement_PreInt | ~ | Core.Object |
142 | 8E | EqualEqual_RotatorRotator | Core.Object | |
143 | 8F | Subtract_PreInt | - | Core.Object |
144 | 90 | Multiply_IntInt | * | Core.Object |
145 | 91 | Divide_IntInt | / | Core.Object |
146 | 92 | Add_IntInt | + | Core.Object |
147 | 93 | Subtract_IntInt | - | Core.Object |
148 | 94 | LessLess_IntInt | << | Core.Object |
149 | 95 | GreaterGreater_IntInt | >> | Core.Object |
150 | 96 | Less_IntInt | < | Core.Object |
151 | 97 | Greater_IntInt | > | Core.Object |
152 | 98 | LessEqual_IntInt | <= | Core.Object |
153 | 99 | GreaterEqual_IntInt | >= | Core.Object |
154 | 9A | EqualEqual_IntInt | Core.Object | |
155 | 9B | NotEqual_IntInt | != | Core.Object |
156 | 9C | And_IntInt | & | Core.Object |
157 | 9D | Xor_IntInt | ^ | Core.Object |
158 | 9E | Or_IntInt | Core.Object | |
159 | 9F | MultiplyEqual_IntFloat | *= | Core.Object |
160 | A0 | DivideEqual_IntFloat | /= | Core.Object |
161 | A1 | AddEqual_IntInt | += | Core.Object |
162 | A2 | SubtractEqual_IntInt | -= | Core.Object |
163 | A3 | AddAdd_PreInt | ++ | Core.Object |
164 | A4 | SubtractSubtract_PreInt | -- | Core.Object |
165 | A5 | AddAdd_Int | ++ | Core.Object |
166 | A6 | SubtractSubtract_Int | -- | Core.Object |
167 | A7 | Rand | Rand(Count) | Core.Object |
168 | A8 | At_StringString | [email protected] | Core.Object |
169 | A9 | Subtract_PreFloat | - | Core.Object |
170 | AA | MultiplyMultiply_FloatFloat | ** | Core.Object |
171 | AB | Multiply_FloatFloat | * | Core.Object |
172 | AC | Divide_FloatFloat | / | Core.Object |
173 | AD | Percent_FloatFloat | % | Core.Object |
174 | AE | Add_FloatFloat | + | Core.Object |
175 | AF | Subtract_FloatFloat | - | Core.Object |
176 | B0 | Less_FloatFloat | < | Core.Object |
177 | B1 | Greater_FloatFloat | > | Core.Object |
178 | B2 | LessEqual_FloatFloat | <= | Core.Object |
179 | B3 | GreaterEqual_FloatFloat | >= | Core.Object |
180 | B4 | EqualEqual_FloatFloat | Core.Object | |
181 | B5 | NotEqual_FloatFloat | != | Core.Object |
182 | B6 | MultiplyEqual_FloatFloat | *= | Core.Object |
183 | B7 | DivideEqual_FloatFloat | /= | Core.Object |
184 | B8 | AddEqual_FloatFloat | += | Core.Object |
185 | B9 | SubtractEqual_FloatFloat | -= | Core.Object |
186 | BA | Abs | Abs(Float) | Core.Object |
187 | BB | Sin | Sin(Float) | Core.Object |
188 | BC | Cos | Cos(Float) | Core.Object |
189 | BD | Tan | Tan(Float) | Core.Object |
190 | BE | Atan | Atan(Float) | Core.Object |
191 | BF | Exp | Exp(Float) | Core.Object |
192 | C0 | Loge | Loge(Float) | Core.Object |
193 | C1 | Sqrt | Sqrt(Float) | Core.Object |
194 | C2 | Square | Square(Float) | Core.Object |
195 | C3 | FRand | FRand() | Core.Object |
196 | C4 | GreaterGreaterGreater_IntInt | >>> | Core.Object |
197 | C5 | IsA | IsA('ClassName') | Core.Object |
198 | C6 | MultiplyEqual_ByteFloat | *= | Core.Object |
199 | C7 | Round | Round(Float) | Core.Object |
201 | C9 | Repl | Repl(String,Match,With,bCase) | Core.Object |
203 | CB | NotEqual_RotatorRotator | != | Core.Object |
210 | D2 | ComplementEqual_FloatFloat | ~= | Core.Object |
211 | D3 | Subtract_PreVector | - | Core.Object |
212 | D4 | Multiply_VectorFloat | * | Core.Object |
213 | D5 | Multiply_FloatVector | * | Core.Object |
214 | D6 | Divide_VectorFloat | / | Core.Object |
215 | D7 | Add_VectorVector | + | Core.Object |
216 | D8 | Subtract_VectorVector | - | Core.Object |
217 | D9 | EqualEqual_VectorVector | Core.Object | |
218 | DA | NotEqual_VectorVector | != | Core.Object |
219 | DB | Dot_VectorVector | v1 Dot v2 | Core.Object |
220 | DC | Cross_VectorVector | v1 Cross v2 | Core.Object |
221 | DD | MultiplyEqual_VectorFloat | *= | Core.Object |
222 | DE | DivideEqual_VectorFloat | /= | Core.Object |
223 | DF | AddEqual_VectorVector | += | Core.Object |
224 | E0 | SubtractEqual_VectorVector | -= | Core.Object |
225 | E1 | VSize | VSize(Vector) | Core.Object |
226 | E2 | Normal | Normal(Vector) | Core.Object |
228 | E4 | VSizeSq | VSizeSq(Vector) | Core.Object |
229 | E5 | GetAxes | GetAxes(Rot,Vect,Vect,Vect) | Core.Object |
230 | E6 | GetUnAxes | GetUnAxes(Rot,Vect,Vect,Vect) | Core.Object |
231 | E7 | LogInternal | LogInternal(String,'Name') | Core.Object |
232 | E8 | WarnInternal | WarnInternal(String) | Core.Object |
234 | EA | Right | Right(String,COunt) | Core.Object |
235 | EB | Caps | Caps(String) | Core.Object |
236 | EC | Chr | Chr(Integer) | Core.Object |
237 | ED | Asc | Asc(String) | Core.Object |
238 | EE | Locs | Locs(String) | Core.Object |
242 | F2 | EqualEqual_BoolBool | Core.Object | |
243 | F3 | NotEqual_BoolBool | != | Core.Object |
244 | F4 | FMin | FMin(Float,Float) | Core.Object |
245 | F5 | FMax | FMax(Float,Float) | Core.Object |
246 | F6 | FClamp | FClamp(Val,Min,Max) | Core.Object |
247 | F7 | Lerp | Lerp(Float,Float,Float) | Core.Object |
249 | F9 | Min | Min(Float,Float) | Core.Object |
250 | FA | Max | Max(Float,Float) | Core.Object |
251 | FB | Clamp | Clamp(Val,Min,Max) | Core.Object |
252 | FC | VRand | VRand() | Core.Object |
253 | FD | Percent_IntInt | % | Core.Object |
254 | FE | EqualEqual_NameName | Core.Object | |
255 | FF | NotEqual_NameName | != | Core.Object |
Extended Native Function 0x61 Table
Values from this table require prefixing the 61 (NativeFunction1 token) before the <Function token>. Function call follows this pattern:
Example (Sleep):
2 byte Bytecode Value = <ExtendedNativeToken '0x61'> <FunctionToken 'x'> (i.e. 0x6100-0x61FF).
2 byte NativeTableIndex (i.e. NTIndex) = 0x01 <FunctionToken 'x'> (i.e. 0x0100-0x01FF).
FToken | NTIndex | |||||
Dec | Hex | Dec | Hex | Name | Expression | Package.Class |
0 | 00 | 256 | 100 | Sleep | Sleep(Time) | Engine.Actor |
2 | 02 | 258 | 102 | ClassIsChildOf | ClassIsChildOf(cTest,cParent) | Core.Object |
5 | 05 | 261 | 105 | FinishAnim | FinishAnim(..) | Engine.Actor |
6 | 06 | 262 | 106 | SetCollision | SetCollision(..) | Engine.Actor |
10 | 0A | 266 | 10A | Move | Move(vDelta) | Engine.Actor |
11 | 0B | 267 | 10B | SetLocation | SetLocation(vLoc) | Engine.Actor |
14 | 0E | 270 | 10E | Add_QuatQuat | + | Core.Object |
15 | 0F | 271 | 10F | Subtract_QuatQuat | - | Core.Object |
16 | 10 | 272 | 110 | SetOwner | SetOwner(Actor) | Engine.Actor |
19 | 13 | 275 | 113 | LessLess_VectorRotator | << | Core.Object |
20 | 14 | 276 | 114 | GreaterGreater_VectorRotator | >> | Core.Object |
21 | 15 | 277 | 115 | Trace | Trace(..) | Engine.Actor |
23 | 17 | 279 | 117 | Destroy | Destroy() | Engine.Actor |
24 | 18 | 280 | 118 | SetTimer | SetTimer(..) | Engine.Actor |
25 | 19 | 281 | 119 | IsInState | IsInState('Name',bStack) | Core.Object |
27 | 1B | 283 | 11B | SetCollisionSize | SetCollisionSize(Float,Float) | Engine.Actor |
28 | 1C | 284 | 11C | GetStateName | GetStateName() | Core.Object |
31 | 1F | 287 | 11F | Multiply_RotatorFloat | * | Core.Object |
32 | 20 | 288 | 120 | Multiply_FloatRotator | * | Core.Object |
33 | 21 | 289 | 121 | Divide_RotatorFloat | / | Core.Object |
34 | 22 | 290 | 122 | MultiplyEqual_RotatorFloat | *= | Core.Object |
35 | 23 | 291 | 123 | DivideEqual_RotatorFloat | /= | Core.Object |
40 | 28 | 296 | 128 | Multiply_VectorVector | * | Core.Object |
41 | 29 | 297 | 129 | MultiplyEqual_VectorVector | *= | Core.Object |
42 | 2A | 298 | 12A | SetBase | SetBase(..) | Engine.Actor |
43 | 2B | 299 | 12B | SetRotation | SetRotation(rRot) | Engine.Actor |
44 | 2C | 300 | 12C | MirrorVectorByNormal | MirrorVectorByNormal(Vect,Norm) | Core.Object |
48 | 30 | 304 | 130 | AllActors | AllActors(Class,Out,Intrf) | Engine.Actor |
49 | 31 | 305 | 131 | ChildActors | ChildActors(Clas,Out) | Engine.Actor |
50 | 32 | 306 | 132 | BasedActors | BasedActors(Clas,Out) | Engine.Actor |
51 | 33 | 307 | 133 | TouchingActors | TouchingActors(Clas,Out) | Engine.Actor |
53 | 35 | 309 | 135 | TraceActors | TraceActors(..) | Engine.Actor |
55 | 37 | 311 | 137 | VisibleActors | VisibleActors(..) | Engine.Actor |
56 | 38 | 312 | 138 | VisibleCollidingActors | VisibleCollidingActors(..) | Engine.Actor |
57 | 39 | 313 | 139 | DynamicActors | DynamicActors(Class,Out,Intrf) | Engine.Actor |
60 | 3C | 316 | 13C | Add_RotatorRotator | + | Core.Object |
61 | 3D | 317 | 13D | Subtract_RotatorRotator | - | Core.Object |
62 | 3E | 318 | 13E | AddEqual_RotatorRotator | += | Core.Object |
63 | 3F | 319 | 13F | SubtractEqual_RotatorRotator | -= | Core.Object |
64 | 40 | 320 | 140 | RotRand | RotRand(bRoll) | Core.Object |
65 | 41 | 321 | 141 | CollidingActors | CollidingActors(..) | Engine.Actor |
66 | 42 | 322 | 142 | ConcatEqual_StringString | $= | Core.Object |
67 | 43 | 323 | 143 | AtEqual_StringString | @= | Core.Object |
68 | 44 | 324 | 144 | SubtractEqual_StringString | -= | Core.Object |
244 | F4 | 500 | 1F4 | MoveTo | MoveTo(..) | Engine.Controller |
246 | F6 | 502 | 1F6 | MoveToward | MoveToward(..) | Engine.Controller |
252 | FC | 508 | 1FC | FinishRotation | FinishRotation() | Engine.Controller |
Extended Native Function 0x62 Table
Values from this table require prefixing the 62 (NativeFunction2 token) before the <Function token>. Function call follows this pattern:
Example (CanSee):
2 byte Bytecode Value = <ExtendedNativeToken '0x62'> <FunctionToken 'x'> (i.e. 0x6200-0x62FF).
2 byte NativeTableIndex (i.e. NTIndex) = 0x02 <FunctionToken 'x'> (i.e. 0x0200-0x02FF).
FToken | NTIndex | |||||
Dec | Hex | Dec | Hex | Name | Expression | Package.Class |
0 | 00 | 512 | 200 | MakeNoise | MakeNoise(Loudness,Type) | Engine.Actor |
2 | 02 | 514 | 202 | LineOfSightTo | Not used in XCOM? | |
5 | 05 | 517 | 205 | FindPathToward | Not used in XCOM? | |
6 | 06 | 518 | 206 | FindPathTo | Not used in XCOM? | |
8 | 08 | 520 | 208 | ActorReachable | Not used in XCOM? | |
9 | 09 | 521 | 209 | PointReachable | Not used in XCOM? | |
12 | 0C | 524 | 20C | FindStairRotation | FindStairRotation(DeltaT) | Engine.PlayerController |
13 | 0D | 525 | 20D | FindRandomDest | Not used in XCOM? | |
14 | 0E | 526 | 20E | PickWallAdjust | Not used in XCOM? | |
15 | 0F | 527 | 20F | WaitForLanding | WaitForLanding(Duration) | Engine.Controller |
19 | 13 | 531 | 213 | PickTarget | PickTarget(..) | Engine.Controller |
20 | 14 | 532 | 214 | PlayerCanSeeMe | PlayerCanSeeMe(bForceLOSCheck) | Engine.Actor |
21 | 15 | 533 | 215 | CanSee | CanSee(Pawn) | Engine.Controller |
24 | 18 | 536 | 218 | SaveConfig | SaveConfig() | Core.Object |
25 | 19 | 537 | 219 | CanSeeByPoints | CanSeeByPoints(Vect,Vect,Rot) | Engine.Controller |
34 | 22 | 546 | 222 | UpdateURL | UpdateURL(..) | Engine.PlayerController |
35 | 23 | 547 | 223 | GetURLMap | GetURLMap() | Engine.Actor |
36 | 24 | 548 | 224 | FastTrace | FastTrace(..) | Engine.Actor |
Extended Native Function 0x65 Table
Values from this table require prefixing the 65 (NativeFunction5 token) before the <Function token>. Function call follows this pattern:
Example (IsZero):
2 byte Bytecode Value = <ExtendedNativeToken '0x65'> <FunctionToken 'x'> (i.e. 0x6500-0x65FF).
2 byte NativeTableIndex (i.e. NTIndex) = 0x05 <FunctionToken 'x'> (i.e. 0x0500-0x05FF).
FToken | NTIndex | |||||
Dec | Hex | Dec | Hex | Name | Expression | Package.Class |
220 | DC | 1500 | 5DC | ProjectOnTo | ProjectOnTo(Vector,Vector) | Core.Object |
221 | DD | 1501 | 5DD | IsZero | IsZero(Vector) | Core.Object |
Extended Native Function 0x69 Table
Values from this table require prefixing the 69 (NativeFunction9 token) before the <Function token>. Function call follows this pattern:
Example (V2DSize):
2 byte Bytecode Value = <ExtendedNativeToken '0x69'> <FunctionToken 'x'> (i.e. 0x6900-0x69FF).
2 byte NativeTableIndex (i.e. NTIndex) = 0x09 <FunctionToken 'x'> (i.e. 0x0900-0x09FF).
FToken | NTIndex | |||||
Dec | Hex | Dec | Hex | Name | Expression | Package.Class |
207 | CF | 2511 | 9CF | Subtract_PreVector2D | - | Core.Object |
209 | D1 | 2513 | 9D1 | Multiply_FloatVector2D | * | Core.Object |
213 | D5 | 2517 | 9D5 | EqualEqual_Vector2DVector2D | Core.Object | |
214 | D6 | 2518 | 9D6 | NotEqual_Vector2DVector2D | != | Core.Object |
221 | DD | 2525 | 9DD | V2DSize | V2DSize(Vector2D) | Core.Object |
222 | DE | 2526 | 9DE | V2DNormal | V2DNormal(Vector2D) | Core.Object |
Extended Native Function 0x6A Table
Values from this table require prefixing the 6A (NativeFunctionA token) before the <Function token>. Function call follows this pattern:
Example (Multiply_Vector2DVector2D):
2 byte Bytecode Value = <ExtendedNativeToken '0x6A'> <FunctionToken 'x'> (i.e. 0x6A00-0x6AFF).
2 byte NativeTableIndex (i.e. NTIndex) = 0x0A <FunctionToken 'x'> (i.e. 0x0A00-0x0AFF).
FToken | NTIndex | |||||
Dec | Hex | Dec | Hex | Name | Expression | Package.Class |
36 | 24 | 2596 | A24 | Multiply_Vector2DVector2D | * | Core.Object |
37 | 25 | 2597 | A25 | MultiplyEqual_Vector2DVector2D | *= | Core.Object |
Extended Native Function 0x6F Table
Values from this table require prefixing the 6F (NativeFunctionF token) before the <Function token>. Function call follows this pattern:
Example (SetPhysics):
2 byte Bytecode Value = <ExtendedNativeToken '0x6F'> <FunctionToken 'x'> (i.e. 0x6F00-0x6FFF).
2 byte NativeTableIndex (i.e. NTIndex) = 0x0F <FunctionToken 'x'> (i.e. 0x0F00-0x0FFF).
FToken | NTIndex | |||||
Dec | Hex | Dec | Hex | Name | Expression | Package.Class |
129 | 81 | 3969 | F81 | MoveSmooth | MoveSmooth(vDelta) | Engine.Actor |
130 | 82 | 3970 | F82 | SetPhysics | SetPhysics(EPhysics) | Engine.Actor |
131 | 83 | 3971 | F83 | AutonomousPhysics | AutonomousPhysics(DeltaSec) | Engine.Actor |
PrimitiveCast Tokens 0x38 Table
Cast tokens are used for primitive cast operations: i.e. if you need to convert a variable of type INT to type FLOAT for example, you need to use a Cast Token; which is prefixed by the PrimitiveCast token0x38.
Example (INT to FLOAT):
Cast tokens are using one native PrimitiveCast Function (token 38) and the CastToken itself is a 'parameter' for this function.
CastToken | ||
Dec | Hex | From TypeA To TypeB |
54 | 36 | InterfaceToBool |
55 | 37 | InterfaceToString |
56 | 38 | InterfaceToObject |
57 | 39 | RotatorToVector |
58 | 3A | ByteToInt |
59 | 3B | ByteToBool |
60 | 3C | ByteToFloat |
61 | 3D | IntToByte |
62 | 3E | IntToBool |
63 | 3F | IntToFloat |
64 | 40 | BoolToByte |
65 | 41 | BoolToInt |
66 | 42 | BoolToFloat |
67 | 43 | FloatToByte |
68 | 44 | FloatToInt |
69 | 45 | FloatToBool |
70 | 46 | ObjectToInterface |
71 | 47 | ObjectToBool |
72 | 48 | NameToBool |
73 | 49 | StringToByte |
74 | 4A | StringToInt |
75 | 4B | StringToBool |
76 | 4C | StringToFloat |
77 | 4D | StringToVector |
78 | 4E | StringToRotator |
79 | 4F | VectorToBool |
80 | 50 | VectorToRotator |
81 | 51 | RotatorToBool |
82 | 52 | ByteToString |
83 | 53 | IntToString |
84 | 54 | BoolToString |
85 | 55 | FloatToString |
86 | 56 | ObjectToString |
87 | 57 | NameToString |
88 | 58 | VectorToString |
89 | 59 | RotatorToString |
90 | 5A | DelegateToString |
96 | 60 | StringToName |
References
Referred to by this article:
That refer to this article: