You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Event VM Functions.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -58,10 +58,10 @@ Prepares the entities that are involved with the current event attempting to run
58
58
* If true, then the client checks if the entity is within the current event playing.
59
59
* If this is false, the function hard-exists in failure.
60
60
*`if ( (entity->ServerId & 0xFF000000) == 0 )`
61
-
* If this is true, the client will call `XiActor::SetCastMagicID` function on the entity and set another value inside of its `WarpPointer` to `0x20202020`
61
+
* If this is true, the client will call `XiActor::SetCastMagicID` function on the entity and set another value inside of its `ActorPointer` to `0x20202020`
* If this is true, the function hard-exists in failure.
66
66
* Once the above has been checked, then the entity is considered valid. The following then happens:
67
67
*`XiAtelBuff::EventNew` is called for this entity.
@@ -98,7 +98,7 @@ The XiEvent object destructor. This cleans up the various allocations and other
98
98
99
99
This function is fairly straight forward in cleaning things up, but here's a quick rundown of what happens:
100
100
101
-
* The entity is obtained, if valid then it's event action is cancelled via: `XiAtelBuff::KillLastAction`
101
+
* The entity is obtained, if valid then it's event action is cancelled via: `XiAtelBuff::KillLastAction`
102
102
* The entity is tested for type `XiSkeletonActor::classXiSkeletonActor`
103
103
* If matched, then the entity is told to stop moving its mouth via: `XiAtelBuff::StopMouth` and `XiSkeletonActor::DeleteResp`
104
104
* The entities various flags and animation fields are reset from the event state.
@@ -143,7 +143,7 @@ The second initializer for the XiEvent object. This is used to finalize the init
143
143
144
144
Sets up the `ReqStack` that will be executed on the current tick then runs `XiEvent::ExecProg` in a loop until `RetFlag` is set.
145
145
146
-
When this function first starts, it ensures that an entity server id has been set. If not, then it returns 0.
146
+
When this function first starts, it ensures that an entity server id has been set. If not, then it returns 0.
147
147
148
148
Next, it determines the `ReqStack` that has the 'highest' `Priority`. The one found most important to run has it's index set into `RunPos`. This looks like:
Opcode `0x0000` is used to stop/reset the current `ReqStack` object. Since this handler sets `RetFlag` then the loop processing `XiEvent::ExecProg` will break. When this happens, `ExecPointer` is then stored into `ReqStack[RunPos].StackExecPointer`. However, this also sets the `Priority` to 255, which means on next tick, this stack is not considered valid and will fail the check done in `XiEvent::EventIdle` for `Priority`.
200
+
Opcode `0x0000` is used to stop/reset the current `ReqStack` object. Since this handler sets `RetFlag` then the loop processing `XiEvent::ExecProg` will break. When this happens, `ExecPointer` is then stored into `ReqStack[RunPos].StackExecPointer`. However, this also sets the `Priority` to 255, which means on next tick, this stack is not considered valid and will fail the check done in `XiEvent::EventIdle` for `Priority`.
* The default handler tests if the value is a normal entity server id for NPCs. `if ((val & 0xFF000000) != 0)`
480
480
* If true, the return values will be the value given as the server id and `val & 0x3FF` to get the target index.
481
481
* If false, the return values default to the local event entity information. (`EntityServerId[1]` and `EntityTargetIndex[1]`)
482
-
482
+
483
483
When the return values are set (they are put back into the incoming parameters), the function then returns true or false based on if the entity is valid/exists, and if the server id matches what was determined.
484
484
485
485
## `XiEvent::GetReqLevel`
@@ -513,7 +513,7 @@ int __thiscall FUNC_XiEvent_GetReqLevel(xievent_t* this, int priority)
Copy file name to clipboardexpand all lines: OpCodes/0x0023.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@
9
9
10
10
## Description
11
11
12
-
Waits for the local player to interact with a dialog message.
12
+
Waits for the local player to interact with a dialog message.
13
13
14
14
If a dialog is open and waiting for an interaction, the function will act like a yielding coroutine. Internally, `PTR_CliEventMessOpenFlag` will be set to 2 elsewhere and the `XiEvent::ExecProg` loop will hault until the user has made a selection. However, if `PTR_CliEventMessOpenFlag` is already 2 when this is called, then the state is considered invalid and the event is stopped by force.
15
15
16
-
If no dialog is opened/present, then the current `MouthIndex` entitiy, if one is set, is updated to stop talking and `MouthIndex` is reset to 0.
16
+
If no dialog is opened/present, then the current `MouthIndex` entitiy, if one is set, is updated to stop talking and `MouthIndex` is reset to 0.
0 commit comments