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.
<<<     Static objects     >>>

The following chapters, concerning object programming, are the most complex ones of the egg-O-shOOter documentation. By giving you some examples I would like to explain you the options of object programming step by step.
Open the file 'themes.txt' of the backup directory 'MyKitchen' which you should have created during the backup process. Set the value GameTesting=1 and type in the actual date below the text mark [date] (e. g. 23.03.2009-12:00). That activates the possibillity to rescan the file 'themes.txt' whenever you press the 'N'-key while playing the game and selects our newly created theme whenever you start egg-O-shOOter.
Let's realise the examples using level 1. Search for the variable ObjectSpeedInfluence= at level 1 (using the search and find function of your text editor by clicking 'Edit -> Search'). At this line the definitions of the objects start. Be sure that you are really at level 1, which can be detected by the text markings '#1#' at different lines of 'themes.txt'.
Below the variable ObjectSpeedInfluence are some lines containing short informations about the object parameters. Go down to the line

#1#
ObjectNumber=1       #1#Wasser / Water

Here you can see the blocks of the objects of level 1. Delete the whole text beginning with the line

#1#
'ObjectNumber=2       #1#Wasserhahn auf / Spigot opened'

including the textblock

#1#
'ObjectNumber=158       #1#... / Phantom object turning point wing of odd bird crashed'

Alter the remaining text block as following:

#1#
ObjectNumber=1       #1#Fliege / Fly
ObjectFront=1
ObjectStartActive=1
ObjectTexture=11
ObjectF=-1
ObjectD=-1
ObjectSecMin=-1
ObjectSecMax=-1
ObjectConnect=-1
ObjectKoordPre=-1
ObjectHitDirection=0
ObjectXMin=0
ObjectXMax=0
ObjectYMin=0
ObjectYMax=0
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=3
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=

When starting egg-O-shOOter, you should see the housefly at the center of the screen.
All other objects like the spigot, the gas burners or the pot have disappeared. If not, be sure you have saved the file 'themes.txt' after changes made and press the 'N'-key to rescan this file.
If all objects disappeared including the fly, have a look at the text block of this fly line by line. The devil is in the details whenever you are programming computers. Have a closer look at ObjectActive=1 (=0 means the object is NOT activated at game start), ObjeceKoordPre=-1 (elsewise the fly tries to get coordinates of a not existing object and gets deactivated) and at ObjectDMin/Max=20 (elsewise the fly may be to tiny to be seen).
Screenshot egg-O-shOOter
You can see the fly? Great - so let's continue.
Play with the variables ObjecktXMin/Max und ObjectYMin/Max. Alter the values as shown below:

ObjectXMin=-400
ObjectXMax=+400
ObjectYMin=-160
ObjectYMax=+160

Save the file 'themes.txt' and press the 'N'-key while level 1 is running. Whenever you press the key, the fly appears at another place of the kitchen. Thereat the space of the appearance is a quadrat of the dimensions 800 x 320 in the egg-O-shOOter universe. You can read more about the coordinates of this universe here.
Now set the values without using a sign:

ObjectXMin=400
ObjectXMax=400
ObjectYMin=160
ObjectYMax=160

Press the 'N'-key again (save 'themes.txt' first). Now the fly appears always at one of the corners of the virtual quadrat. The variables are 'bidirectional', which means if the sign is missing at the Min AND Max value, a sign is 'diced' by the computer.
With the help of defining different min and max values, the course of the game alters whenever the fly appears. If you like to set a fixed value whenever the fly is initialized, use identical values for maximum and minimum. Type the values given below (WITH the signs):

ObjectXMin=-100
ObjectXMax=-100
ObjectYMin=-160
ObjectYMax=-160

and the fly always appears at the top of the cooker, which is a good idea, because the fly did not beat it's wings until now.
Try some different values for the variables ObjectDMin/Max to let the fly become smaller or bigger and for ObjectAMin/Max to alter the angle of rotation.
Now it is time to let the fly beat it's wings. Thereto we use time controlled alternation of the textures (=images). Replace the line ObjectTexture=11 to

ObjectTexture=11/100,12/100

and soon we are ready for take off. ObjectTexture assigns a special texture (=an image) to an object. The corresponding image files are stored at object011.bmp and object012.bmp. At the beginning of this chapter we used one image for displaying the fly and now we use two images alternating. The corresponding number of the wanted image (11) is followed by a slash and the number of milliseconds (100) to display this image. Separated by a comma, the second image (12) is listed and also separated by the slash the display time in milliseconds (100). When reaching the end (up to 20 different images can be used), the program starts at the beginning of the list.
Try some different display times to optimize the wing beat of the fly. When using ObjectTexture=11/70,12/30 the fly becomes more hectic.
<<<Back to sound          Continue with moving objects>>>