@Carl2
Thanks for the links... I'll check'em out.
On your question about if the brain is accessed before you enter anything... I either don't know or have forgotten... it's been a while. I do remember, in the brain, that I had to move the "PLUGIN: PLUGINAREA2" to just under the "Function UltraHal()" that is at the top of the brain and I had to make my ja1basescript.uhp" plugin number 2 to make things work they way I wanted and I also remember that I had to come up with a "skip" routine in my script because the brain does 3 passes for each input and on my special commands inputs I needed it to be 1 pass, so my skip routine allows the first pass and skips 2 and 3. Like I said, it's been a while but it seems like the rest was pretty easy... in the script you check for certain input and if found you execute a HapTek command, you can even put in a random factor so if you have a trigger word like "smile", the character will randomly react to it. I made most of my triggers something I would not normally type, such as "chghair" changes to the next hair in the list of hair available... that is so I can manually tell the character to change hair when I want it done for sure... but you could also have a trigger for hair with a percentage of randomness and based on key words running the routine such as an occurrence of the words hair and change in the same sentence but also based on conditions, time, day time since last change, etc, mixed in with the trigger. You can even set vars to keep track of what is current so if you ask your character, "what color is your hair", they will actually answer you with the current color of hair they have. You could really make it quite complicated if you want. Here's a snip from my script showing the manual hair change command "chghair"...
'chghair---------------------------------------------------------------------
If InStr(ja1_InputString, "chghair") <> 0 Then
'MsgBox "ja1_InputString = -" & ja1_InputString & "-"
ja1_file = ""
If ja1_current_hair = "" Then
ja1_current_hair = HalBrain.TopicSearch("current_hair", "ja1_vars")
End If
If ja1_current_hair = "acc_Hair_06_Shag_BlackBlue" Then
ja1_file = "acc_Hair_06_Shag_BlondeStrawberry"
HalCommands = HalCommands & "<HAPFILE>" & ja1_pathAccessories & ja1_file & ".hap" & "</HAPFILE>"
End If
If ja1_current_hair = "acc_Hair_06_Shag_BlondeStrawberry" Then
ja1_file = "acc_Hair_06_Shag_OrangeFlame"
HalCommands = HalCommands & "<HAPFILE>" & ja1_pathAccessories & ja1_file & ".hap" & "</HAPFILE>"
End If
If ja1_current_hair = "acc_Hair_06_Shag_OrangeFlame" Then
ja1_file = "acc_Hair_06_Shag_Brown"
HalCommands = HalCommands & "<HAPFILE>" & ja1_pathAccessories & ja1_file & ".hap" & "</HAPFILE>"
End If
If ja1_current_hair = "acc_Hair_06_Shag_Brown" Then
ja1_file = "acc_Hair_06_Shag_DrkBrown"
HalCommands = HalCommands & "<HAPFILE>" & ja1_pathAccessories & ja1_file & ".hap" & "</HAPFILE>"
End If
If ja1_current_hair = "acc_Hair_06_Shag_DrkBrown" Then
ja1_file = "acc_Hair_06_Shag_BlackBlue"
HalCommands = HalCommands & "<HAPFILE>" & ja1_pathAccessories & ja1_file & ".hap" & "</HAPFILE>"
End If
'save current hair to database
HalBrain.ReadOnlyMode = false
HalBrain.RunQuery "UPDATE ja1_vars SET topic = """ & ja1_file & """ WHERE searchString = 'current_hair'", ja1_tempVal
'send command to UltraHal
UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)
'--------------------