Mod:Creation Kit/Range (Procedure)

{{Procedures
 * Name=Range
 * Description=The Range Procedure makes the actor try to "range" out ahead (and somewhat to the side) of another actor (henceforth referred to as the "leader"). If the leader is stationary, the ranging actor will wander and idle around the leader.

Also, if multiple actors are ranging with the same leader, they will automatically fall into a double-file line formation. (See below for more info.)


 * Completes=Procedure does not end unless conditionalized out, or paired with a procedure that ends in a simultaneous branch.


 * Param1=MinDistance
 * Type1=Float
 * Desc1=Minimum distance actor wants to be out in front of the "leader." (Using negative values for this and MaxDistance will make the actor follow behind the leader instead of out in front.)


 * Param2=MaxDistance
 * Type2=Float
 * Desc2=Maximum distance actor wants to be from the "leader." (Using negative values for this and MinDistance will make the actor follow behind the leader instead of out in front.)


 * Param3=MaxRadius
 * Type3=Float
 * Desc3=The maximum acceptable distance from the ranging point.


 * Param4=Offset
 * Type4=Float
 * Desc4=The left/right distance that the actor wishes to be from whomever it is escorting.


 * Param5=Meander
 * Type5=Boolean
 * Desc5=Whether or not to meander, which bends the ranging path into a serpentine shape.


 * Param6=MeanderAmpMin
 * Type6=Float
 * Desc6=Minimum distance to meander from center of ranging path, when at a maximum. (This and the next value define the amplitude of the sinusoid wave that modulates the ranging path when "Meander" is true.)


 * Param7=MeanderAmpMax
 * Type7=Float
 * Desc7=Maximum distance to meander from center of ranging path, when at a maximum.


 * Param8=MeanderWavelengthMin
 * Type8=Float
 * Desc8=Minimum distance between crests of the meander. (This and the next value define the wavelength of the sinusoid wave that modulates the ranging path when meander? is on.)


 * Param9=MeanderWavelengthMax
 * Type9=Float
 * Desc9=Max distance between crests of the meander.
 * Param10=IdleWanderMinRadius
 * Type10=Float
 * Desc10=When the leader is stationary, wander/idle at random points that are at least this far away from them.


 * Param11=IdleWanderMaxRadius
 * Type11=Float
 * Desc11=When the leader is stationary, wander/idle at random points that are no farther away from them than this.


 * Param12=Leader
 * Type12=Target
 * Desc12=Specifies the "leader" (the actor in front of whom we are ranging). If not specified, the default is the player.


 * Param13=IdleWhenLeaderStops
 * Type13=Boolean
 * Desc13=Controls what happens when the leader remains motionless. If true, switch from ranging to idling around the leader.  (If false, stay at ranging point.)


 * Param14=FormationGroup
 * Type14=Int
 * Desc14=Controls "marching order" for actors following the same leader. Can be any integer.  List of followers will be sorted by this, (low-in-front to high-in-back; equals ordered arbitrarily), then arranged into double-file (one straggler per group, if an odd number).


 * Param15=FormationRowSpacing
 * Type15=Float
 * Desc15=When walking in a formation, specifies the space between this actor and the row in front of it.


 * Notes=
 * What if the leader dies, or is dead?
 * The procedure should be considered invalid, and will not run.
 * Is there some "sweet spot" that the ranging actor looks for?
 * Yes, the "sweet spot" is a point on the navmesh that is as near as possible to the point that is:
 * MinDistance ahead of a walking leader, MaxDistance ahead of a running leader, or somewhere in between, if the leader's speed is in between.
 * Offset to the left or right of the leader(based on whichever side of the leader they're already on).
 * Does the ranging actor try to move at the same speed as the leader? Do they begin running to the "sweet spot" point if they're too far away?
 * Yes on both counts.
 * Is the calculated distance between ranging actor and leader a raw GetDistance check, or some sort of distance derived from pathing between the two? (i.e. Will the ranging actor be ok if the target is just on the other side of a wall?)
 * It is using an actual pathing-distance check from the ranging actor to the leader.
 * That automatic double-file line formation sounds nifty. How does that work?
 * If multiple actors run a Range procedure targeting the same leader, they will form a double-file line automatically.
 * Their "Offset" parameter will specify how far left/right of center to be.
 * The gamesetting fAIRangeLineFormationSpacing will determine how far apart each row of two actors will be.
 * Can I get the actor to follow behind the leader instead of out in front? (I like the side offset, meander, auto-idle-wander and/or double-file features, which aren't in the Follow procedure).
 * Yes, this is easy: just use negative values for the MinDistance and MaxDistance parameters.

Relevant Gamesettings
}}
 * fAIRangeLineFormationSpacing : In a double-file line formation, determines how far apart each row of two actors will be.