phlp's Recent Forum Activity

  • Use the Local Storage plugin.

  • That is exactly the behavior I expected and did not get. After running the project in Preview once, trying to change the import and event sheet gives an error:

    Or, going the other direction:

    Changing to import * as Main first, running in Preview once, and then using Undo to go back to import {GetMessage} and running in Preview again works fine. I can Undo/Redo back and forth and it will run, but changing it back by typing it out breaks it again.

    I guess this is a bug then. I'll submit a bug report when I get a chance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using this example from the TypeScript tutorial, GetMessage can be imported from main.ts with either

    	import { GetMessage } from "./main.js";
    

    or

    import * as Main from "./main.js";

    However, once this is done one way, switching to the other, or changing the name for the module, seems to be impossible.

    Is there a way to force importsForEvents to update? This does not seem to be a problem in JavaScript, only TypeScript, and the only workaround I've found is by converting to JS then back to TS.

  • At a glance, it looks like you're checking an instance variable uniqueId of player_hitbox, but setting a different instance variable playerUID.

    If that isn't the problem, I would suggest outputting all of the variables you're comparing to see why they may not be lining up.

  • You can make a shooting mechanic that will shoot lines.

    1) Add Bullet Physics behaviour to the line

    ...

    This is a good and clever solution.

  • Why not use the Tile movement behavior?

    Alternately, you can use Is overlapping at offset.

  • Basically, what dop2000 said. Fortunately, the Date object provides some useful expressions for this:

    1. Get the last reset timestamp
    2. Check if the difference between current timestamp and last reset is greater than 7 days. If it is:
      1. Do the reset
      2. Set another variable to a copy of the current timestamp, call it monday
      3. Set monday to Date.ChangeDay(monday, 1)
      4. Set monday to Date.ChangeHours(monday, 0)
      5. Set monday to Date.ChangeMinutes(monday, 0)
      6. Set monday to Date.ChangeSeconds(monday, 0)
      7. Set monday to Date.ChangeMilliseconds(monday, 0)
      8. If the current day is 0, subtract 1 week
      9. Save this as your new last reset

    Let us know if that works.

    • Post link icon

    Have you tried using the Bullet behavior with "Set angle" disabled?

  • Is that not the same thing?

    I thought "over time" meant gradually, so a value of 10 would mean rotating some amount between -10 and 10 degrees either per second or per lifetime of the particle. Obviously this can be done using objects, it's just the description that was unclear to me.

    Thanks Ashley for explaining all this.

  • You could add a second object with the same sprite as the player, placing it relative to the second portal whenever the player is overlapping the first portal. Then use a blend effect (probably "source in" with another sprite for the inside of the second portal) to cut off everything not inside the portal.

    This method would not use the drawing canvas but would have the desired effect.

  • You can already do this with the object spawning mode, and adding every spawned object as a child of the emitter. Here's an example.

    Playing with this example, I noticed some things that seem strange to me.

    • When using an object (ParticleSprite) and "Continuous spray", the angle of the particle is set to the angle of motion. Without an object, the particles are drawn with an angle of 0.
    • With "One-shot" and an object, the angle is randomized and, again, without an object they are all 0.
    • When using the sprite as an object and "One-shot", if the initial size is randomized and the grow rate is negative, the particles will flip to a negative size and continue to grow. This does not seem to happen if not using an object or for "Continuous spray".
    • None of the above is visible during the editor preview.
    • "Angle randomiser" claims to apply a deflection over time, but it adds a random angle every tick.

    Are these the intended behaviors?

  • If in event sheets, you'll have to declare and pass a local variable to a JS action. Let's say it's a string called num:

    let num = localVars.num;
    let string = "";
    for (let i = 1; i <= num.length; i++) {
    	string = num[num.length - i] + string;
    	if (i < num.length && ! (i % 3)) string = " " + string;
    };
    localVars.num = string;
    

    Then set your text to num. If it's not already a string, you'll have to convert it first.

    Basically, copy the string (number) starting from the last digit and adding a space every 3rd digit, unless it's the final (first) digit.

phlp's avatar

phlp

Member since 19 Apr, 2023

None one is following phlp yet!

Trophy Case

  • 2-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Lightning Draw First person to up-vote a new Construct 3 release
  • Email Verified

Progress

7/44
How to earn trophies