*++++++++++++++++++++++++++++++*
*++ Compound Vendor Tutorial ++*
*++++++++++++++++++++++++++++++*

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ This file is commented and can be just copied and pasted and    +*
*+ with a little tinkering can be used properly! So Lets get       +*
*+ started on this, and teach you how to make your norns something +*
*+ that will give them an end less supply of food and tpys! This   +*
*+ is a follow up to the last tutorials and so you should have     +*
*+ read them first!                                                +*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ Here is the break done of the different classifications +*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+Family      Genus         species              Object    +*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ 2            23     (Get one from the CDN)     Vendor   +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ Find more out on Classification at:                            +*
*+ http://www.creaturelabs.com/cdn/index.pl?articleid=15&style=0  +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*


*++++++++++++++++++*
*+ Install script +*
*++++++++++++++++++*

inst

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ Below you can see new: comp is used for this, and not new:simp, +*
*+ this is because our new vendor uses parts making it a compound  +*
*+ agent, where the new: simp agent are simple and can not use     +*
*+ parts.                                                          +*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

new: comp 2 23 46006 "comvendtutorialMNB" 5 0 3500

*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ This is a new part. It's like a new: command but it makes a new    +*
*+ agent upon the agent. there are different par: commands, like      +*
*+ pat: dull, and pat: fixd, we  will cover those later. Right now we +*
*+ are working with pat: butt which are buttons on the agent.         +*
*+ After the pat: butt command goes the buttons number, the the       +*
*+ sprite file it uses. After thats done you have a long set of       +*
*+ numbers to punch in, first is the buttons sprite frame number,     +*
*+ which on the base of the agent was 0 as you can see above, then    +*
*+ comes the number of images used. We then have the X and Y          +*
*+ corridnates where the button goes over top of the agent. The next  +*
*+ 0 is the plane, 0 = it is flat on the agent, and thing higher and  +*
*+ things might be able to pass between the two. The [0 1 255]        +*
*+ is the images animation when you lay the mouse over it. In this    +*
*+ case it flickers repeatedly till the mouse if no longer over top   +*
*+ of it. After that we have the message ID, which goes from 1000     +*
*+ and up. You will use these number when activating the buttons when +*
*+ clicked on. The last number is an option, set it two 0             +*
*+ for the mouse to hit anywhere in the bounding box, 1 to hit only   +*
*+ non-transparent pixels.                                            +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

pat: butt 1 "comvendtutorialMNB" 1 2 25 27 0 [0 1 255] 1000 0

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+This selects part 1 and gives it a resting animation of 0.       +*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

part 1
anim [0]

*+++++++++++++++*
*+ Read above. +*
*+++++++++++++++*

pat: butt 2 "comvendtutorialMNB" 3 2 79 25 0 [0 1 255] 1001 0
part 2
anim [0]


*++++++++++++++++++++++++++++*
*+ Covered in last tutorial +*
*++++++++++++++++++++++++++++*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ All the agent attributes where covered in the last tutorial +*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

attr 195
bhvr 0
accg 4
elas 30
fric 70
perm 60

setv va00 game "CreatorX"
setv va01 game "CreatorY"
doif va00 eq 0 and va01 eq 0
	setv va00 5687
	setv va01 3670
endi
mvsf va00 va01
endm

*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ This is the button 1's script, this is what happens when   +*
*+ clicked on, the id for button 1 was set to 1000 up when we +* 
*+ made the buttons.                                          +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

scrp 2 23 46006 1000

*++++++++++++++++++++++++++++*
*+ Covered in last tutorial +*
*++++++++++++++++++++++++++++*
	snde "beep"
	lock
	inst
	setv va00 posl
	addv va00 48
	setv va01 post
	addv va01 78
	new: simp 2 11 46005 "comvendtutorialMNB" 1 5 4500
	attr 195
	bhvr 48
	perm 60
	accg 4
	fric 100
	elas 40
	mvsf va00 va01
	emit 8 .5
	tick 1000
	slow
endm

scrp 2 23 46006 1001

*++++++++++++++++++++++++++++*
*+ Covered in last tutorial +*
*++++++++++++++++++++++++++++*
	snde "beep"
	lock
	inst
	setv va00 posl
	addv va00 133
	setv va01 post
	addv va01 50
	new: simp 2 21 46005 "comvendtutorialMNB" 15 6 850
	attr 198
	bhvr 43
	perm 60
	accg 6
	fric 70
	elas 60
	mvsf va00 va01
	velo rand 10 15 rand -10 5
	tick 1
	slow
endm


*++++++++++++++++*
*+ Food Scripts +*
*++++++++++++++++*
*++++++++++++++++++++++++++++++++*
*+ All covered in Last Tutorial +*
*++++++++++++++++++++++++++++++++*

scrp 2 11 46005 12
	lock
	snde "reat"
	stim writ from 79 1
	kill ownr
endm

scrp 2 11 46005 9
	kill ownr
endm

scrp 2 11 46005 6
	snde "dr10"
endm

*++++++++++++++++*
*+ Ball Scripts +*
*++++++++++++++++*
*++++++++++++++++++++++++++++++++*
*+ All covered in Last Tutorial +*
*++++++++++++++++++++++++++++++++*

scrp 2 21 46005 1
	lock
	stim writ from 97 1
	lock
	doif from eq pntr
		setv va00 posl
		setv va01 posr
		addv va00 va01
		divv va00 2
		targ pntr
		setv va01 posl
		targ ownr
		doif va01 lt va00
			setv va02 rand 15 25
		else
			setv va02 rand -25 -15
		endi
		setv velx va02
		setv vely -50
		slow
	else
		doif from ne null
			targ ownr
			velo rand -30 30 rand -20 -35
		endi
	endi
	anim [0 1 2 4 5 6 7 8 9 10 11 12 13 14 255]
	unlk
endm

scrp 2 21 46005 2
	call 1 0 0
endm

scrp 2 21 46005 3
	call 1 0 0
endm

scrp 2 21 46005 6
	lock
	snde "boun"
	anim [1 2 3 4 5 6 7 8 9 10 11 12 13 14]
	over
	unlk
endm

scrp 2 21 46005 9
	doif fall eq 0 or carr ne null
		anim [0]
	endi
endm

*++++++++++++++++++*
*+ Remove Scripts +*
*++++++++++++++++++*

rscr
enum 2 23 46006
	kill targ
next
enum 2 21 46005
	kill targ
next
enum 2 11 46005
	kill targ
next
endm