×
Меню
Индекс

MSFD Following and Escorting

 
AiFollow, "Actor ID", duration_f_enum, x_f_enum, y_f_enum, z_f_enum, [reset]
 
AiFollowCell, "Actor ID", "Cell ID", duration_f_enum, x_f_enum, y_f_enum, z_f_enum, [reset]
 
Actor->AIFollow, "Mob2ID", 0, 0, 0, 0
 
The "Follow" AI-package makes an Actor closely follow another. You can use this to make an NPC or creature follow the player, but you can also use it to make NPCs and creatures form a caravan. The following excerpt from one of my own scripts shows the unconditional use of the function:
elseif ( state == 20 )
     HB_guar_pack_adros_->AIFollow, HB_adros_darani, 0, 0, 0, 0
     AITravel -8144, -19409, 728 ;new coords point 1
     set state to 30
 
Since there is no duration or destination location given, the guar will follow the NPC until another command is given. As with other AI-commands, make sure you set conditions so that each AIFollow command is issued only once, not every frame.
The duration, CellID and x, y, z destination coordinates set conditions that once fulfilled will terminate the AIPackage (which you can test with the GetAIPackageDone function as describe for AITravel above). The AiFollowCell function allows you to set an interior cell as the destination.
The meaning of the optional reset option is currently unknown.
 
AIEscort, "Actor ID", duration, x, y, z, [reset]
AIEscortCell, "Actor ID", "Cell ID", duration, x, y, z, [reset]
 
This function makes an Actor lead another actor or the player to a certain point. The Actor will wait for the follower if the distance becomes too great, and will resume its path when the follower approaches again (Thanks to Kir for this info). You see an example of this in character generation: the guard who escorts you up from the ship's hold to the ramp on the second level. (Thanks to MisterSmileyFaceDude).  The meaning or use of [reset] is unknown.