Yann's Forum Posts

  • Just do

    Keyboard: Space is down
    System: Every 1.0 seconds
      -> TheGuy: spawn bullet

    Or with Mouse: Left button is down

    Same idea

  • didn't read this seriously but I noticed the 'dialogset' group is empty :D

    ... Oh, all your groups are empty... you have to nest things inside

    Also... you have different event sheet but you do not include them in the main one (the one the layout is linked to)

  • No no Weish no tut I'll just spawn a little capx for delgy and that will be all the fun.. I'll let you handle the tuto if ya want (:

    But... I'm currently at work, so I'll need to postpone that for hmm at least 10h from now

    (I already try something but the capx seemed to be buggy... somehow... well I'll see)

  • Also Delgy, one day you'll make english capx... And the world will be happy

  • these days I like them with apple sauce... god damn sweet but not too sweet like Jam... if you know what I mean

  • Well I did propose something... :D

  • Weish > I'm thinking about it (: But I'm a bit maniac, and pretty concerned about being easily understood. So it might take a while (:

  • I see, if it wasn't a continuous scrolling thingy, the answer would be easy just a got to layout "room"&random(roomcount) but here it's something else.

    Hmmm I know

    You need to use two dummy sprite which would be used as a start and end point

    You need to use the same objectType for ALL the elements of your room.

    Just use differents animation Frame with an animation speed set to 0

    And set the initial frame (in property panel) to the corresponding frame for the object you want to use

    This unique sprite will have an instance variable named 'room' of type number which will hold the number of the room.

    You will have the startDummy positionned at the connexion point between two room at the far left, and the endDummy positionned at the connexion point between two rooms at the far right

    Each Dummy object will also have an instance variable named 'room'

    The idea is that at start of frame you'll create an array with all the positions relative to startDummy (this dummy will drive all the room) and all the corresponding animation (to have the right image showing) if you use different angles you'll also have to store them.

    In practice that should look like :

    System: on start of layout
      System: foreach startDummy
        Sprite: room = startDummy.room
        System: foreach sprite
          -> Array: Set value at (startDummy.room,loopindex+1,0) to sprite.X-startDummy.X
          -> Array: Set value at (startDummy.room,loopindex+1,1) to sprite.Y-startDummy.Y
          -> Array: Set value at (startDummy.room,loopindex+1,2) to sprite.animationFrame
          // Storing the number of object+1
          -> Array: Set value at (startDummy.room,0,3) to loopindex+1
        endDummy: room = startDummy.room
          -> Array: Set value at (startDummy.room,0,0) to endDummy.X-startDummy.X
          -> Array: Set value at (startDummy.room,0,1) to endDummy.Y-startDummy.Y
      // Cleaning up  
      -> startDummy: destroy
      -> endDummy: destroy
      -> sprite: destroy
    

    Basically the Array will then contain a map of each room with the startDummy as an origin. And in the first index, you'll have the X and Y position where you have to attach the next room.

    Now to spawn rooms, you'll have to keep in check the position of the next room to spawn in two variable (for X and Y) (maybe if it's all at the same height level you can avoid storing/using Y)

    And You'll have to loop through all the values of a room stored in the array, create Sprite, position it from the current new room to spawn, and set the proper animation frame.

    Let see

    Global Variable nextX = 0  //X position of the nextRoom
    Global Variable nextY = 0 //Y position of the nextRoom
    // next room is near the border of the window
    // spawn another room
    // (I assume you always scroll to player and I add 100 as a security margin)
    System: nextX < Player.X+WindowWidth/2+100
      Local Variable randRoom=0  // which room?
      // random(5) will return a random number from 0 to 4
      -> Set randRoom to random(5)
      // create the room
      System: for "" from 1 to Array(randRoom,0,3)
        -> System: Create Sprite on layer "rooms" at nextX+Array(randRoom,loopindex,0),nextY+Array(randRoom,loopindex,1)
        -> Sprite: set animation frame to Array(randRoom,loopindex,2)
      // store the end point of the new room
      -> System: set nextX to Array(randroom,0,0)
      -> System: set nextY to Array(randroom,0,1)

    And that should basically be it

    Now there's still 2 issues :

    • The first one is zIndex dunno how the script will behave... maybe pretty well, else you might have to use layer and also store layer position to create in the right one.
    • The second one is collisions, you might create invisible collisions and store their position to the startDummy the same way... But in another Array.

    Tell me if it worked, I just wrote it as it came :D

  • hmm send the capx, it might be a size thingy, the size of the canvas texture could be 1*1 px but you could stretch it to fit the layout.

    And setting a pixel shouldn't drop fps :D

  • hope we'll see some stuff soon

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tokenat(string,index,newline) works like a charm.

    Also I didn't manage to successfully import stuff by previewing

    So for testing I do a

    on start of layout
       -> set [variable you want to import your .txt to]  to  [and I past the big .txt]

    You just have to remember that if you use external files, you will have a little lag between the ajax call and the answer.

    You usually have to stop thing while waiting for the answer. As I launched the writting once I was sure I had received something in my example capx.

  • If you're talking about the plugin I didn't try it

    If you're talking about the format it's pretty straighforward

    You draw a 2D array with coma (CSV = Coma Separated Values) and line breaks

    In CSV the syntaxe I described would just look like

    ID;ChariRange;SentRange;ColdRange;Sentence;ID_ANSWER
    120;0-20;20-50;50-100;Er.. What do you want?;241
    120;0-30;60-80;0-5;Don't look at me like that!;242 
    120;50-100;0-50;0-10;I.. oh you are right;-1
    120;0-100;0-100;0-100;yes?;244

    As you noticed I used semicolons instead of comas. Because you could have comas in the sentences.

    I don't know if you can configure custom separators in the plugin though.

    Also you could build more complex but more usable Arrays breaking things up a bit more in a 3D Arrays. Like :

    Dialog(120,0,0) = "0-20"
    Dialog(120,0,1) = "20-50"
    Dialog(120,0,2) = "50-100"
    Dialog(120,0,3) = "Er.. What do you want?"
    Dialog(120,0,4) = 241
    Dialog(120,1,0) = "0-30"
    Dialog(120,1,1) = "60-80"
    Dialog(120,1,2) = "0-5"
    Dialog(120,1,3) = "Don't look at me like that!"
    Dialog(120,1,4) = 242
    Dialog(120,2,0) = "50-100"
    Dialog(120,2,1) = "0-50"
    Dialog(120,2,2) = "0-10"
    Dialog(120,2,3) = "I.. oh you are right"
    Dialog(120,2,4) = -1
    Dialog(120,3,0) = "0-100"
    Dialog(120,3,1) = "0-100"
    Dialog(120,3,2) = "0-100"
    Dialog(120,3,3) = "yes?"
    Dialog(120,3,4) = 244

    This way you can easily get the range parameter calling the third first Z indexes, or the sentence, or the id of the answer.

    Can do the same for answers of course.

  • It's not possible in an event.

    But you can use the Canvas plugin, you put it in the lowest layer, make it the size of the layout and fill it with the color you want at runtime.

  • you can try

    System: Every tick
      -> Ball: set onGround to false
      -> Ball: set Y to self.Y+1
    Ball: is overlapping Ground
      -> Ball: set onGround to true
    System: Every tick
      -> Ball: set Y to self.Y-1

    It's move down -> check -> move back up every tick

  • put the file on the public folder and right click on it "dropbox > copy public link"