Get Random Delay
TheTinman
Member Posts: 74
Can different actions be assigned to each number between the minimum and maximum numbers?
float GetRandomDelay(float fMinimumTime = 0.4,float fMaximumTime = 1.1);
0
Comments
Then you use the value output by this function in a "switch-case" command in order to select a different action for each number. (The one thing I'm not sure about in the function is whether or not the math allows every number from iMinVal to iMaxVal to appear, or if one of the extremes is excluded from the range)
GetRandomDelay() returns a single float value between those numbers and you won't know what it is, other than it's in that range.
In a cutscene where I have several NPCs speaking to each other, I use DelayCommand() to time their speaking parts, movements, and facing - all using DelayCommand(float,AssignCommand()). You could easily throw in DelayCommand(GetRandomDelay(),AssignCommand()).
Hopefully that helps.