nimos100's Forum Posts

  • Problem Description

    This might be a bit difficult to explain, because it makes little sense. But it appears that when you use NWjs to open an image and load it into a sprite using "load image from url", but at the same time copy the file to a new destination and tell it to use that one instead. And then load a new image it still uses the old image despite it doesn't exist anymore. Guess it might read it from memory maybe?

    Attach a Capx

    https://dl.dropboxusercontent.com/u/109921357/Load%20image%20from%20file%20bug.capx

    Description of Capx

    Allows you to select a jpg file and load it into a sprite. At the same time copying the file to "C:\Test.jpg" Right clicking the image will load the image from C:\Test.jpg.

    Steps to Reproduce Bug

    Will explain it with screenshots, otherwise it hard to explain and probably makes little sense I think.

    The code of the whole program. The global variable was an attempt to see if it was possible to only load an image into a single sprite. Which seems to not work.

    Double clicking one of sprites will open the NWjs dialog and I selected a image which is pure red.

    The image is now copied to C:\Test.jpg.

    1. To use this path I right click one of the sprites.

    2. Double click one of the sprites and load the second image.

    The second image is just green.

    Looking at the image copied to C:\Test.jpg have been updated to use the green one instead.

    Right clicking the sprites again to load from C:\Test.jpg makes them load the red image, even though the jpg file is the green one.

    This only happens after you have used "Load image from url" (Right click the sprite).

    The bug pretty much ruins the "load image from url" or NWjs open dialog depending on where the bug is. Would also be nice if you could pick which sprite it should load the image for, and not just all of them ignoring the picking.

    Expected Result

    That it would read the file from the path its told and not from maybe memory.

    Affected Browsers

    Don't know.

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r200

  • NWjs & Debugger

    Incompatible - While running your project in debug mode its not possible to open any NWjs dialog boxes. Might be considered a bug, but regardless, it would be nice if the debugger and NWjs were compatible.

  • NWjs & Video & File chooser

    Syntax consistency - Depending on what functionality you are using, there seem to be different syntax for how you work with files, which is really annoying to say the least. For instant using the NWjs.Userfolder will return the following: "\User\<Name>\"

    However setting the source for a video require the exact path "C:\Movie.webm". Which you can get using the open dialog in NWjs, but that require user interaction. Since there are no functionality that allow you to get just the drive letter, filename, or just the path to a location makes working with files a living hell to say the least, and this changes completely depending on what functionality you use.

    It is suggested in the C2 manual that you should use the User folder due to permissions, so it would make sense if all the file interactions also worked in a consisting manner, so you don't have to create a different workaround for each function depending on which one you use. Being able to get the drive letter of where a folder or file exist would be very useful. Basically just divided, into the separate parts that follows what you would expect when working with files on a computer. (Drive, folder, File).

  • Video

    Missing expression checks - Even though you can check whether a video object is in a current state such as muted, paused etc as an event. These options seems to not be available as expressions in the video section. If you use a "Compare two variables" it would make sense that these were also there, since its actually possible to check vs them as events. At the moment only 3 are available (Duration, PlaybackTime, Volume) so if (Has ended, Is muted, Is paused, Is playing) were there as well it would be nice.

    Source - Would be nice if you could get the source. Both filename and path to the file. And if there are no source it could just return -1.

  • Its a bug in C2 it seems. Pretty weird one, but I guess its because of the type of variable that is used by the global number and it probably goes out of range or something like that. For instant if you add 18 "1" it changes the last two numbers to 00 instead of 1's. And if you add 19 "1" the last 3 are changes to "200" inside C2 You should post this in the bug section, it doesn't have anything to do with your code.

  • NWjs

    Run external program - When there are spaces in the path it seems to cause problems. Since you have to execute the program using the syntax """C:\Test program\test.exe""". However this wont work if you read the path from a file or a variable, without having to make some weird work around. The only way to make it work as I see it, is to add a variable like: SpaceVar = """"" and add it to the file path, like so: "Run Application = SpaceVar & Filepath & SpaceVar".

    Would be handy if you could either read the path directly from a file or you could write it to a variable without this workaround.

  • Still weird you cant draw 2d shapes in C2, being a 2D game engine and all, its a bit funny, that it cant draw 2d shapes. I think

    Anyway, your problem is not uncommon I think and personally I would try to see if you could use the video functionality to do it. Even though it also have its problems, it might be better for performance.

  • Your captain have the solid behavior, so it get stucked on it self, you have to remove that behaviour then it works. Also i would highly recommend that you organize your events, its pretty messy and will cause you problems later on with 100% certainty

  • Most likely because it cant find a path, try to add a "Fail to find path" and see if that triggers.

  • This post is not aimed towards a single object type, but just in general when using different objects, it gets a bit frustrating that some things are missing which should be there in my opinion. As these are "minor" things you tend to forget them, so ill add them here as I find them and hopefully they will be added at some point.

    Objects:

    Video

    Frame rate - Would be great if you could get the frame rate of the video.

    Number of frames - Self explanatory, but the number of frames in the video.

    Format - there are other ways to get this, but would be handy if you could just get the format through a variable (Less important).

    Check vs Frame rate / Playbacktime - For some reason there are no way to check vs this.

    Play at FPS - Play a video at a certain fps, so you can make slow motion and fast forward.

    File chooser

    Path - There are no way to get the path to a file on local disk. Which is strange since you can get the filename.

    NWjs

    Filename - Opposite the File chooser object you can get the path including the filename, but there are no way as far as I can see that you can get just the filename.

    Sprite

    Add frame - Add a blank frame to a sprite

    Delete frame - Delete frame at index

    Insert frame - Insert frame at index

    Replace frame - Replace frame at index

    Fill frame - Fill frame with a certain color at index

    Erase frame - Erase frame at index

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ahh ok that cool, ill just keep an eye out for it. thanks

  • Problem Description

    Pinning textboxes while using drag drop behaviour on a sprite or 9-patch will cause the text to "fall" out of the textbox.

    Attach a Capx

    [attachment=0:2ctq5zbq][/attachment:2ctq5zbq]

    Description of Capx

    Two textbox pinned to a 9-patch with drag drop

    Steps to Reproduce Bug

      Drag 9-patch Observed Result Text falls out of textbox.
      Expected Result Well.... Affected Browsers
      • Chrome: (YES and NW.js)
      • FireFox: (Don't know)
      • Internet Explorer: (NO) But the textboxes are all over the place, trying to keep up with the 9-patch, but the text stays in place.

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r197

  • Would it be possible to expand this or add an additional action that add the image to the animation rather than replacing it?

    Because at the moment you have to do some really silly work around to make it able to read an image file from the disk through NW.JS as it keeps overwriting the current frame, which means that if you don't know how many you need, lets say you were making a light box application for instant, you have to add a lot of empty frames and cycle through them, when adding new images so they don't get overwritten all the time.

    Alternatively maybe an action that could add an empty frame to a sprite or just duplicate the last one or something like that.

    Cheers

  • ok I see your points, appreciated, thanks for that

  • There are no easy way to do it in C2, at least that I know of. But there are lots of way you could go about it regardless.

    For instant what I can just think of might be the easiest is to make a dummy sprite. Then right before you have to check for LOS you set dummy position to the to the target position and then you store the UID of the target Fighter with the dummy so you can easily pick it again later should you need it. Then you check LOS vs the dummy instead.

    Or you can do it the other way around which is probably even better, set the dummy to the one you want to check LOS for, and then do a:

    Dummy.Test_UID = Fighter.UID

    Fighter.UID <Not equal> Dummy.Test.UID //That will select all fighters except the one you want to check LOS for.

    Dummy check LOS to Fighters

    That is two ways to go about it, the last one is probably the best one in my opinion.