dop2000's Forum Posts

  • Create a function, call it only when HungryScore is changed, and put all checks inside the function. This way they will not run on every tick! And you will have a single event where all changes to the HungryScore are handled, not a hundred of events all over the project, which will make debugging a lot easier.

    This is just an example of what it may look like, don't copy it to your project:

  • This is what I'm trying to explain to you - when an event runs on every tick (the one highlighted on your screenshot), all its actions are repeated 60 or more times per second! That's why your animation is constantly restarted.

    And never use "wait" action in such events! Because all actions after the "wait" will continue repeating many-many times even after the event is no longer running, resetting the variable.

  • Yeah, many of the events could be optimized with families and functions. And you still have way too many events that run on every tick. It must be a nightmare to debug.

    Here is how you can optimize eating event - add all food sprites to a family. Move DragAndDrop behavior to the family level. Add burpAmount and fartAmount variables to the family. You can specify different values for each food type in these variables.

    Then you could have a single event for eating. Notice that the BURP and FART checks are nested under the main event and are not performed on every tick.

  • What do you mean by "replace the existing teams.txt"? You can't physically replace a project file with some other file in runtime.

    What you can do is ignore the project file and load the data from the file provided by user.

    If you want to save the data between sessions, you will need to save the list of teams (either from the project or provided by the player), say, in Local Storage. Then the logic could be something like this:

    On start of the game:
    
     If Local Storage has saved data -> Load teams from Local Storage
     Else: 
     ...Ask if the player wants to use standard teams
     ...If yes -> Load from teams.txt
     ...Else -> show FileChooser dialogue and load from selected file
    
    
    At the end of the session/level -> Save current teams in Local Storage
    
  • Could it be with an extra behavior and control the x position at all times?

    I'm not sure what you mean. Could you share your project file or a screenshot of events?

  • All your events run on every tick (repeated 60 times per second or even more). What's even worse is that you are using "Wait" action in such events. This means that the delayed actions will continue to run for 1 second even after the condition has become false, changing variables, stopping audio, changing animations. This will very likely break your game!

    All these checks can and should be performed in the same event where the hungryScore is changed - simply add sub-events. Then you won't even need that boolean.

    // Main event
    Character on collision with Food: Subtract 1 from hungryScore
    
     // Sub-events
     If hungryScore=1 : do this
     Else If hungryScore=2 : do some other thing
     Else If hungryScore=3 : do something else
    
  • FileChooser Click action only emulates a click on this object. You still need to wait for the user to pick the file they want to load.

    So you can't put AJAX Request immediately after that. You need to use "On changed" trigger and request the selected FileURL, not "teams.txt":

  • Hi Ashley, Thanks for considering this!

    I found this project:

    github.com/actions/stale

    If I understand correctly, by setting days-before-stale=365 and ignore-updates=true, all issues would be unconditionally marked as stale after a year. And it’s possible to auto-close stale issues as well.

    However, I'm still unclear about your approach to popular suggestions with lots of votes. Are you reviewing them regularly throughout the year, or only before the annual purge/archiving in January? What should people do if their idea has received lots of votes but ends up being closed after a year without any feedback from you?

  • Thanks for the reply, but I don't want a mirrored depending on rotation

    It won't be if you use Sprite.Pathfinding.MovingAngle expression.

  • No, you need this API:

    github.com/PsychoGoldfishNG/NewgroundsIO-JS

    Download NewgroundsIO.min.js script from Dist folder and add it to the project. Set its purpose to "Import for events". Then you will be able to use its methods. For example:

    	NGIO.init("39685:NJ1KkPGb","qsqKxz5dJouIkUNe3NBppQ==", {
    		version: "1.0.0",
    		checkHostLicense: true,
    		autoLogNewView: true,
    		preloadMedals: true,
    		preloadScoreBoards: true,
    		preloadSaveSlots: true,
    		debugMode: false
    	});
    	
    	NGIO.unlockMedal("name");
  • Event #3 is wrong, this is not how you use raycasting. Have you seen the official example?

    Instead of the overlapping check you need to use "ray intersected" condition. And set the laser width to LineOfSight.hitdistance

  • You can compare Sprite.Pathfinding.MovingAngle

    + System: Sprite.Pathfinding.MovingAngle is between -90 and 90 degrees
    -> Sprite: Set not mirrored
    
    + System: Else
    -> Sprite: Set mirrored
    
    
  • You can add 10*60*1000 to the clock variable every 1 second - this will equal to 10 minutes in milliseconds.

    Then convert that value to days/hours/minutes using Date expressions. For example Date.GetHours(clockVar) will return the number of hours.

    See the official example for the Date plugin.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • howtoconstructdemos.com/using-a-sprite-to-invoke-open-file-dialog-and-a-workaround-for-filechooser-bug-c3p

    Use "AJAX Request URL" action. Also I really recommend studying the documentation and a few tutorials. Many of the questions you ask are pretty basic.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/ajax