Thursday, September 16, 2010

Chocolaty Addendum.

So in the tutorial I released, I had the reader make a very basic vendor that did only as much as getting the job done.  But there are a lot of little things, finishing touches, if you will, that could still be done!

Here’s a quick list of them with code examples.

  • Drop sounds.  That nice “thud” that comes from dropping an agent.

      scrp 2 23 9000 6
          lock
          sndc "drop"
          wait 5
      endm

      scrp 2 11 9000 6
          lock
          sndc "dr10"
          wait 5
      endm

  • Different chemicals from eating the bar. Fat, sugar.

      scrp 2 11 9000 12
          stim writ from 79 1
          sndc "chwp"
          doif pose eq 0
              pose 1
          elif pose eq
      1
              kill ownr
          endi

      targ from

      chem 10 .25
      chem
      3 .25

      endm

  • A stimulus for “pushing” the vendor, to encourage Norns to do it, placed in the Activate 1 script.

    • stim writ from 90 1
  • And I also didn’t go over Commenting.  Anything you put after a * sign is a comment. So for instance, you can say:

    • *inject .25 fat
      chem 10 .25
      *inject .25 sugar
      chem 3 .25

It can be very helpful in organizing your script. :)

Hopefully you all can use these things. :)  If you ever don’t understand something, just try looking it up in the CAOS Documentation, and if you still don’t get it, ask about it here or here.

3 comments:

  1. Thanks for this tutorial, it was a big help and the push I needed to get into creatures development. You do great work and it is greatly appreciated

    ReplyDelete
  2. Are you going to post the vendor?

    ReplyDelete
  3. How would you go about making it a 'smart' vendor, not vending more items if there are already lots of bars of chocolate on the floor going uneaten?

    ReplyDelete