
*+++++++++++++++++++*
*++ Toy 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 hours of fun! 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            21     (Get one from the CDN)     Toy      +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ Find more out on Classification at:                            +*
*+ http://www.creaturelabs.com/cdn/index.pl?articleid=15&style=0  +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*


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

inst

*++++++++++++++++++++++++++++++++++++++*
*+ This is the repeat script command, +*
*+ by using this and setting it to    +*
*+ 3 it will run the install script   +*
*+ 3 times making 3 balls!            +*
*++++++++++++++++++++++++++++++++++++++*

reps 3

*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ This classification is set to toy.                     +*
*+ it if you wish! This New: simp tells the game it's a   +*
*+ Simple agent. Later on I will cover compound!          +*
*+ For this tutorial we are using a set of sprites by me. +*
*+ 15 = the number of images used in the agent,           +*
*+ while 0 is the image number that the agent starts at   +*
*+ in the file. 850 is the plane.                         +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

new: simp 2 21 46005 "toytutorialMNB" 15 0 850

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ All the agent attributes where covered in the last tutorial +*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*++++++++++++++++++++++++++++++++++++++++++*
*+ Agent attributes                       +*
*++++++++++++++++++++++++++++++++++++++++++*
*+ 2   = Mouseable                        +*
*+ 4   = Activateable                     +*
*+ 64  = Suffer Collisions                +*
*+ 128 = Suffer Physics                   +*
*++++++++++++++++++++++++++++++++++++++++++*

attr 198

*++++++++++++++++++++++++++++++++++++++++++*
*+ Creature Permissions                   +*
*++++++++++++++++++++++++++++++++++++++++++*
*+ 1  = Activate 1                        +*
*+ 2  = Activate 2                        +*
*+ 8  = Hit                               +*
*+ 32 = Pick Up                           +*
*++++++++++++++++++++++++++++++++++++++++++*

bhvr 43

perm 60
accg 6
fric 70
elas 60


*+++++++++++++++++++++++++++++++++++++++++++++*
*+ This is the new script used for injecting +*
*+ agents into C3 as well as DS,due to the   +*
*+ different x and Y cooridnates!            +*
*+++++++++++++++++++++++++++++++++++++++++++++*

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

tick 1

*++++++++++++++++++++++++++++++++++++++++++++++++*
*+ This command ends the repeat script command. +*
*++++++++++++++++++++++++++++++++++++++++++++++++*

repe

endm

*+++++++++++++++++++++*
*+ Activate 1 Script +*
*+++++++++++++++++++++*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ The script is a bit longer then needed, but with the added in        +*
*+ features below it will give the ball that extra kick when activated! +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

scrp 2 21 46005 1
lock
*++++++++++++++++++++++++++++++++++++*
*+ Injects the norn with a Stimulus +*
*++++++++++++++++++++++++++++++++++++*
*+ 91 = Played with toy             +*
*++++++++++++++++++++++++++++++++++++*

stim writ from 97 1
lock

*+++++++++++++++++++++++++++++++++++++++*
*+ Do if the the activater is the hand +*
*+++++++++++++++++++++++++++++++++++++++*

doif from eq pntr

*+++++++++++++++++++++++++++++++++++++++*
*+ VA's are almost the same as OV's    +*
*+++++++++++++++++++++++++++++++++++++++*

setv va00 posl
setv va01 posr

*++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ Adds two numbers, in this case set by the va's +*
*++++++++++++++++++++++++++++++++++++++++++++++++++*

addv va00 va01

*+++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ Divides two numbers, in this case set by the va +*
*+++++++++++++++++++++++++++++++++++++++++++++++++++*

divv va00 2

targ pntr
setv va01 posl
targ ownr

*++++++++++++++++++++++++++++++++*
*+ Do if va01 is less then va00 +*
*++++++++++++++++++++++++++++++++*

doif va01 lt va00

setv va02 rand 15 25

*++++++++++++++++++++++++++++++++++++*
*+ else = If something else do this +*
*++++++++++++++++++++++++++++++++++++*

else
setv va02 rand -25 -15

*++++++++++++++++++++++++*
*+ Closes the last doif +*
*++++++++++++++++++++++++*

endi

*++++++++++++++++++++++++*
*+ Sets velicoity X     +*
*++++++++++++++++++++++++*

setv velx va02
setv vely -50
slow

*++++++++++++++++++++++++++++++++++++*
*+ else = If something else do this +*
*++++++++++++++++++++++++++++++++++++*

else

*+++++++++++++++++++++++++++++++++++++++++++++*
*+ ne = nether, and null = not agent pointer +*
*+++++++++++++++++++++++++++++++++++++++++++++*

doif from ne null
targ ownr

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ This next line changes the velocity of the ball, sending it off.+*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

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

*+++++++++++++++++++++*
*+ Activate 2 Script +*
*+++++++++++++++++++++*

scrp 2 21 46005 2
call 1 0 0
endm

*++++++++++++++*
*+ Hit Script +*
*++++++++++++++*

scrp 2 21 46005 3
call 1 0 0
endm

*++++++++++++++++++++*
*+ Collision Script +*
*++++++++++++++++++++*

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

*++++++++++++++++*
*+ Timer Script +*
*++++++++++++++++*

scrp 2 21 46005 9

*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
*+ This script is what stops the ball's animation when it is resting! +*
*+ Doif does if, and fall eg 0 means if the agent's not under the     +*
*+ infulence of gravity mean fall is equal to 0 then to stop it, or   +*
*+ carr ne null means or if the agent is being carried by a create or +*
*+ hand then to stop it also!                                         +*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

	doif fall eq 0 or carr ne null
		anim [0]
	endi
endm

*+++++++++++++++++*
*+ Remove Script +*
*+++++++++++++++++*

rscr
enum 2 21 46005
kill targ
next 
endm