******

This forum is currently in read-only mode.
0 favourites
  • After reading

    I suddenly realize that there are people who are *more a starter* then i am.

    I still consider myself a absolute beginner.

    And stated this, i can be legally present in my own topic.

    Next month i will try to expose what i learned. (and learn more English, so wishfull).

    I dont know if i can keep feeding this post, but i sure will try.

    I hope to help new people.

    So please, new readers, make an account to the forums,

    and let me know if i am doing a little ok or not.

    And do not be shy with using bad English, as you see mine is beneath any level anyway.

    Also, please do the "ghost shooter" tutorial. All the basics are nicely explained in the tutorial.

    OK.

    Lets start with .................

    Nothing at all.

    Open up construct.

    When Construct brings up its user interface, there is totally nothing we can do.

    First we have to tell it the kind of program that we are going to *construct*.

    Click top menu "file" / "new" / "new direct-X game".

    <img src="http://usera.imagecave.com/j0h/construct/01_new.jpg">

    The first thing you notice is a white canvas. Later we will place objects on this canvas.

    The canvas + objects + layers together make up a "Layout".

    The *user interface* that you are looking at now is the "Layout Editor".

    I not gonna start with explaining the "Layout Editor".

    There is so much more that i want to tell you first.

    Notice this on the left bottom:

    <img src="http://usera.imagecave.com/j0h/construct/02_editors.jpg">

    As you see there is a TAB for the "Layout Editor".

    And another TAB for the "Event Sheet Editor"

    Click on the TAB "Event Sheet Editor".

    And again you look at an empty white square.

    On top it states "Right Click to begin"

    And that is exactly where my next post will start.

    Simply stated you can say:

    In the "Layout editor" we will place objects.

    In the "Event Sheet Editor" we will make the objects do things.

    (that statement is not 100% correct, but for now it will do)

  • To continue.

    You might think. We did not add anything so far. Everything is empty.

    This is not really true.

    Lets discover 2 important things in 1 click.

    How to add an event and the system object.

    Right click anywhere in the empty event sheet editor.

    A context menu will pop up.

    <img src="http://usera.imagecave.com/j0h/construct/03_add.jpg">

    Choose "insert event".

    And the "events wizard" will show up.

    <img src="http://usera.imagecave.com/j0h/construct/04_sys.jpg">

    The events wizard will guide you in building complicated events with just a few clicks of the mouse.

    It will do this in steps.

    In the first step the wizard will always show a list with available objects and order you to choose one.

    At this moment there is only 1 object available.

    The system object.

    It is a very important object since it handles system related events.

    Select "system" and the "next" button will not longer be ghosted.

    Clicking "next" will take you to the next step.

    <img src="http://usera.imagecave.com/j0h/construct/05_next.jpg">

    In this step the wizard will list up all "conditions" for the chosen object, and it orders you to choose one.

    Play around some.

    Double click a condition to bring its window up (basically the next step).

    Look at the windows.

    Click back to look at another condition.

    But do not click "finish" yet.

    Now lets point out a very important something when you are done playing.

    As you can see there are two sorts of events.

    Those that ask you again for an object to pick.

    And those that dont.

    <img src="http://usera.imagecave.com/j0h/construct/09_difference.jpg">

    Those that dont pick objects i will later refer to as "Flow events"

    Those that do pick objects i will later refer to as "Pick events"

    Notice also the bottom part of each window. The real power of construct lays in there.

    Here you find the guide to construct "Expressions".

    But that is not for this post.

    <img src="http://usera.imagecave.com/j0h/construct/10_expressions.jpg">

    At this point, you can not make a "Pick event", because we did not add any object to pick yet.

    So lets make a "Flow event" to complete this *tutorial* (if this is a tutorial for you)

    Click "back" till you are back on the wizard asking you to pick a condition.

    <img src="http://usera.imagecave.com/j0h/construct/05_next.jpg">

    Scroll till you find "Every X milliseconds"

    <img src="http://usera.imagecave.com/j0h/construct/06_every.jpg">

    Double click it to take the wizard to the next step.

    <img src="http://usera.imagecave.com/j0h/construct/07_1000.jpg">

    Keep the 1000 for now. (1000 = 1 second). Click finish, to finish and exit the wizard.

    You successfully added an "event" to the "events sheet".

    <img src="http://usera.imagecave.com/j0h/construct/08_result.jpg">

    This event will run its actions every 1 second. But actions are for later.

    First lets talk some more about events, conditions and sub-events.

    And thats for the next post.

    To resume about the events wizard.

    Every event always starts from an object.

    Thats why the wizard in its first step presents you a list with the available objects.

    In the second step the wizard will ask you to choose a condition.

    In the 3th step the wizard presents you the options for that condition.

    And it is here that you find the difference between a "flow event" and a "pick event"

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • To share info with each other, we need a language.

    A language is in base using the things by there names, and agreeing its named that way.

    So lets name a few things, so we can talk about them.

    In the last post we ended up here:

    <img src="http://usera.imagecave.com/j0h/construct/08_result.jpg">

    Now imagine you have a few hundreds of those lines,

    and there will be a noticeable vertical line.

    <img src="http://usera.imagecave.com/j0h/construct/11_ea.jpg">

    Everything on the left are Events.

    Everything on the right are Actions.

    <img src="http://usera.imagecave.com/j0h/construct/12_ea2.jpg">

    Events are build with Conditions. Each new line in an event is a Condition.

    Every event can have sub-events.

    A sub event is also build with conditions.

    An event and its sub events make up a "block of events" or a tree

    <img src="http://usera.imagecave.com/j0h/construct/13_tree.jpg">

    All together now in one illustration.

    <img src="http://usera.imagecave.com/j0h/construct/14_sum.jpg">

  • Was it Newton who said something like "give me an immovable point in space and i can lift earth up" ?

    Or.

    Tell me where to click, and i can move everything around.

    Yes sir, constructs events editor is very flexible. Its not really consistent yet. But flexible it is.

    You have to know where to click.

    Lets start over, and now to some point without illustrations.

    Fire up Construct.

    Make a new direct X game.

    Bring yourself to the events sheet editor.

    Add a new event. (bring up the events wizard)

    Base object is the system object.

    Choose the condition " for "

    and as options fill in this, exactly as shown.

    <img src="http://usera.imagecave.com/j0h/construct/15_for.jpg">

    Click "finish" and the events sheet will look like this:

    <img src="http://usera.imagecave.com/j0h/construct/16_result.jpg">

    That is 1 event build with 1 condition.

    Now how do we select the event ? and how to we select the condition ?

    Lets define just for this moment two spots. The E-spot and the C-spot. No there is no G.

    The E-spot.

    <img src="http://usera.imagecave.com/j0h/construct/17_select_event.jpg">

    Clicking on that place will select the event. And you will notice the yellow color to indicate so.

    The C-spot

    <img src="http://usera.imagecave.com/j0h/construct/18_select_cond.jpg">

    Clicking on that position will select the Condition indicated by a different yellow color.

    Now lets make a subevent.

    Right click the E-spot. Choose "insert sub-event".

    The event wizard pops up.

    Add a system object event "always"

    The result will be like this:

    <img src="http://usera.imagecave.com/j0h/construct/19_result.jpg">

    Copy An event.

    Click on the E-spot of the event, to select the event. U will notice that the whole event tree gets selected.

    Press CTRL+c to copy.

    Press CTRL+v to paste.

    Now you have 2 events.

    Another convenient way to copy an event is this way :

    press de CTRL key.

    left click on the E-spot, do not release the mouse

    drag de event up or down

    a black line will show where in the tree the event will be copied

    Copy a Condition ?

    All the same, just click the C-spot to select the condition.

    and copy past, or CTRL + drag the condition where you want it to be copied.

    Of course this E-spot and C-spot thing i only made up to show you where to click to select different things.

    They do not really exist.

    Delete an condition ?

    Click the C-spot of the condition, end press the "DEL" button on your keyboard.

    Or right click the C-spot, and choose delete condition from the contextual menu.

    You will notice there is also "delete event". Yes an condition is part of an event.

    Delete an event ?

    Its all the same, just select on the E-spot.

    But watch it !!!

    WARNING !

    Deleting an event will delete its whole tree,

    including all actions and sub events.

    If you dont want the sub-events to be deleted, then you first have to move them out of the tree.

    Move an event ?

    Click the E-spot and drag it around. A black line will show the position in the tree where the event will end up.

    Move a condition ?

    Click the C-spot and drag the condition around.

    EDIT an event ?

    If you Right click the E-spot, there will be no edit event entry.

    That of course makes sense.

    Edit a condition ?

    Or double click the condition on its C-spot, this will bring up the events wizard to change the event.

    Or right its C-spot to choose "edit condition" from the contextual menu. This also will bring up the events wizard to edit the event.

    It is also possible to edit a part of a condition without bringing up the events wizard.

    In our example we have an event like

    For "TheLoop" from 1 to 10

    you can double click on the "1" to change it directly to another value

    Play around with this.

    I guess you understand why we did not make any code that makes sense yet.

  • Now you ask:

    Why not talk about the actions ?

    Well we did not add a object yet to "do" something with?

    Actions are "do" things. They are pretty straight forward.

    And they will be clear to you while we do things.

    So well lets start eh ?

    Start with adding an object to the layout.

  • Sir, you're my new hero. Thats very kind of you to put all those tut for the newb' like me

  • And again we start over.

    Fire up construct.

    Make a new direct X game.

    Bring yourself to the Layout Editor.

    You find yourself on a white Canvas.

    On the Left you see the Layout Properties. Width 640 (pixels). Height 480 (pixels)

    That are the dimensions of the white square.

    The dimensions of the Layout.

    When we run the game. We will look at this layout trough a window.

    Click under the layout properties on "application properties".

    And see the window dimensions of the application.

    At the moment they are also 640 x 480 pixels.

    Which means: The whole layout will be visible when running the game.

    I will always try to sneak in some general info at certain points.

    But back to topic.

    Ad an object to the layout.

    Double click on an empty place in the layout. The Object wizard will pop up.

    <img src="http://usera.imagecave.com/j0h/20_add.jpg">

    There are many objects. And to be honest i only used like 10% of them so far.

    So dont be worried about the amount of objects.

    For now choose the "text" object. Double click it.

    The object wizard disappears.

    You are trowed back in the layout.

    The cursor is now a cross hair.

    Click a place in the layout where you want the text object to be.

    And there it is.

    Select the object and move and scale it till it looks like this ..

    <img src="http://usera.imagecave.com/j0h/construct/21_text.jpg">

    Check the bold properties on the left.

    And, IMPORTANT, give the object a name. Name it "Hello".

    On the left uncollapse the common properties. They are on top.

    Locate the name, and change the name.

    <img src="http://usera.imagecave.com/j0h/construct/22_name.jpg">

    ALWAYS do this !!!!

    Now click the Events Sheet Editor TAB on the bottom.

    Add a system event "always"

    Add a sub-event "always"

    so it looks like this ...

    <img src="http://usera.imagecave.com/j0h/construct/23_always.jpg">

    whats is "always" ?

    Its a system "flow-condition".

    It will run any sub-events and action when the condition "always" is met.

    In other words, they run always.

    Why 2 times always ?

    In my eyes it is a good practice to start an event with a "flow-condition".

    The first "always" condition we will change at one point in developing the game to a real condition.

    The second "always" is to give structure to the events, keep it readable, and easy editable.

    now click on the "+ new action" behind the second "always".

    This will pop up the Action Wizard !!!

    Ohhh another wizard. Ah yes. Its the best way to make actions with a few mouse clicks, in a way that the user gets constructive guided in constructing.

    And it acts the same as the Events Editor.

    It starts with showing the list of objects. And asking you to choose one.

    The "Hello" object is listed there.

    Choose it, double click it or press "next"

    Just as the events wizard showed all conditions for an object ..

    the action wizard shows all action that you can do with this object.

    And thats like all you can do with it.

    For now choose "Set Text" from the list ..

    double click it , or click the "next" button to advance ..

    this brings the "parameters" for this action to you ...

    under text to display write exactly this .. including the brackets ..

    <img src="http://usera.imagecave.com/j0h/construct/24_world.jpg">

    Click finish.

    Now in the top menu, click on project.

    The Ribbon should change to project related things. Click "run all"

    <img src="http://usera.imagecave.com/j0h/25_ribb.jpg">

    An application window pops up, running your game.

    Every tutorial to a programming language starts with a "hello world" tutorial.

    Usually you learn all the basics with a few "hello world" lines.

    And yes this you did.

    Next post will be about moving and stopping objects. And the first steps in behaviours.

  • Ok now lets move things.

    The most easy way to move things is using the build in behaviors.

    So lets start over again.

    Fire up construct.

    Make a new direct X game.

    Bring yourself to the layout editor.

    Add and the box object.

    (double click an empty place, choose box from the objects list, click to place it in the layout)

    Now you have a rectangle with green borders.

    Select the box.

    On the left under properties uncheck the "transparent fill"

    Click on the black square behind the "fill".

    A drop down menu will appear.

    Choose red as color.

    Uncollapse "common" and name it "Bug"

    There that is the object that we gonna move.

    Now lets add a behavior that makes it move.

    Still with Bug selected, on the left properties pane, uncollapse "behaviors", and click on "new behavior add"

    <img src="http://usera.imagecave.com/j0h/26_bull.jpg">

    A list with behaviors will pop up.

    Choose bullet from the list.

    The Behavior bullet will show up in Bugs properties. For now let all the values as they are.

    <img src="http://usera.imagecave.com/j0h/construct/27_beha.jpg">

    Position Bug close to the left edge of the layout.

    Click the Events Sheet editor TAB on bottom left.

    This brings you to the Events Editor.

    Notice that there are NO events. And yet.

    Click on the project menu. Click Run all in the Ribbon.

    And watch Bug move from left to right.

    Easy no ?

    Now lets add one events to control Bug.

    But before we do something about the Bullet behavior.

    The Bullet behavior moves an object with the speed You gave it (in this case 250).

    And in the direction it is facing.

    Go back to the layout editor and lets check this.

    Select bug .. and ...

    You find the speed in the Behavior Properties.

    The angles it is facing you find under Common. At this moment that is an angle of zero degrees.

    NOTE: An Angle of 0 degrees is facing horizontal to the right of your screen. Remember this !

    Take a look at the X and y position of Bug under common.

    Move Bug to the corners of the layout and see the x and y update.

    NOTE: The point where where x = 0 and y = 0 is on the left top corner of the layout. Remember this.

    For now edit the x, y and angle values.

    make x 300

    make y 440

    make angle 270

    <img src="http://usera.imagecave.com/j0h/construct/28_up.jpg">

    bug will update to its new positions and angle.

    changing the angle to 270 will face the object Bug Upwards.

    Run all, and u will see that bug will move upwards.

    In other words, to change bug's move direction, all we have to do is change its angle.

    Lets use this in an event.

    First, change the "destroy when" under the bullet behavior to "never".

    (dont forget to select the Bug in the layout)

    Bring yourself to the events editor.

    Add an event from the system object "always"

    Add an sub-event from the Bug object

    (right click the E-spot of the always event, choose add sub-event, choose Bug to start from)

    When you are confronted with the events wizard asking you to choose a condition ..

    notice there is a second tab now

    <img src="http://usera.imagecave.com/j0h/construct/29_second.jpg">

    For now we will not use it, so click on the bug tab.

    Look for "Object is outside layout?"

    Click finish.

    Again this is a "flow-condition"

    When the condition "is the object out of layout" is true,

    every sub-event and action attached to this event will be executed.

    Add an action to the "is outside layout event" ..

    Choose the bug as object to start from ..

    Choose "set angle" as action

    and in the angle parameters window

    fill in .angle - 180

    <img src="http://usera.imagecave.com/j0h/construct/30_angle.jpg">

    click finish

    Strictly .angle - 180 is an expression.

    But since we are not at the point to explain expressions in depth,

    i keep the it simple.

    .angle refers to the angle of the object that you choose in the first step of the action wizard.

    Also named "self"

    bug.angle is in this case the same, since you started the action off by choosing bug.

    you can also use

    self.angle .... but thats a lot of typing .. this why u can shorten it to just .angle

    so .angle = its own angle

    .angle - 180 = turn the object to opposite direction

    you should now have this in the events sheet

    <img src="http://usera.imagecave.com/j0h/construct/31_angle.jpg">

    How to read this ?

    When we run this ...

    The bullet behavior will move Bug in the direction its facing with a given speed.

    The events will first come to the "always" event.

    That is a system "flow condition". It will always run the sub-events and actions attached to it ..

    so next is the "is outside layout" sub-event.

    This condition will run the action only if bug is outside the layout.

    In this case the action is = .angle - 180 = reverse the direction Bug is facing to.

    next will be again the "always" event.

    and so on ....

    Construct events run top-down and in a loop that never" stops.

    "Run all" to see what we made so far.

    And now for me it is bedtime, have a nice day.

  • Now i mentioned the "top-down" execution, i should first introduce you to "Always"'s sister.

    The "trigger once while true" system flow condition.

    Lets repeat the top-down principle again.

    And imagine mister Executor. The little Japanese that runs it all. So ....

    When we Run the game.

    The executor looks at the first event.

    If its true, he will run all sub-events and actions.

    If its not true it jumps to the next event.

    and so on ...

    After the last event,

    it returns to the first event.

    In a never ending Loop.

    The time the Executor takes to run the Events Sheet Only Once we call "1 tick".

    How many times the Events sheet gets executed / second depends on the speed of your computer, or the ticks/second

    This means ...

    When we bring a the system flow condition "always" in the events sheet,

    It will run its sub-events and actions every tick !!

    If the action creates an object .. in a few seconds we have hundreds of this object.

    To solve this, "always" has a sister.

    the system flow condition "trigger once while true"

    You will always use this ..

    or as the last condition in a event,

    or as a sub-event.

    It can not be used as the only condition in a event.

    Why ?

    Because it states:

    Run this action or sub event when the above conditions are met, but only once !!

    So the right syntax to use "trigger once" is this way.

    <img src="http://usera.imagecave.com/j0h/construct/33_trigger.jpg">

    next post will be about the next basic movement: rotation.

  • 3 sprites that i will use in the next post ..

    First dishes, my god, 6 guests can make some dishes mess.

  • Be so nice to download the .zip from previous post.

    Unzip it on a handy place.

    OK.

    Its time to leave the basic objects for what they are.

    Lets add a sprite to the layout.

    Make a new Construct direct X game.

    Navigate to the layout editor.

    Double click an empty place in the layout to bring up the new object wizard.

    Choose Sprite from the objects.

    Again you get a cross hair cursor. Click in the layout where you want the object to appear.

    And the picture editor will show up.

    The picture editor is very well explained on the wiki. There is no way i could explain it better.

    Since i only use it to bring in the graphics i did outside construct and to set imagepoints.

    I have a long resting love affair with Photoshop, Imageready, After effects and Illustrator.

    Now on top of the picture editor you find the second icon. When you hover your mouse over it, it says "open".

    Click that to open a graphics file and point it to the folder with sprites i provided.

    Double click "info.png" to open it in the Picture Editor. Or when your system hides extensions, double click "info" to open it in the picture editor.

    Close the Picture editor as u close any window. It will ask to save. Click "yes"

    Now you have a new object in the layout.

    Name it "info". Always give every new object a name.

    And this is how easy it is to bring graphics into construct.

    Sprite ? Object ?

    Everything in the picture editor is a sprite.

    Everything in the layout is an object and one of the many properties of this object is its face, the sprite. Which can be an animation, but thats for later.

    There are faceless objects too. One of those we saw already. The system object.

    Now lets rotate the object info with a basic behavior.

    Uncollaps the behaviors tag in the left plane, the properties plane. Add a new behavior "Rotate".

    Leave the values as they are.

    And run .

    As you ... it rotates !!!

    Again with no events, no programming skills, no complicated code ..

    we gave movement to an object.

    Now lets combine this the last tutorial about the bullet behavior.

    Add a new sprite to the layout. And choose "plane.png" from the sprites i provided.

    Place it exact in the middle of the layout. And name it "plane"

    Hmm exact ?

    Ah well yes, we know that the layout is 640 pixels x 480 pixels.

    You can see this by clicking on a empty spot in the layout. The left properties plane will give the properties of the layout. And there is width = 640. Height = 480

    so the middle is

    x = 640/2

    y = 480/2

    You can fill the results of this in the X and Y properties of the plane object. And it jumps to the middle.

    (select the plane, uncollaps common, change X and Y )

    But let me introduce you to another very nice feature of the layout editor.

    Its Grid.

    Click on "layout" on the top menu.

    The ribbon will change to layout related buttons.

    Click on edit grid in the ribbon.

    Ah little window pops up.

    fill in the horizontal the number 64.

    fill in the vertical the number 48.

    click ok

    click in the ribbon on "toggle grid" to make the objects snap to the grid.

    Now it is very easy to move the plane to exact the middle of the layout.

    Ah yes construct has very nice features. Only.

    At this moment (.95.3) the grid will return to its initial state of 16x16 when you reopen this project.

    OK now, give the plane a bullet behavior, as explained in the previous post.

    Leave all values as they are.

    But toggle the "destroy when" to "never"

    now move to the Event Sheet Editor.

    Add a event with a system flow condition "always"

    Add a sub-event with a system flow condition "always"

    Add an action to the sub-event.

    The action wizard shows up. The wizard usually comes in 3 steps.

    Step1: the base object for this action. Or better said. The object that will be addressed when we use a "self expression" like

    ".angle"

    ".X"

    ".Y"

    choose plain. (double click or select and click next)

    Step2 : The actions show up. And thats pretty all you can "DO" with this object.

    choose "Set Angle"

    Step3: The parameters for this action.

    fill in info.angle

    You again will notice another way of construct helping you.

    At the moment you type the point, construct will pop up a list of all accessible properties for the object "info".

    Nice .. no ?

    The events should look like this:

    <img src="http://usera.imagecave.com/j0h/construct/34_plane.jpg">

    Now what have we done by this ?

    We just set the angle of the plane to the angle of the info.

    The info rotates by a behavior. In other words, its angle is animated.

    The Plane moves by a bullet behavior direction its angle.

    Since the Plane's angle will change according the info's angle,

    the plane will change direction and fly circles.

    Run all to see this.

    Pretty simple to accomplish in construct. Dont you think ?

    Now lets explore the next basic movement. And this way to move objects you will use A LOT.

    Trust me on this.

    Add another sprite to the layout. This time "balloon.png" from the sprites that i provided.

    Name it "baloon"

    Place it anywhere in the layout. Yes it snaps to the grid.

    Add an action at the last "always" sub event.

    step1: baloon as object

    step2: "set position to another object" as action

    step3: the parameters .. select the "plane" as object to position to, leave image point at 0

    the events should look like this

    <img src="http://usera.imagecave.com/j0h/construct/35_snap.jpg">

    Run it.

    As you see, the balloon moves the same way as the plane. Without the rotation.

    We will use this A LOT. By instance for our own sensors. But that is for later.

    So far, we did a lot with construct. With basic behaviors, and basic events.

    As you see, with a little guidance, construct is really simple.

    And, although construct is beta, we had no crashes yet.

    next post will be a little break from moving objects, it will be about "picking objects".

    yuck that will be a long post.

    Is anyone reading btw ?

  • download this .cap

    Its the layout to start from. Once downloaded, you can double click it to open it with construct.

    I always make the difference between flow-conditions and pick-conditions.

    Now is the time to look at the pick-conditions.

    I have to say, for me this was the most difficult part to understand.

    And the people in the forums expected me to understand all this coming from the ghost shooting tutorial. But i did not. Dumb ? i guess .. lol.

    Every time i asked to explain, i got send back to the ghost tutorial.

    But it never revealed its secrets to me.

    OK

    Look at the layout.

    You see 8 darts.

    They are instances of the same object. You can see this on the right. Click on "layers".

    On top you see the layers, we only have 1 layer.

    Below the middle you see a list of the objects on that layer.

    There is only 1 object shown. And we 8 objects ?

    If u uncollaps the object in that list. It reveals its 8 instances.

    <img src="http://usera.imagecave.com/j0h/construct2/01_instances.jpg">

    They are a bit like shortcuts in Windows terms. You have 1 program. And you can make many shortcuts and place them anywhere on your hard disk. But they all point to this one program.

    This just to give you a visual.

    How do you make instances of an object ? Well just select the object, copy it, and pasted it.

    The copy is an instance.

    When you make an instance of an object, all properties, even the behaviors will be in the copy.

    Its an exact copy, only X and Y will be different due the fact that we in the process of copying, place the copy on another place.

    Most properties you can change then. You can move one to another place.

    So they have different X and Y.

    If you rotate one, the other will not rotate.

    if You make one smaller, the other stays on its size.

    But changes in some properties will effect all instance.

    General rule: everything that can not be tweened, but only be toggled.

    A short list:

    Changing the name of one instance will chance the name for all instances.

    Delete or add a behavior from/to 1 instance will be done in all instances.

    Delete or add a private variable from/to 1 instance will be done in all instances.

    Change collision in one instance will be in effect in all instances

    There is also "the clone"

    A clone you make by copying an object ..

    and bring the copy in the layout with the contextual menu "paste clone"

    I am sure there is a shortcut too for this, i just did not find it yet.

    A clone has nothing in common with the original object, besides its sprite.

    Change the sprite for 1 clone will change sprites for all clones, and thats it.

    Ok, back to our layout.

    So we have 8 objects. They all have the same name.

    And the wizards will see them as being one object.

    Say that again ?

    The events wizard and the action wizzard and the picture editor and the expression wizzard will see them as only ONE object.

    Lets check this out.

    Bring yourself to the event sheet editor.

    Add an event, and uhhh as you see.

    We have 8 objects, and there is only one visible in the wizzard.

    We have 8 instances of the same object.

    And oh man it is so handy to be able to only add a private variable once, and have it added to all instances.

    Also, there will be only one object adding to the size of the .exe file that we adventurously will make.

    Well lets make it short, instances are for a 1.000.000 reasons handy.

    But.

    If the wizards only see 1 object, how do we pick one of the instances to *do* something with, and leave the others in peace ?

    We will do this with conditions, i call them "pick conditions".

    And i better post this now, before it gets lost. And continue in the next post.

  • It was really great of you to do this, Instance. Surely this will be of help to anyone picking up Construct for the first time.

  • At this point,

    i do have to tell you about a problem that i have with construct.

    Construct sometimes points to totally different things with the same name.

    By instance.

    It names every new sprite that you bring into the layout default as sprite1, sprite2, sprite3 ....

    I think that should be object1, object2, object3 and so on ...

    Why ?

    Well a sprite is no more then 1 property of an object. Lets say the objects face.

    And just we can tween the properties "x" of an object ,

    we can tween the properties "sprite" of and object.

    Then we have an animation.

    A sprite is then also 1 frame of the animation.

    I can not handle a sprite and an object being called a "sprite". Because thats difficult to think with.

    And its difficult to explain. And trying so will lead to confusing.

    The same for conditions.

    A condition works like this.

    When you go to lets say a 6 flags park. And you want to ride on the roller coaster.

    There will be a guy with a measuring wood.

    If you are smaller then the wood, you can not ride.

    If you are bigger then the wood, you are allowed to ride.

    Thats a conditions.

    Its true or not true.

    If its true it allows its sub-events and actions to run.

    If its not true, the actions and sub-events will be skipped from execution in that tick.

    Now the conditions that pick objects do not act like this.

    They are totally different.

    And in base this is why i at first could not understand them.

    Two totally different things named the same way "conditions".

    I can not explain this, not to myself (think with them), not to you.

    There for i call them pick-conditions.

    A pick condition basically filters out objects,

    and will pass the filtered object to its sub-events and actions.

    The sub-events and actions will only run on the passed objects.

    Now lets see this in action.

    Hope you still have the layout i provided with the 8 darts. Else open it in construct.

    Bring yourself to the events editor.

    Add an system flow condition "always"

    Add a sub-event to this event ...

    The wizard pops up .. and lets go trough the steps.

    Step1: choose object "dart"

    Step2: choose the condition "compare Y position"

    Step3: the parameters: choose "greater then" in comparison and put 200 in Y co ordinate.

    click finish.

    ad an action to the sub-event "greater then"

    there is the action wizzard

    step1: choose dart as object (this will be the "self" object)

    step2: as action choose "set angel"

    step3: the parameters: fill in .angle + 2

    click finish.

    the events should look like

    <img src="http://usera.imagecave.com/j0h/construct2/02_pick.jpg">

    run all ... and see what happens.

    Only the bottom line darts rotates.

    How ?

    Well its a pick-condition.

    The pick-conditions takes the object we choose in step1 of the events wizard and all its instances.

    Then it will filter out all the instances that do not meet the filter condition.

    In this case all the instances that who's Y is not greater then 200.

    Or to say it different,

    Only the instances who's y is bigger then 200 will reach the sub-events and actions.

    All the instances on the bottom row have an Y greater then 200.

    So the action to rotate will only rotate those instances.

    Ha !

    Now let me introduce you to another awesome feature in construct.

    lets inverse the pick-condition.

    to do this, right click on the condition, remember the C-spot ?

    And choose "inverse condition" from the contextual menu.

    now run all again.

    and ?

    only the top row will rotate.

    lets Narrow the filter by adding an additional pick-condition.

    Right click the condition, not the event, remember the C-spot ?

    Choose add condition from the contextual menu.

    step1: choose dart as object

    step2: compare X position as action

    Step3: the parameters: choose "greater then" in comparison and put 330 in X co ordinate.

    finish

    its looks like this

    <img src="http://usera.imagecave.com/j0h/construct2/03_narrow.jpg">

    Run all

    And now only 1 dart is rotating !!

    What did we do ?

    Well the first pick-condition takes all instances of the dart.

    Its filters out all the instances with Y bigger then 200. (we inverted the condition)

    Wich is the upper row darts.

    the result of this filter goes trough the second pick-condition.

    This pick-condition filters out all instances who's X is smaller then 330.

    Only one instance escapes that filter.

    Now the actions and sub-events will only run on this instance.

    Notice also that we now have an event thats build with 2 conditions.

    Hope this was a help for you.

    Next post will be about private variables, pick objects based on a private variable, and another very basic movement but done by events.

  • Variables.

    There are 4 kinds of variables.

    1/ the properties. We can tween the properties. That makes them variables. We can change the angle of an object. We can change its sprite. Its X. its Y. And other properties. There are properties that we can not change, like the unique ID of an object.

    2/ the behavior properties. Like the gravity of the physics behavior. The speed of the bullet.

    The track object in the turret. And many more.

    3/ there are global variables.

    4/ there are private variables.

    Forget 1 and 2 for this moment.

    Global variables i will mostly use as flow-variables. Remember flow-conditions ? more about this later.

    Private variables have 2 functions.

    The first and obvious function is to store/retrieve a variable related to a specific object.

    And this said, its second function is to give an object an identity, a passport.

    And there is 1 really big difference between global and private variables.

    When restarting the layout the global variables keep there values,

    While the private variables return to there initial state.

    at least i think think so, i better check this out tomorrow to be sure.

    Its bed time anyway, have a nice day.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)