Zebbi's Forum Posts

  • SKIDTHRESHOLD should be a value between 0 and 1, with values closer to 1 requiring less intense skidding to produce marks. SKIDINTENSITY can theoretically be anything, but I recommend values between 0 and 100, 100 being the most intense. As it is right now, the opacity of the skid marks is a function of tire grip and SKIDINTENSITY, so you get a gradual fade in as the skid intensifies, but you could simply set the opacity to SKIDINTENSITY directly for a more instant effect.

    I set the skidintensity to 88 and changed the gripstrength setter to "abs((Turt.car.VectorX / Turt.car.Speed) * cos(Turt.Angle) + (Turt.car.VectorY / Turt.car.Speed) * sin(Turt.Angle))/1.05" by adding "/1.05" and it seems to have made things closer to my needs! This is actually really perfect and solves my skid soundfx issues by allowing me to use the gripstrength as a soundfx trigger!

  • If you want the skid marks to persist -- i.e. last forever -- then I would definitely recommend using Paster so you don't have a bunch of static objects all over the place.

    Here's an example I pulled together showing how to do skid marks(using Paster):

    Skid Marks with Paster

    linkman2004 this is perfect! Just currently trying to adjust it for my needs to the skids happen at a slower speed with less of an intense turn required to start the skid, which is a more cartoony effect, but would work for my purposes, more like any kinda of near-right-angle would cause a skid. Adjusting the two globals hasn't helped much so far, is there another bit that needs tweaking for this kind of effect?

  • Nothing comes to mind. Reading your initial post maybe you can make the sound depend of the joystick instead of the turning rate?

    The car is computer driven, so maybe that has something to do with it :/ Can the amount of angles changed per second be calculated somehow?

  • I heard some folks mention using paster (not tried it yet) but supringly, I couldn't find as many good examples of "skid marks" as I was hoping to find through the forums. Would paster be the best way of achieving this? If so, I'm not sure how to use it and could use a suggestion. If not, would creating a lot of sprites be too heavy?

  • global number rateOfTurn=0

    global number previousAngle=0

    everytick

    --- set rateOfTurn to (sprite.angle-previousAngle)/dt

    --- set previousAngle to sprite.angle

    Trying again, this seems to increase as the cars speed increases, but the rate of turn appears to be the same, no matter how fast the car turns?

  • [quote:19l3u159]abs(x) Absolute value of x e.g. abs(-5) = 5

    Thankyou!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there some way, using expressions, of ignoring the fact a number is a negative value, and just treating it as a positive? Sort of like how round() ignores the decimal point, can you tell c2 just consider -50 as 50, -100 as 100, etc?

  • Makes sure to convert the values back to numbers. At the moment it is comparing "2" to "10" as a string: "2" < "10".

    Ahh, works now I changed "Value /> LayoutName" to "Value /> int(LayoutName)" I must have been getting on by with luck until now! Thanks!

  • I'm giving layouts static numbers as names (1,2,3,etc) and I am testing these numbers for LocalStorage events, to figure out which level is unlocked. Strange thing is, if the layout name is greater than 9, it doesn't seem to be saving the value properly LocalStorage, since there's a condition to only save the item if the variable is greater than the current layouts name (when returned as a number rather than a string). Does LocalStorage think of 10 as being somehow below 2, or does LocalStorage only keep numbers on single digit?

  • Thanks, I'm already doing some of that, I managed to work it be getting the LocalStorage checks in the right order, thanks fm4fanAT for reassuring me it would work!

  • If you would store also the "trophy size" to every level it should be solved.

    If trophy is bigger than the stored one = Tada

    Edit: you also could look at the stored score/time/lap because you know which trophy he has and so you could also check.... (but my first suggestion is simpler)

    Thanks, I actually tried that first method after I posted this but it also didn't work, I think I might need to try again and make sure the lap numbers are being reported properly...

  • global number rateOfTurn=0

    global number previousAngle=0

    everytick

    --- set rateOfTurn to (sprite.angle-previousAngle)/dt

    --- set previousAngle to sprite.angle

    Thanks! This seems to increase as the cars speed increases, is there a way to subtract the cars speed changes from the turn speed?

  • I have a score, and if the player receives a 3 or 4 score (from racing laps), they get a small trophy; 5 , 6 or 7, they get a medium trophy, 8 or 9, a big trophy and 10+ a big trophy. I'm testing if a LocalStorage value is smaller than a lap, and if the value written in LocalStorage is lower than the lap, the trophy is shown. This works well, since if the player is replaying a level and they receive a lower score, it still retrieves and shows their highest won trophy ever for the level. When the get a higher lap than is saved in LocalStorage, it writes the higher score to localstorage and shows the new, bigger trophy. I also have a failsafe wheby is the the LocalStorage key doesn't exist, it writes the current lap to it regardless.

    Now, the problem is, I can't think of how to play a "tadah" sound the FIRST time the player wins the trophy. It has a tendency whatever I write to play the "tadah" sound upon retrieving the score from LocalStorage and displaying the trophy that has been won in the past. Any clue what kind of LapCount/LocalStorageValue test I would have to perform to make sure the "tadah" sound only plays the first time the play wins the trophy?

  • Sure it's possible. The simple overview of a mod player is it takes the file and generates sound as it goes, a chunk at a time. Without webaudio it does this by creating a wav file that is then loaded and played. The issue is to make one chunk match the other precisely. Webaudio allows you to buffer sounds to be played seamlessly, as well as eliminating the the overhead of creating/loading the sound files by instead letting you write sound data directly. Of course the nitty gritty of it takes a lot more than that and some specific knowledge, not to mention a lot of time to make and optimize. Using an existing js library is dependent on if one can be found and devising a way to use from C2, which is a time consuming task in and of itself.

    Converting to ogg is the fastest solution and gives the best performance since sound doesn't need to be generated.

    Ah, so you can't process the mod in realtime without webaudio? The reason I ask is the purpose for using mods is to adjust the speed of playback dynamically throughout the game (and to minimise filesize, but that's irrelevant), are you saying without webaudio, the module would have to be processed offline by the javascript library and then played back as a wav? Or could it still playback the module whilst being able to adjust the playback speed of the module in realtime by just playing a raw audio output, all without webaudio?

  • I have a few "for each" loops, and I also have a condition to check whether or not a tween is still running. If the tween isn't running, would this improve performance, or does the game still have to check the "for each" loop? Is there a way of disabling loops when an instance of an object is no longer needed to be tested (in this case, I have for each loops to make play sound effects , but when the sprite isn't moving, it wont move any more, so the loop testing will no longer be necessary).