Jump to content


WeiDU: EXTEND/APPEND (adding flirts to Kelsey)


  • Please log in to reply
No replies to this topic

#1 -compton-

-compton-
  • Guest

Posted 02 April 2004 - 03:03 AM

The gang at BIS has been interested in expanding Kelsey's flirt capabilities, so I took them through a brief WeiDU tutorial, but I should share it here as well:


Here's how you would add a new flirt option in WeiDU:

1. Use NI or IDU or WeiDU to look up the state number of the top-level of the Kelsey flirt in J#KLSYJ. (don't use NI's main dialogue interface, because it counts from 1: use the "edit dialog" tab, NOT the "browse dialog" tab...or just subtract 1 if you DO use "browse dialogue.")
On my machine, that's J#KLSYJ state 191 for "Hi, lovely", the Active=2 flirt set.

2. If you want to add a new option to the top of the list, the WeiDU operation is EXTEND_TOP. Here's how the code would look:

EXTEND_TOP J#KLSYJ 191
IF ~~ THEN REPLY ~(Nibble Kelsey's ear)~ EXTERN J#KLSYJ nibble1
END

3. Now we need to create that "nibble1" state for Kelsey as well. The code for that is:

APPEND J#KLSYJ
IF ~~ THEN BEGIN nibble1
SAY ~(Kelsey cringes at first, then submits, rolling his head to the side and groaning softly.)~
IF ~~ THEN EXIT
END
END

(APPEND needs two ENDs)

4. So the code for your "kelseyflirtaddon.d" would be


EXTEND_TOP J#KLSYJ 191
IF ~~ THEN REPLY ~(Nibble Kelsey's ear)~ EXTERN J#KLSYJ nibble1
END

APPEND J#KLSYJ
IF ~~ THEN BEGIN nibble1
SAY ~(Kelsey cringes at first, then submits, rolling his head to the side and groaning softly.)~
IF ~~ THEN EXIT
END
END


That's it! Compile it, and you're golden.

5. Masterclass:

If you want to use the "random reaction" approach I used, you'd just have the random conditions in your EXTEND_TOPs, and you'd need to make extra APPEND states, of course.

EXTEND_TOP J#KLSYJ 191
IF ~RandomNum(4,1)~ THEN REPLY ~(Nibble Kelsey's ear)~ EXTERN J#KLSYJ nibble1
END

EXTEND_TOP J#KLSYJ 191
IF ~RandomNum(4,2)~ THEN REPLY ~(Nibble Kelsey's ear)~ EXTERN J#KLSYJ nibble2
END

EXTEND_TOP J#KLSYJ 191
IF ~RandomNum(4,3)~ THEN REPLY ~(Nibble Kelsey's ear)~ EXTERN J#KLSYJ nibble3
END

EXTEND_TOP J#KLSYJ 191
IF ~RandomNum(4,4)~ THEN REPLY ~(Nibble Kelsey's ear)~ EXTERN J#KLSYJ nibble4
END

And then APPEND nibble1, 2, 3, and 4.


WeiDU is at http://www.cs.berkel...u/~weimer/bgate and since it makes Kelsey possible, I highly recommend it to everyone.