mindfaQ's Forum Posts

  • Next update, this time 100 events are reached.

    version 0.8; current number of events: 100

    download .capx

    Preview

    changes:

    • switched from WebStorage to Localstorage - this used up some extra events
    • save and load buttons are disabled now, when no appropriate save slot is selected
    • music, voice and sfx volume global values added (to be later set up in an options menu, or by the user in the event sheet)
    • sfx and voice volume can additionally be modified by the script; forgot to set it up for music as well, will do so later
    • each hud button now has its own animation, it'll be possible to use animated buttons and it's more easily understandable where which button should be placed, when one wants to modify it
    • hopefully fixed a bug with loading
    • fixed a bug that appeared when changing images (thanks

      lipstick)

    I'll tidy up things a little and then that's probably the end of the 100 event VN engine.

    Here's an updated list of functions the script accepts (explainations in brackets if not obvious):

    • music | filename | volume (volume in added dB; so -10 makes it about half as loud; volume not mandatory)
    • sfx | filename | volume
    • voice | filename | volume (voice will be played together with the text function that came before it; it must be used after a text function or you'll run into a frozen game if I'm not mistaken)
    • character | displayname | charactertag | color red | color green | color blue | fontname (tag is used by the text function to assign a text to a character; RGB values from 0 to 255)
    • text | charactertag | text to display
    • choice | decision | value added to decision | text to display on the choice button | button coordinate x | button coordinate y (you can define tags for coordinates in the event sheet, too; I've set up xleft, xmid, xright, ytop, ymid, ybot for example)
    • wait | seconds to wait
    • background | filename (backgrounds are expected to be .jpg, but you can change that in the event sheet if needed)
    • image | filename | imageid | coordiante x | coordinate y (file extension is expected to be .png; if filename is "clear", it will destroy the image; using the same image id in your script will enable you to change an image instead of creating a new one ); coordinates are only mandatory when creating a new image
    • fadein | imageid | duration
    • fadeout | imageid | duration
    • move | imageid | coordinate x | coordinate y | duration | mode (leave a coordinate empty if no change should be applied; modes available are "skip" or "wait" - skip will continue in the script immediately, wait will continue with the script after the duration is over or the screen was touched)
    • require | on/off | decision | value (on checks if the decision's value is at least at value; if it is, script will continue normally, if it doesn't the script will skip until the corresponding "require | off" appears, imagine it working like brackets)
    • anchor | anchortag (marks a line in the script so that you can jump to it)
    • goto | anchortag (jumps to the corresponding tagged line)
    • set | decision | value (set the value of a decision; if decision is "all", all decisions will be set to value)
    • macro | macrotag (set start and end of a macro, in the lines of the macro use "/x" for a string that will get substituted by runmacro)
    • runmacro | macrotag | string that will be filled in for "/x" (runs the macro)
  • Let's say a relatively large textfile is requested via ajax. Does it make sense to clear the data by loading some small dummy data into the ajax data by requesting it to free up memory (not sure about how browsers go about reclaiming the memory thats unused ("garbage collection"))? How does the memory used up by the ajax.lastdata influence performance, especially on mobile devices?

  • Hello guys,

    how do I use the OR operator | in pick by comparison.

    I don't understand why this doesn't work:

    please note that this works:

  • :

    Would make sense to post some credentials like previous works/games you did, so people can see your abilities. Right now I would be very hesitant to buy something for money that should be free (imo) from someone that I have never heard of.

    Ha.

    Steam buyers don't get a badge either.

  • on drag&drop drop: set drag and drop disabled

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can only invert "is overlapping" in that case - maybe you can make use of that.

    If you wanna work around it (* = one event):

    *every tick: set colliding = 0

    *on collision: set colliding = 1

    *colliding = 0: do stuff

    since events are read from top to bottom, this should work.

  • Dota 2 ofc.

    Any one here who plays DOTA 2? I'm 5.7k, see me at SEA Leaderboards. I stopped playing about a week ago so I can focus my work here with C2.

    Me, but on EU 5k.

  • I added some further explainations.

  • When you drop a piece, you check for overlapping empty sprites. Since those have a collision size of 10 x 10 boxes and your game piece a collision box for 42 x 42 pixels, there are places, where your gamepiece overlaps multiple empty sprites. In that case, two or even three of the empty sprites are destroyed and only one is created -> you end up with empty spaces in your grid.

    After your overlapping condition, you could add "pick nearest empty" or (even better) compare two values: distance(gamepiece.x, gamepiece.y, empty.x, empty.y) < gamepiece.width - empty.width * 2

    This way you will end up with only one empty picked, and in the case of the distance expression, you also get some snapping back, when the game piece is in the middle of two empty pieces and when it is not sure if the user wanted the piece to drop on empty 1 or empty 2.

    And here the checking function I would have done (although I would probably input the piece information into an array and iterate over that):

    It's a bit simpler imo, you have a queue of pieces to check (starting with the exchanged piece), this looks at the pieces around it and finds pieces that have not been looked at (queued) before (status = 0); those pieces are added to the queue. When the queue is empty, you've found all adjacent pieces of the same color.

    Of course you can pack these 4 events of looking around into each direction into a for loop, but while it saves space in the event sheet, I don't think it will be faster at execution, since calculations won't get less.

  • Or with the text object: https://copy.com/m3aXIre0KYp2xMTB

  • Yeah should work... does int(selection) = 128 or round(selection) = 128 work?

  • How about this?

    https://copy.com/nVYGNNmNa3zVGOlg

    btw, you exchanging of pieces is flawed, since it is possible to overlap multiple empties.

  • mid(text, index, count)

    Return the count characters starting from index in text.

    Though you have to know after how many characters your third zero starts...

    If you want to do inplace changes to a token-filled string, you might be better off with using an array instead, really.

  • Depends on how you wanna modify the angle. You can check for multiples or 22.5° with the expression angle%22.5 = 0 (though I am not sure if some problems with float calculations will come up)

  • variable: numberofbullets = 1;2;3;1;2;3

    set currentnumberofbullets to: int(tokenat(numberofbullets, weaponlevel-1, ";"))