German Version















With the compound parts you make automats for example.
The purpose of a compound part is that you can add additional parts to the agent. You can choose between buttons which will trigger an event if you press them, texts and animations.
All compound parts are created with the command NEW: COMP and with the command PAT: you can add parts. By creating the compount part NEW: COMP is named as part 0 so you start the other parts with 1.
The parts of a compound part doesn't have to use the same Sprite-file. They are simple objects so they have attributes, behaviour, etc.
Parts were removed with teh command PAT: KILL.
DULL parts

At first I explain the usage of DULL parts.
DULL parts are used to create areas on an object which can be animated enduringly.
The sprite-file is adopted completely from the medicine-machine.
I first tried it with some own images but it doesn't work. Paradoxically, the medicine-machine sprite-file functioned right away and I still don't know why.
Below is the cos-file with the explanations. I only explain new commands. The others you can find in the Honeypot Tutorial
While you read the tutorial it's in your interest to open the sprite-file so you can look which image is meant and which animations take place. Thus it is easier to understand everything (I speak from my own personal experience).

inst
new: comp 2 21 20403 "medm" 23 0 5000
pat: dull 1 "medm" 1 57 71 0
pat: dull 2 "medm" 4 0 35 0
pat: dull 3 "medm" 10 9 38 0
attr 199
clac 0
elas 0
fric 100
perm 60
accg 5
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

scrp 2 21 20403 1
part 1
anim [0 1 255]
clac 1
endm

scrp 2 21 20403 2
part 2
anim [0 1 2 3 4 5 4 3 2 1 255]
clac 2
endm

scrp 2 21 20403 0
part 3
anim [0 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 255]
clac 3
endm

scrp 2 21 20403 3
part 1
pose 0
part 2
pose 0
part 3
pose 0
clac 0
endm

rscr
enum 2 21 20403
kill targ
next
scrx 2 21 20403 1
scrx 2 21 20403 2
scrx 2 21 20403 0
scrx 2 21 20403 3

new: comp 2 21 20403 "medm" 23 0 5000
Installs the agent. As above mentioned the agent isn't a simple agent (simp) but a compound part. So after the new command follows comp. Next there are family- genus- and scriptnumber, the sprite_file and image_count, first_image, plane.

pat: dull 1 "medm" 1 57 71 0
This is the first DULL part. It's a red button which outputs medicine bottles originally.
To add DULL part to an agent, following data is important:
pat: DULL, DULL_number, sprite_file, first_image, relative x-coordinate on the agent with respect to the coordinates of part 0, relative y-coordinate on the agent with respect to the coordinates of part 0, relative plane with respect to the plane of part 0.
Our first DULL part uses the images starting from 1 (second image in the sprite-file), has the coordinates (57, 71) and the relative plane 0 with respect to the plane of part 0.
What relative plane 0 with respect to the plane of part 0 means, I don't know. I always use 0 and it works.

pat: dull 2 "medm" 4 0 35 0
This DULL part is the joist which shows how much energy the medicine- machine has for its usage. The part has the same conditions as DULL part number 1.
It uses the images of the sprite-file beginning with number 4 and has the coordinates (0, 35).

pat: dull 3 "medm" 10 9 38 0
This DULL part is the area in which the medicine bottles appear. It has the same conditions as DULL part number 1 and uses the images of the sprite-file beginning with number 10. Its coordinates are (9, 38).

clac 0
This command will cause a Activate 1 Event if you click the next time on the agent. You can specify what happens in this event by editing scrp family, genus, scriptnumber, 1 (more about this see below, the command is explained).

scrp 2 21 20403 1
This is the Activate 1 Event. It will invoke if you click the first time on the agent.

part 1
With part number you declare which part you will use. In this case it's the first DULL part (the red button).

anim [0 1 255]
With the command anim a part will be animated. In the bracket you declare which images will be shown one after another.
If you animate parts, image 0 is always that image that you specified as first_image in the command pat: DULL.
You can start a loop with 255. The anim command will be executed over and over again.
At this concrete case:
Image 0 is the second imaage in the sprite-file (button off) and image 1 is the third one (button on). Look at the sprite-file than you know what I mean. Both images were iterated over and over so that the button blinks perpetually.
I don't explain the other anim commands because with this explanation you understand the others. Another help is to look at the agent in the game. So you can find out what the agent does after which click.

clac 1
This command will cause a Activate 2 Event if you click the next time on the agent.


Summarization Activate 1 Event:
The red button will be selected and will be animted in a loop. You declare with the command clac 1 that by the next click another event will be invoked. If you left out clac 1 only the red button would be animated and other parts would have no use.


scrp 2 21 20403 2
This is the Activate 2 Event.

part 2
The DULL part with the number 2 (the energy display) will be elected.

clac 2
This command will cause a Deactivate Event if you click the next time on the agent.


Summarization Activate 2 Event:
The energy display will be elected and will be animatd in a loop. You declare with the command clac 2 that by the next click another event will be invoked.


scrp 2 21 20403 0
The Deactivate Event. Don't be confused by the name. It doesn't mean that this event will deactivate the agent. The event can do everything what you want it to do.

part 3
The DULL part with the number 3 (area in which the medicine bottles will appear) will be elected.

clac 3
This command will cause a Hit Event if you click the next time on the agent.


Summarization Deactivate Event:
The area in which the medicine bottles appear wil be elected and will be animated in a loop.


scrp 2 21 20403 3
The Hit Event


pose 0
With this command the selected part (you always have to specify which part you mean with part number) will be restored in image position 0.


Summarization Hit Event:
One after another all parts were selected and be restored in image position 0. This has the effect that all animations will stop and the agent will look like at the beginning.
At the end, there's the command clac 0 which we've seen in the installationscript. With this command the next click on the agent will cause a Activate 1 Event and everything starts again.


rscr
The Uninstall Skript. I've explained it in the honeypot tutorial.

Important to know is that you always have to specify on which part you refer to (part number) if you use a animate command (here it was anim an pose).
To animate a part has no effect on other parts.

With the coordinates of the DULL parts I first had some problems. Best you use a graphic program (I use Paint Shop Pro 5) and go with the mouse over the image. In Paint Shop Pro the coordinates will be shown downright. I think every graphic program has this function.
The coordinates for the DULL part begin in the upleft corner.
In the sprite-file are also black pictures in the size of the parts. These are at every DULL part image number 0 because black will be shown transparent in the game.
Medicine Machine

Here's the medicine-machine which I explained above.

Download
Up Last Update on this site: 14.09.2003