toreriksolem's Forum Posts

  • 8 posts
  • Thank you so much!

  • I have a sprite that is the image of a selector knob:

    I also have a global variable called dragAndDropTest that will be renamed selectorKnobValue.

    I am looking for a way to set the value of dragAndDropTest when clicking and dragging the mouse (not actually dragging because the sprite/knob wont move at all).

    Moving the mouse left, dragAndDropTest is set to dragAndDropTest - 1.

    Moving the mouse right, dragAndDropTest is set to dragAndDropTest + 1.

    There is another condition checking that the value does not go below 0 and neither increases over the number of the last animation frame.

    The X value of 795 represent the center of the button.

    This partially works = When I click to the right of knob center, dragAndDropTest increases by one. Clicking to the left of knob center most of the time work as well, but it is not as consistent. Any idea why?

    Wanted additional functionality: I want the user to be able to click and drag the knob, as this is expected functionality/behaviour when interacting with elements like this on a computer screen. Click knob, and drag left should decrease dragAndDropTest -1, while Click knob, drag right should increase dragAndDropTest +1.

    Does anybody have suggestion on how to implement this mouse click+drag behaviour?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So, coming back to this:

    I have given the fader a instance variable called indFaderValue (for individual fader value). Now, I need to address these individual values to the the volume parameter of different audio tracks. I have separated audio tracks that are imported into my project.

    Lets say, instance 1 of the fader family needs to adjust/set the volume of the guitar audio track. Instance 2 need to control the volume of the drums track.

    How do I grab the value of a parameter of a certain family member and set the audio volume to that value? I can vision using UID or something like that, but I can not find anywhere this is being addressed? Could anybody show me, maybe with a screenshot, or maybe point me in the direction of some document or youtube video that explains this?

  • Hope this helps!

    Thanks so much for this, It will speed up my workflow loads!

    The whole thing of variables and functions... It is a bit difficult to wrap my head around it, and to see a couple of examples is very helpful!

  • As for applying it to several objects in your project, that depends on what exactly you want to do. You could use families and custom actions to handle whatever the objects need to do based on the value. Perhaps a function also does the trick in your case. Most likely either of those will be what you're looking for.

    My use case is the following: I am making a control panel with volume faders, like a simple audio mixing console. I have multiple faders moving along the Y axis, and I have managed to make the "input value" increase linearly from -100 to 0 as the knob is moved up the Y axis.

    Using the equation in question makes sure that the "output values" increase more rapidly in the bottom end of the Y axis and increase slower in the top end. This is preferred performance for a mixing console.

    I could put the equation into every single (there will be 12-16 faders upon finishing this project) faders "output value" calculation, but I want to understand how I can use a variable to store this equation in one place and then reference that location in all the faders. If I later want to adjust the equation ( I will ), then I only have to make the adjustments in one place instead of 12-16 places.

  • Similarly, how can I use a function or a variable to avoid this:

    These 4 lines sets the correct animation frame for two instances of the same sprite. Completing this build, I will eventually have 12 instances of the same sprite, and I believe this can be done without having 24 single lines in the event sheet?

  • I have an input element (FaderValue) that gives a value from -100 to 0.

    These value are converted in an exponential equation that I want to tinker with to get right, but trial purposes I am happy with it for now:

    round(3.1 * (1 - exp(-0.035 * FaderValue)))

    Now, I need to use the calculated value for several objects in my project. How do I implement this?

    With a variable? Can I set a variable to this equation?

    With a function? With parameters? How should I set that up?

    Any other suggestions?

  • Hi!

    I am new to this Construct, and enjoying it very much so far!

    I want to create a game where the player is moving around in a world (SuperMario-like?) collecting items. I think I will need to implement an inventory list somehow.

    Maybe I could put a lot of "play intro", "play verse", and "play song" items/events everywhere in the world, and then these are triggered whenever the player collides with these items.

    The items that I want to have collected are audio files. These audio files are snippets of a song, and I already have the stems (files exported per instrument) for the song. The snippets can be the drum track, the piano track or the guitar track and so on. I will make this sync by starting all the tracks from a player collision event. All track will start muted, but depending on which collision event triggers the playback, this will determine which one of the tracks are allowed to be unmuted (or fade in/out).

    Say the player collects the SecondVerse_item. Then this audio track would be unmuted in Construct, but there wouldn't be audible sound from this track when the song were playing the intro, or the chorus. The only time this track actually would play back any sound, would be if the song was within the timeframe on the second verse. Simply because the audio file only contains audio within those seconds that the second verse lasts.

    I think I can wrap my head around how to do all this without too much problem.

    Now, what I'd also like is for the player to be able to rearrrange the order things are played back. Example: How could I make the player able to move the second verse into the position of the first verse? Or maybe even into the position of the intro?

    Could I somehow use variables to move the start point of playback of an audio snippet? How well would this then sync up with the rest of the audio clips? I will work the audio files in Pro Tools, which makes sure the precision of my audio files are 100%.

    One thought I also had was that an inventory list could be used to let the player rearrange the order of the song parts or vocal parts (like putting all the choruses before the verses or something simliar).

    I realize I might be asking for much, but I am hoping someone out there are able to help me somehow. I think this could be a really fun project to see through. Oh, and sorry for my (potentially) bad english.

    Tagged:

  • 8 posts