It is amazing the amount of trouble you have to go to to get certain simple things done in these games, sometimes.
So, I wanted one of my companions to talk to me at random. Not that "play a sound while following" that Clover did to bitch incessantly in FO3; but rather I wanted the companion to come up to me at random, and start a semi-randomly chosen conversation -- essentially mimicking the sort of prattle a real person engages in when bored.
To get some actual randomness required considerably more code than I had expected. A random number is chosen when the NPC loads into the game world. If it matches one of three predetermined numbers, the topic is chosen, and values set to stop choosing new topics, and to start a timer. When the game is running normally, the timer is checked until it matches or exceeds the aforementioned random number's value in seconds; at which point a dialogue package is added to the NPC, who comes and initiates conversation with the player with the appropriate topic.
By doing it this way, we get random comments; but not appearing constantly, and appearing soon after changing cells, but not right after (making it all but impossible to predict when it will happen). In theory, I could set it to use a multiplier of the chosen number; to have conversation set to be initiated tens (or more) of minutes after the original topic decision is made by her script. Which I may do -- the timer is limited after all only by how creative I get with the formulas for determining how long it should run.
Well, alright: there is a character limit on the float values... but it's seven digits; which is a hell of a lot of seconds.
I wonder, some days: what would have happened, had I turned my mind to something in life that actually had a real purpose...?