DrDeleto's Forum Posts

  • 15 posts
  • Thanks, Ashley!

    Maybe I'm the only one who had to refactor because of this change, but in case anyone else is in this situation, instead of calling the function for its functionality (which was more than just its return value) and then using Function.ReturnValue in subsequent conditions to harness its return value, I did a conditional check of the return value which also performs all the function's other actions at the same time. In one case where I needed that value multiple places, I saved it in a local variable. Probably all obvious, but thought I would lay out my solution.

  • The new built-in functions are excellent! I think this design is overall much more usable and tidy.

    First question: The old functions used to be able to check the Return Value of the last-run function with "Function.ReturnValue". Is this no longer possible with the new built-in functions? It always felt slightly kludgy to me (with the non-specific reference to a function just based off of it being last), but I did end up using it here and there. Is there a suggested method for doing something similar with the new functions?

    Second question: I'm finding that not all built-in functions I've created show up in the "Add 'Functions' action" window when I am trying to call them. Is there something that would cause one to not be shown on that list, or is this just a bug?

    It just occurred to me that maybe my questions are related: Are functions with return values not able to be called as an action, but can only be used in expressions?

    Tagged:

  • Thanks for your help, Mikal! That worked!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When I hit the button in the timemap bar to "Load tilemap from .tmx file" (I've created one in Tiled), then in the dialog box's first field I select my .tmx file, I get the error:

    Missing image on tileset

    Construct 3 requires an image to be defined in the tileset

    Anyone know what this is having a problem with?

    Perhaps part of the issue is that I'm getting confused by the terminology. In Tiled, I created a map (a set of tiles arranged to make a playable game space) and that's what's saved as the .tmx. In order to make that, I made a tileset (saved as a .tsx) that has all the tiles I'm building with in it. In Construct, I create a tilemap object. Is the "tilemap" the equivalent of the map in Tiled, or the tileset? Best I can tell, the tilemap is the map, and the tilemap source image is the tileset? Does that sound right? Figured if I'm mixed up here, it might help me understand what's not working.

  • I wish I could say the latest version is better, but it's not. I'm running with autosave off and it greatly reduces both the frequency of the slow-down and the severity of it, but it still happens occasionally. I would guess that there's another feature that does something similar to the autosave that conflicts with the Steam.dll (or whatever is happening). I recently upgraded to Windows 10, and it behaves the same way I remember it behaving before the upgrade. Glad yours is better, g3nki!

    Here are my system details in case they can help:

    Operating System: Windows 10 Home 64-bit (10.0, Build 10586) (10586.th2_release.160126-1819)

    Processor: Intel(R) Core(TM) i5-4690K CPU 3.50GHz (4 CPUs), ~3.5GHz

    Memory: 16384MB RAM

    DirectX Version: 12

    Card name: NVIDIA GeForce GTX 970

    Chip type: GeForce GTX 970

    Display Memory: 12171 MB

    Driver Version: 10.18.13.6175

    Construct 2 (r221) Personal Steam version

    Autosave: Off

    Backup: On

    Cache Icons: On

    Theme: Default

    Virus protection: Windows Defender

  • Just want to add that I have been struggling with this issue for more than a year. Clearly it's some issue with the integration of Construct 2 with Steam. It's not surprising that neither Valve nor Scirra would want to take on the burden of investigating and fixing it, and I totally believe that Valve is mostly unresponsive to developers now that they have so many products on the service. Still, it's unfortunate that no one will help the many customers who have legitimately purchased the software and want to put it to use.

    I don't know that I can add anything to the technical conversation, but I will say that it seems to me that it's really the display of the application that becomes sluggish, not the actual operation of it. By which I mean that if I click on anything or scroll my mousewheel it will actually be registered by Construct, but the display doesn't update until after a long delay or if you minimize then maximize the window. Even then, I usually have to bring another fullscreen window up over Construct and dismiss the new window again to get the Construct window to draw normally again. It's gotten so that I can do this process in my sleep, but it's frustrating how often I have to. Turning off autosave seemed to help for me at one point, but it seems less effective than it was at first; maybe there's something else I'm doing that triggers it.

    On behalf of Steam Construct 2 users everywhere: I know that Construct 2 is getting further and further in the rear view mirror, and that the Steam application has always been the red-headed stepchild version, but you have a crippling workflow issue being experienced by legitimate customers who paid you a significant amount of money. I think it deserves putting some real effort into it. I'm sure it will take action from both Scirra and Valve to sort it out since clearly the source of the problem isn't obvious, and I know that might be a nigh impossible channel to open and coordinate. But as it is, both companies are letting their customers down.

  • Problem Description

    Attempting to Stop Loop on a For each element loop on an array, but it continues the rest of the loop.

    Attach a Capx

    drive.google.com/file/d/0B7Gu37yDX14xdTIyc1p1VnJjYjQ/view

    Description of Capx

    I've made a simple array with a list of Thingees and a Weight for each. I'm trying to randomly pick one based on the weights. (In my example the weights are all identical.) When you click the GO button, it loops through all the weights and adds them up to get the total, then picks a random number between 0 and that total. Then it loops back through the array and subtracts each weight from the random number until the number is negative. If it is, the loop should stop and return the Thingee associated with the current weight's row.

    (Note: I think I've found a work-around that is probably a better way to achieve my goal, but this still seemed like a bug. Also, I know selecting things with weights is a common programming problem and I don't claim to be an expert, so there might be a much better approach. I wouldn't mind advice on optimizing my approach if it comes to mind when reviewing my code.)

    Steps to Reproduce Bug

    • Click the button and view the output.
    • If the random number picked is greater than 20, then the loop will stop properly on the last item. If this happens, click GO again to retry.
    • When the random number is low enough that the loop should stop on the first or second item (because it becomes negative), the loop is supposed to stop. The text display will say "Stop Loop!"

    Observed Result

    Even if a Stop Loop action is fired early in the loop, the loop will continue through all three elements.

    Expected Result

    When the random number is decremented below zero, and the Stop Loop action is fired, I expect that the rest of the actions in the set will fire, but the loop will not continue to the next element.

    Affected Browsers

    Tested on Chrome

    Operating System and Service Pack

    Windows Vista (latest service pack)

    Construct 2 Version ID

    Release 200, 32-bit, Steam version

  • Disappointed there haven't been any responses to this question, as I'm having a similar problem. I shared my game with friends and found that the button text sometimes fits in the button boundary and sometimes doesn't, depending on their browser and screen size. The Auto font size option seems to be useless, since it might scale to the layout size, but it doesn't scale to the button size (as my friend notes above).

    Websites seem to do this all the time, so how do you make a larger button with larger text whose text also scales?

  • Update: So I solved my problem by using the RandomArray plugin created by a community member. () Thanks Joe7! The 'scramble' action lets me get around the Clear that breaks my old solution. Still might be worth the time of someone knowledgeable to see if what was happening is intended behavior for Construct.

  • Can a dev investigate this? The more I mess with it, the more I think it is a bug or at least a strange timing problem. Clearing the RandomArray should make it all ready to get populated again. But instead it hangs. That Clear command is definitely the culprit, or at least the key event that breaks something on reload that is fine the first time.

  • Thanks for your help, guys. I tried the global variable approach, but I still get a hang when I try to run through the randomization part. codah, your capx doesn't hang, but it doesn't randomize when the layout reloads either. One tricky part is that I need to trigger the randomization to happen only once after the level starts (whether it's the first time or after the reset), but the first time that trigger is the AJAX finishing the load and subsequent times it needs to be... something else. Just tried it with a function call: the AJAX load calls the function and sets the global variable true, and the On Start will call the function itself if the global variable is true. I think that solves the triggering problem... but then it hangs again.

    Frankly, I don't think the AJAX load is the issue, although I could be wrong. It's something with the Randomizer Array. I know that While loop is prone to cause hangs if it's not set up right. But I can't figure out how I would get to that loop and not then have it carry on and do the randomization (which should eventually kill the While loop when there are no more empty cells).

    Would love to hear any other thoughts. Thanks for the help so far. (And thanks for the log trick, codah. That helps in this case where there are so many triggers and I can't use breakpoints.)

  • Okay, bear with me: my situation is a little complex and I don't know which piece is breaking it.

    I am attempting to randomize the items in an array after it is populated via AJAX from a JSON file. To do that, I have created a separate array that I populate with random integers, ensuring no repeats. Then I put those values into place in the first column of the array I want to randomize. This has all been working well for me (although I'm open to suggestions on how to do it better!).

    Where the problem comes in is when I want to reset the layout. I can't get it to re-randomize. The randomizing array keeps all its values (and I randomize by continuing to fill it until there are no more 0s left) so the array I'm shuffling gets an identical shuffle to the last time.

    Seemed like the easy solution was to clear the randomizing array so it is full of zeroes again. But for some reason, this hangs the browser. I'm not sure if my logic is bad and I'm missing some error I've made, if the AJAX load (or something else) doesn't work like I expect with the layout reset, or if it's a bug.

    drive.google.com/file/d/0B7Gu37yDX14xTmFaWXNkODNRY1E Here is a .capx that extracts the relevant pieces from my current project. If you enable the disabled line at the end, you'll see the hang.

    Ideas?

  • I've been making an isometric game and using 00rez's Pathfinder plugin. However, it uses the visual extents of an object as a blocker and I need to use the collision polygon instead (since an isometric view projects tall objects up, but you only want the bottom of an object to block pathfinding).

    Kyatric--Does your plugin use the collision polygon to eliminate A* nodes from the valid pathing space? Sorry, I can't tell from the examples given.

  • I definitely confirmed that the visual extents are used for pathfinding with this plug-in currently. Does anyone know if Rez is still updating his work?

    If not, I believe there's another Pathfinding plug-in by another contributor. Can anyone tell me if it operates any differently or has any other issues/advantages?

  • Rez, great plug-in. Thank you so much!

    I'm working on an isometric game, so I need my pathing characters to go walk behind any walls while only pathing around the base, where the walls touch the ground (which is where I have my collision poly). It definitely appears to me that the visual extents are what's blocking the pathfinding, not the collision poly. Can anyone else confirm this? Pretty sure I have the latest version (1.0, which I got from the top post in this thread).

    Also, is there some way to determine if a path is unable to get to the destination? That is, a way to test if the character is blocked?

    Thanks!

  • 15 posts