lesson3.txt

txt file icon
Fact Value
Original File lesson3.txt
Game
  • Creatures 1
Creator
  • LummoxJR
Wiki Link Search "lesson3" on creatures.wiki
Tags
File Size: 6 KB

Description(Generated)

Text File Composite

::----- lesson3.txt -----::
COB Tutorial
Lesson 3: The training weed 

The training weed is our first attempt to create a more complex type of object. This object will be dropped in Albia (the player can pick it up), and made available to Norns. They can eat a fruit, which will later grow back.
The difference with this object is that it defines a script that says how the Norn will behave when eating it. This technique is used in many food objects, and so it's used here as well.

Step 1: Planning
I had considered making new sprites for this weed, but on second thought it's probably better to use a sprite already in the game. We'll use the sprites for the death cap mushroom. The first sprite in the file is a picture of the full weed. The second is a picture of the same weed with a mushroom plucked.
I'll use class 2 15 65 for the object. Family 2, genus 15 is the category for weeds, and I'm pretty sure there's not a species of 65 floating around out there somewhere.

Step 2: Installation
Okay, now I'm ready to start CobCom and edit the object. CobCom starts up with two list boxes displaying "". One of them is for scripts; another is for the installation routine, in the box marked "Installation Scripts" ("Imports" in CobCom 1.02 or earlier). Click on that.
Now, "" appears in the window beneath. This is the editing box, where you'll type in the installation script.

Click in the edit box. Go ahead and delete the line that appears there. Now type in the following:

inst
new: simp mush 2 0 3500 0
setv clas 34554112
setv attr 66
bhvr 0 1
mesg writ targ 8
edit

You've already seen a typical installation script, so let's go through the unusual lines here.

new: simp mush 2 0 3500 0
The new simple object created will use the mush.spr file its image, and it will only use two of the pictures in the file, starting with the first one (the 0 following the 2 stands for the first sprite in the file).

setv clas 34554112
Sets the object's class to 2 15 65.

setv attr 66
The user can pick up the object, but creatures can't. 67 is a normal value for items that creatures can pick up too.

mesg writ targ 8
The object will be initialized by calling script #7.

Now the object is set up. But what will we do with it?

 <...truncated>