dupa

Author Topic: Pre/Post Process  (Read 2516 times)

onthecuttingedge2005

  • Guest
Pre/Post Process
« on: December 20, 2005, 09:29:45 pm »
Hi Rob.

Could you go into detail about the uses of:

Rem PLUGIN: PRE-PROCESS
And
Rem PLUGIN: POST-PROCESS

What can it be used for in all respect and some examples?

Jerry

GrantNZ

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Pre/Post Process
« Reply #1 on: December 21, 2005, 01:22:48 am »
Hi Jerry,

I'll give you my guesses, and maybe some of the other coders (or Rob) can confirm/deny my claims [:D]

PRE-PROCESS is available for any script you need done before Hal starts processing the user's input. The variable "InputString" will have exactly the user's input, without any capitalisation, pronoun reversal, punctuation stripping, sentence tags, and other things Hal does. Hal won't have even begun to think of responses.

This could be useful if you need that original text. For example, you might invent some commands (e.g. debugging commands, or something else!) that you need to process - and this also gives you a chance to strip them out of the input before Hal thinks they're part of the conversation!

There's all sorts of other things that can go here. It's around this location that some of my emotion drifting code goes for my emotions project.

POST-PROCESS allows you to perform any final tasks before Hal gives his response. By the time POST-PROCESS is reached, Hal has finished thinking, has finalised his responses, and is just about to give them to the user.

Again there's lots of different things to do here. For example, I've invented tags like "<HAPPY>" which Hal can put into his responses. In the POST-PROCESS part of code, I search for these tags, use them to play animation files, and strip them out of Hal's response. This would also be a good place to do debut output, or some final calculation of variables - whatever you need.

Hope this helps!
Grant
 

onthecuttingedge2005

  • Guest
Pre/Post Process
« Reply #2 on: December 21, 2005, 03:29:51 am »
Thanks GrantNZ.

Very detailed information indeed.

Jerry[8D]