paxclara's Forum Posts

  • i'm actually looking into the same question to do a generative music thing. i haven't really started on it though (so much else to do lol) so i have nothing constructive, but when i do i'd love to compare notes, or hear if you were able to make any headway on this. i'm actually surprised to hear that playing audio at reduced speed wouldn't correctly shift the pitch, which is bad news for me because i thought the math would be relatively straightforward--makes me wonder if something else is happening though?

    oneGlitch:

    searching tone.js comes up here: tonejs.github.io i like your cat pic

  • it could be a lot of things depending on what you mean by "janky" specifically. if the movement is stuttering, my guess is you probably have it locking to integer positions, which you can change by making sure the pixel rounding setting is turned off in the properties bar for your project:

    if you want this setting on, you can have non-janky movement by using movement speeds where the player is mostly moving at whole pixel values every frame, which would be any multiple of 60. if you're moving at, say, speed 30, which is 30 pixels per second, your character would be stationary for 1 frame, and then move 1 pixel for 1 frame (assuming your game is running at 60 FPS). likewise, if you're moving at, say, 200, which would be 3.33 pixels per 60FPS frame, your character would move by 3 pixels for 2 frames, and 4 pixels for 1 frame, which can cause noticeably uneven movement

    the sin behavior isn't generally going to move like that though, because the nature of sin waves is that the change in position is non-constant.

    in my project i'm letting the characters have non-integer positions, but i set them to an integer position when they hold still. this causes other problems i had to deal with, but i don't like the effect of uneven pixel overlap when things are offset by half (or quarter) pixels, so this is my solution to make them line up with the other graphics when idling.

    if your sprite is moving jankily in a different way, though, the problem could be something else

  • i'm not sure if you can have two layouts loaded at once

    this is just my first idea, but you could create your level select as a global layer, set it as the highest layer with 0 parallax, then make sure that layer is included in every layout. when you move between layouts the layer will be the same across layouts. then you just need to make sure there's a transparent area in your level select layer to allow the player to see through to the selected level. 0 parallax on a layer means that everything will stay in place visually. this is also a good way to do the UI, to show health and stuff without having it slide off screen when you start moving

  • i think your problem is that you don't want the initial and final quotes in your string variable--the variable type is defined in the UI, so you don't need to type it as a string with the quotes (if that's what you were thinking, i mean). i don't think you need to escape the quotes there either, construct accepts quotes in string variables. i've actually never loaded a dictionary like that, though, so i'm not certain.

    i don't know if you just set it up like this for your screencap, but i recommend using a project file for your dictionary and calling it with AJAX. this is what it would look like, though this example uses a JSON object instead of a dictionary, yours would look the same

    i also recommend using debug mode to look at the contents of your dictionary object during run-time so you don't have to print stuff out in text boxes, saves me a load of trouble personally

  • I have objects (arrays) with instance variables (array.zoneName, array.day). I want to run an event when there are *no* instance variables where *both* things are set to a specific thing. I tried this:

    it works if there's no zoneSchedulers, and it works repeatedly if there's 1 zoneScheduler with different data. I pretty much understand why it's doing both of these things (the former because it's not true since the left side is 0, and the latter because it's consistently not true since the left side of 1 instance is different), I just want something that runs when there's *no* instances of something where the evaluation is true. that is, if there's a zoneScheduler with untrue data, and a zoneScheduler with true data, it doesn't run

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i see, i didn't understand you meant "only" before. thanks!

    for me scripting is kind of impenetrable, but after working with a friend, we came up with this function that i wanted to share if anyone was interested (i know how it sucks finding a forum post from 5 years ago where they don't say how they ultimately solved their problem):

    this lets you call the function in an expression with Functions.GetVarsFromString(JSON.Get()) or any string variable really and it will return the value of the global variable being called. you can see me using it in the conditions for my VariableCheck function (and calling that in the action at the top)

    anyway thank you again for your help! i am planning on releasing the dialogue system when i'm done with it so i will try to remember to post about it here as well for the future people who may find this thread in seven years

  • i see, thank you! so after testing i find i can evaluate, for instance:

    InventoryDic.Get(JSON.Get(.Variable))

    i have also got it to call a DictionaryCheck function that correctly picks and pulls the right values from the right dictionary!! incredible. didn't know about the "pick" system condition, which also fixes another issue i was having problems with (highlighting the speaking portrait with its name from json)

    however, i still don't seem to be able to find variables with their string names from json. i suppose i could solve this by making every global variable instead be stored in a globalVar dictionary, which is all the same to me even if it is more typing, but i wanted to check if there might be an easier way?

  • i am working on a powerful and versatile dialogue system. i want it to be able to check for any aspect of the game state (such as inventory, skills, quest status, equipment, time of day, day of the year, etc.)

    tldr:

    i want to have text in json that is, for instance,

    {requires:"InventoryDic.Get(\"Banana\")"}
    

    and then i want to pass that text into construct 3 and have it return the value for the key "Banana" in the dictionary InventoryDic, rather than the string InventoryDic.Get("Banana"). is there an expression that attempts to turn a string from JSON into an ...expression...(?) like i would type into the expression dialogue? i've been looking at the documentation all day and it's entirely possible i'm just not seeing it.

    more information:

    my ideal would actually be to just have something like this in my json for each dialogue option:

    "requires":"InventoryDic.Get(\"Banana\")>=2"

    and then just find a way to evaluate it as an expression, even if it needs slightly different formatting. even if that is possible, i still want to be able to evaluate expressions from json. for instance, in the character's nameplate, one might want to put for the name a code, like CharNames.Princess, that finds the value for the key Princess in a dictionary CharNames and puts that into the nameplate. or, if i wanted someone to say how many bananas you had, or your favorite food you've selected earlier, or what you told them your name is, inline in normal text.

    the above example in the tldr is from breaking that expression into three chunks like this:

    "requires":{
    	"variable":"InventoryDic.Get(\"Banana\")","operator":">","value":1
    }
    

    which seems like it might be easier, since i could evaluate either side of the equation separately, and use additional conditions for operator. this seems obviously more prone to potential typos and such, but then i only need to know how to evaluate one simple thing. i have considered using a format function like in Laura D's dialogue tutorials, which i am using for things like newline, but as far as i can tell that would still require evaluating the text in construct to replace it with the associated values...

    i'm really stumped by this, i've looked (repeatedly) at the documentation for json and ajax and the expression finder and if it's there i really am not seeing it. but, i also missed the "reset platformer doublejump" action for like 4 hours when i first started working in construct last month, so it seems possible i'm just missing something obvious? like if it's possible i'm expecting it to be something really simple i just overlooked, but i have looked over and over now