S
t
a
r
t
Diary
Diary
Download egg-O-shOOter
Download
How to create your own egg-O-shOOter ?
Insight
Frequently asked questions
Questions?
egg-O-shOOter Food
Food
Links
Links
I
m
p
r
i
n
t
Klick hier für die deutschsprachige Version.

At this column you can learn to create your own egg-O-shOOter.
<<<     What happens if     >>>

The housefly is flying and we can push it around the kitchen, but how can a hit trigger an event and so affect other objects?
Let's define a second object first. Copy the block of object number 1 and paste it below. Alter ObjectNumber to the value 2 (so that we really have a second object) and set ObjectStartActive to 0 (so that this object will appear later). Set ObjectVX/YMin/Max and ObjectMovePointing to 0. Therewith the second block should look like this:

#1#
ObjectNumber=2       #1#Fliege nach Treffer / Fly being hit
ObjectFront=1
ObjectStartActive=0
ObjectTexture=11/70,12/20
ObjectF=-1
ObjectD=-1
ObjectSecMin=-1
ObjectSecMax=-1
ObjectConnect=-1
ObjectKoordPre=-1
ObjectHitDirection=0
ObjectXMin=-100
ObjectXMax=-100
ObjectYMin=-160
ObjectYMax=-160
ObjectDMin=20
ObjectDMax=20
ObjectAMin=0
ObjectAMax=0
ObjectVXMin=0
ObjectVXMax=0
ObjectVYMin=0
ObjectVYMax=0
ObjectVRotMin=0
ObjectVRotMax=0
ObjectRotAxis=3
ObjectVGrowMin=0
ObjectVGrowMax=0
ObjectGravMin=0
ObjectGravMax=0
ObjectMoveXMin=-800
ObjectMoveXMax=+800
ObjectMoveYMin=-200
ObjectMoveYMax=+200
ObjectMoveAMin=-360
ObjectMoveAMax=+360
ObjectMoveRMin=1
ObjectMoveRMax=1000
ObjectMoveType=3
ObjectType=1
ObjectBenefitMin=*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0
ObjectBenefitMax=*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0,*0
ObjectMirror=0
ObjectMovePointing=0
ObjectHitSound=
ObjectAppearSound=
ObjectHitTextEnglish=
ObjectHitTextGerman=

You can activate this second fly as soon as you hit fly number 1. This 'What happens if' construct is realized with the help of 'ObjectF' and 'ObjectD'. At ObjectD all Objects being DEactivated and at ObjectF all objects being activated are listed. Besides the event 'Hit', there are the events 'Range' and 'Time'. Let's have a look at the hit-event first. Objects being activated or deactivated during a 'hit'-event must have the character 'H' in front. We want to deactivate fly number 1 and activate fly number 2. So we have to set the variables of fly number 1 (!):

ObjectF=H2
ObjectD=H1

Try to hit the fly and observe what is happening.
Like planned, fly number 1 disappears and fly number 2 appears at the scene. The coordinates ObjectXMin/Max and ObjectYMin/Max of fly number 2 are identical to those of fly number 1 and so fly number 2 appears always at the top of the cooker wherever in the kitchen you hit fly number 1.
It was more realistic if fly number 2 would appear at the position of fly number 1. To achieve this we use the variable ObjectKoordPre, wherewith it is configured of which object the coordinates should be assumed. Fly number 2 should assume the actual coordinates of fly number 1 and so you have to set ObjectKoordPre=1 of fly number 2 (!).
Try to hit the fly again (don't forget to save 'themes.txt' and press 'N') and look what happens.
Apparently not what we expected! By setting ObjectKoordPre you configure from which object the coordinates should be assumed. The next step is to configure which variables should be assumed in which way. Egg-O-shOOter offers you different possibilities:
The underscore (_) indicates that the variables should be assumed without any modifications from the object given at ObjectKoordPre. If no ACTIVE object is found, the variable will be initialized by the values given at the right of the underscore (e. g. at game start).
The equal (=) means that the coordinates of the object given at ObejctKoordPre are ignored and the variable is newly initialized.
The 'greater than' (>) determines that the values are added to the coordinates of the object given at ObjectKoordPre.
The asterisk (*) determines that the values are multiplied with the coordinates of the given object.
You can use three of the given offers to achieve the wanted behavior. Use the underscore to ignore the values on the right of the underscore, or the greater than to add the value 0 or use the asterisk to multiply with the factor 1.
Useless is the equal, which ignores the coordinates of ObjectKoordPre.
Alter the lines with the X- and Y-coordinates of fly 2 (!) as followed:

ObjectXMin>-100
ObjectXMax>-100
ObjectYMin>-160
ObjectYMax>-160

Don't shoot immediately at the fly. Let it ascend for a while to see what's happening. Screenshot egg-O-shOOter
If you hit the fly, the second fly appears at the left below fly number 1 - why? Well, fly number 2 assumes the coordinates of fly number 1 and the values of ObjectXMin/Max and ObjectYMin/Max are added!
That gives you the chance to let following objects appear at a given distance to the parent object. Because of the fact that this isn't wanted here, you have to set those variables of fly number 2 (!) to zero.

ObjectXMin>0
ObjectXMax>0
ObjectYMin>0
ObjectYMax>0

If you set

ObjectAMin>0
ObjectAMax>0

and

ObjectMirror>0

the second fly also assumes the angle of rotation and the condition 'mirrored' of the parent fly.
Now fly number 2 appears at the position of the deactivated fly number 1 and stands still.
That doesn't look very realistic.
Set ObjectGravMin/Max to +20 (note the sign, it's 'bidirectional'!). That with you define gravitation pointing downwards. if you hit the fly, it stops and starts falling down. That is not realistic, but looks fine (like in a comic). But oops - what is happening down below? The fly bounces like a rubber ball and ascends again. That should be corrected. Alter the value of ObjectMoveType from 3 to 5. I am talking about fly number 2 (!) - number 1 is already deactivated. ObjectMoveType=3 caused fly number 2 to move inside the borders given by ObjectMoveXMin/Max and ObjectMoveYMin/Max. The value 5 commands the object to stop as soon as the area is left. Set ObjectMoveYMin=-150 and you will see that the fly stops short before reaching the upper edge of the bottom frame.
Try to alter ObjectVRotMin/Max, to let the fly rotate while moving downwards.
If you prefer a more realistic behavior, set the variables of fly number 2 (!) like down below:

ObjectVXMin_0
ObjectVXMax_0
ObjectVYMin_0
ObjectVYMax_0

Thatwith fly number 2 assumes the speed values of fly number 1 and the gravitation starts accelerating the fly downwards following a trajectory parabola. If you set ObjectHitDirection=0 at fly number 1 (!), the fly won't be deflected by the pea any longer.
By creating a new graphic of a hit fly and assuming this texture to fly number 2, you could complete this example - try it.
<<<Back to moving objects          Continue with range steering>>>