MSFD Define random Actor movement
AiWander, range_enum, duration_enum, time_enum, [idle1], [idle2], [idle3], …[idle9], [reset]
"Actor_ID"->AIWander, 512, 5, 0, 0, 20, 0, 0, 10, 30, 0, 0, 0
This is the random movement algorithm that most of the NPCs in the game are using. The NPC travels along the path grid, changes direction randomly, and performs idle movements in between.
• Range: determines the distance the Actor or creature will roam from his origin.
• Duration: probably the time (in hours) the mob will perform the package (before it is reset, which seems to happen if you leave or sleep, not sure?)
• time: presumably determines the start time for the package if it has a duration
• [idle1], …[idle9]: chances of idle movements.
The Idles are (as tested in game):
• Human male:
Idle1: Stand still
Idle2: Shifting weight from one leg to the other
Idle3: Looking behind
Idle4: Scratching head, shake head
Idle5: Shifting clothing or armor on shoulder
Idle6: Yawning and stretching
Idle7: Looking at fingers and looking around furtively
Idle8: Putting hand to chest, as if having heartburn
Idle9: Reaching for weapon, then touching head
• Human female - as above but:
Idle5: Hand on hip
• Khajiit female - as Human male but
Idle9: Scratching head, shaking head
To let an Actor stand in one spot you can use: AIWander, 0, 0, 0
Note: The number of idles and some of the descriptions were listed wrongly in previous versions (corrected with 8th edition - credits go to Whoopa).
Here is an example script that displays all idles in series (this my be useful to check out which ones you want your NPC to use):
Begin Animtest
float timer
short count
set timer to ( timer + GetSecondsPassed )
if ( timer > 10 )
set timer to 0
set count to ( count + 1 )
if ( count >= 18 )
set count to 0
endif
endif
if ( count == 1 )
AIWander 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0
MessageBox "Idle 1 , 100"
set count to ( count + 1 )
elseif ( count == 3 )
AIWander 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0
MessageBox "Idle 2 , 100"
set count to ( count + 1 )
elseif ( count == 5 )
AIWander 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0
MessageBox "Idle 3 , 100"
set count to ( count + 1 )
elseif ( count == 7 )
AIWander 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0
MessageBox "Idle 4 , 100"
set count to ( count + 1 )
elseif ( count == 9 )
AIWander 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0
MessageBox "Idle 5 , 100"
set count to ( count + 1 )
elseif ( count == 11 )
AIWander 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0
MessageBox "Idle 6 , 100"
set count to ( count + 1 )
elseif ( count == 13 )
AIWander 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0
MessageBox "Idle 7 , 100"
set count to ( count + 1 )
elseif ( count == 15 )
AIWander 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0
MessageBox "Idle 8 , 100"
set count to ( count + 1 )
elseif ( count == 17 )
AIWander 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100
MessageBox "Idle 9 , 100"
set timer to 0
set count to ( count + 1 )
endif
End