oosyrag's Forum Posts

  • The problem is in your load target.

    You did nwjs.AppFolder&"data/mydog.png" , Windows uses \ for directories, so it should be nwjs.AppFolder&"data\mydog.png".

    To debug, I recommend adding

    On Layout Start - Set Textbox Text to nwjs.AppFolder&"data\mydog.png"[/code:257wngew] to make sure you have the exact file path correct.
    
    The saving image is as R0J0 described (with small modification)
    
    On click
    --- set viewport size to sprite.width, sprite.height
    --- scroll to sprite
    --- snapshot canvas as jpeg
    
    On snapshot
    --- wait 0
    --- browser: invoke download snapshoturl
    
    Make sure your textbox overlaps the sprite or it will get cut off.
  • All you need to do is make a second set of controls that do.... something.

    Your requirement is vague.

  • Use an expression - random(x) gives you a random number between 0 and x.

  • A popular option is dropbox.com

  • A capx would be useful to help troubleshoot your problem.

  • I see it stuck on my system as well. Have you confirmed when you load the same project with 216 it works fine? Try downgrading and exporting again. Maybe it is a bug you found, try on the bug forum.

  • Again, how are your roads being created/placed? For example if it is like tetris where a player gets a random piece of road to put down, that distance could be already associated with that piece of road as an instance variable. Or you can use sprite width/height. Or you can calculate pixel distance with imagepoints. Depends on your project.

    Edit/Disclaimer: I'm no expert on pathfinding, so if anyone knows better please chime in

    You can search online for pathfinding algorithms, it is a VERY common problem in the history of programming and well documented as well.

  • Experiment a bit first! You'll be surprised at how far you can get with 100 events.

    Generally speaking, most people do run into performance issues sooner or later, but nearly all of these problems have to do with how they set up their code (loops) and how they make use of their graphics in terms of resources/memory (too many/large sprites and objects). It is rare for projects to get to the scale where the chrome wrapper will make a noticeable difference in performance.

  • I think R0J0 answered pretty clearly in the Paster thread, it definitely is possible even without plugins.

    Which part exactly are you having trouble with? Do you have a .capx you can upload so we can see what you've gotten so far and help troubleshoot?

  • I think you're in the very advanced problem zone =P

    How are your roads placed? Are there constraints like do they need to be connected at ends only, is there a limit to how many roads per intersection?

    When you create an intersection, you'll need some information there including which direction each option is in, and how long that road segment is.

    Basically every time you place a road, you will need to add information at the intersection it was placed on.

    You'll also need to create your own pathfinding - A "simple" pathfinding algorithm would find every possible path to the destination, and compare the total values (length?) of each segment of road to pick the path with the lowest total number. This algorithm should record which road to take at each intersection in a variable or array, which the car then references to make its drive.

    Given that your roads are straight, you can have the car angled at the same angle as the chosen road and have it move forward until it hits another intersection.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are several inventory posts in the FAQ stickied in this forum, as well as a lot of people asking for more specific advice if you search for it..

    how-do-i-frequently-asked-questions_t63692

    search.php?keywords=inventory&fid%5B0%5D=147

    There are also quite a few inventory tutorials in the tutorial section.

    https://www.scirra.com/tutorials/search?q=inventory

    Most inventory systems are based on an array. There are many ways to display what is in the array or to change the size of the array.

  • This can be a simple fix or a very very advanced problem depending on what exactly you need. You'll need to be more specific, or post a capx. Are your roads straight? How is your car being controlled? Are there multiple paths to the destination?

    This is a quick trick - make an invisible sprite at each intersection. You can use these invisible sprites to check for collision with the car and do an action when the car reaches the intersection.

  • Sorry I didn't answer your question of how to get it to work, I only told you why it doesn't work =P

    Not sure if this is the solution, but try changing the variable before the wait, and use sub events

    Check line of sight - Change to Shooting
    Is Hiding           - Wait 2
    
           Check line of sight - Fire
           Trigger once        - Wait 2
                               - Change to Hiding[/code:3qcekd1b]
    
    (EDIT: Formatting)
  • Wait doesn't prevent your second event from going off every tick.

    So in that 2 seconds you are waiting, that second event will keep running, and keep queuing up the action to set state to shooting. After 2 seconds is up, for the next two seconds it will keep setting SpecificState to "Shooting"

    Your third event only runs once, right when the first 2 seconds is up. It shoots and sets the state to hiding. But the previous action was queued up for 2 seconds more and keeps setting the state back to Shooting. Since your third event has trigger once, you never get to set SpecificState back to hiding.

  • An array is already global, so the data in them does not get reset when changing layouts. For non global objects, you can use https://www.scirra.com/manual/161/persist

    JSON is useful when writing array data as a single string to use to save to a variable, file, or local storage.