WackyToaster's Forum Posts

  • Sounds more or less like a classic Null-Object. I´d take that.

  • Check the layer properties, the layer may have a background set.

  • Short answer: yes, events are executed top to bottom.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

  • Hell yeah!

  • A tutorial on how to stop slacking off. :V

  • You probably need to pick the spritefont object. You say you choose the spritefont that fits the condition, however, I do not see any choosing happening in the events. How exactly are you choosing it?

    Right now all spritefont objects in the layout will be picked, that is why you always end up with the start game (simply because it comes first in line) Basically you have to know what spritefont object is currently selected and pick it inside the "on z pressed" event.

  • Set animation frame to Self.AnimationFrame = 0 ? 1 : 0

    I think dops method also works. It resolves to 1 if the frame is 0 and vice versa

  • Each vertical row is basically a page by doing so. Correct? This would also mean I could use the array.X as the variable to set the page navigation right?

    Exactly :)

    What I don't fully understand is why you subtract 1 from the 0-based X? Set at XY. X = array.width-1?

    When X is set to 0, it basically means the width of the array is 0, as in 0 fields. As it shows in your screenshot, Elements: 0. The moment you push your first note, your array becomes width 1. So right after when you want to set the type/content, you need to access the 0th field and you need to subtract 1 from width to get the last field that was added.

    In other words, an array with a width of 3 has three elements that you can access with X=0, X=1, X=2. An array with width 1 has one element that is X=0. And an array with width 0 has no elements to access.

  • Something like this wackytoaster.at/parachute/Board.c3p

    I also changed the diceroll to choose(1,2,3,4,5,6) instead of round(random(1,6)). The reason is that with round(random(1,6)) you are actually less likely to get 1 or 6. Anything from 1 to 1.4999 will result in 1, so a range of ~0.5 where anything from 1.5 to 2.4999 will result in 2, so a range of ~1. Same for 6.

  • Sooooo I guess I need an array for each, right?

    Well, probably not. I´d use one array for all of them. Of course there could be a use case where you need them separated. For simplicity, I´d just say 1 page = 1 note.

    So each entry on the X axis is a note, and entries on the Y axis are the notes contents. Let´s assume each note has title, type, content

    You start out with an empty array on the X axis and you need 3 fields on the Y axis so that would be a 0,3,1 sized array.

    You find any note, you use the arrays push action. Most likely you´ll want to push back on X axis. Push the title of the note.

    Right after, you need to set the type and content, for that you can use Set at XY. X = array.width-1 (arrays are 0-based) and Y = 1 for the type and 2 for the content.

    And for the notebook navigation, you just need one variable (e.g. currentPage) that tells you what page you are on. Since you always show two pages at once, you can increment the variable by two whenever you navigate and simply repeat the actions below.

    So you start out on page 1. You can now read the values of the array based on the currentPage variable. Again, don´t forget that arrays are 0-based.

    Array.At(currentPage-1, 0, 1) = title of the note

    Array.At(currentPage-1, 1, 1) = type of the note

    Array.At(currentPage-1, 2, 1) = content of the note

    (This is for the left page, for the right page use Array.At(currentPage, 0,....)

    Now you need to just fill in the data on the pages. So probably something like, get the title, add it into a textfield on top of the page. Get the type (since you said there are different kind of notes you probably want to know how to handle the content), basically IF type = A do this, IF type = B do something a bit different. Then you get the content and also fill it in.

    What data you save into the content is up to you, could just be a tokenized string A|B|C where you can use tokenat to split it up, could be some JSON content that you then parse and use, could be an image that you then show on the page,...

  • Heh ok, allerdings mögen die Mods das nicht weil das ein englischsprachiges Forum ist, bzw. sollte man zumindest eine Übersetzung auch machen, und wenns nur Google Translate ist. Was ich mit einfacher meinte ist eigentlich nur dass es ein paar Sachen gibt die ich nicht ganz nachvollziehn kann. Z.B. sehe ich keinen Grund wieso du PositionN und PositionT in den Board Instanzen hast, das gehört für mich definitiv in die Player Instanz. Und auch das "Player is overlapping Board" ist nicht optimal, es funktioniert zwar, läuft aber auch grundlos 60 Mal die Sekunde. Ist für moderne PCs und sogar Handys meist egal, aber bei Handys kann es dann doch leichter passieren dass es mal zuviel wird und du fps Einbrüche hast. Vor allem wenn es mehrere solche Stellen im Code gibt die vielleicht auch noch mehr machen als nur Variablen zu setzen.

    ---

    Heh ok, although the Mods don´t like that since this is an english Forum and you should at least add a translation, even if it´s just with Google Translate. What I meant with easier is just that there are some things that I don´t fully understand. E.G. I don´t see a reason why you have PositionN and PositionT in the board instances, for me this defenitely belongs into the player instance. And the "Player is overlapping Board" is not optimal, it may work but it needlessly runs 60 times per second. For modern PCs and even phones this mostly doesn´t matter, but with phones you can eventually still run into fps drops. Especially if you have several cases in the code that do this that may also do more work than to just set some variables.

  • No idea, here´s the file. Works fine for me. Maybe you forgot to adjust one of the variables in the board fields when you changed it to 20?

    wackytoaster.at/parachute/Boardgame%20Movement.c3p

  • There is probably an easier/better way to handle all the movement but I adjusted your example.

    I marked the changes with a red dot. For understanding developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator

    It´s basically just a shorter way of doing an IF statement.

  • You probably want to look into Arrays.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/array

    Basically you have an initially empty array, and whenever you pick one of the notes up, you push that to the array. This way there will be no gaps and the notes will appear in the order you picked them up.