nimos100's Recent Forum Activity

  • NWjs

    On folder dialog Cancel - Inverse version of "On folder dialog OK"

    On dialog Cancel - Inverse version of "On dialog OK"

    On save dialog Cancel - Inverse version of "On save dialog OK"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • while you might not think a capx is needed it is required even if it's simple for you to reproduce

    The reason not to upload a capx Is that it will take longer time to download and open the capx than it is to add the video object, set a video source and while its paused changed the playtime.

  • I decided to make a small test, hopefully it will illustrate the problem in full.

    Very simple program you press one button and choose an image to load. Press the other button, it load a "dummy" image and then the file where it was copied. (The suggested workaround) The wait was just to give it some time in case it had to update. But it makes no difference.

    Start:

    This is what the program looks like when its started and haven't done anything. The Nw.exe is from windows system.

    Test 1:

    I loaded a small image 64x64 and there are minor changes to NW.exe.

    Test 2:

    So I loaded in a 5000x5000 image and logically the NW.exe goes up.

    Test 3:

    So I press the second button, to load the "dummy" image which is also a 64x64 image (1kb) and use the copied file as my load from url. Now the NW.exe had pretty much doubled.

    Test 4:

    So I load a new one (64x64) however NW.exe are still using the same amount. And if I was to press the second button, it would switch back to the 5000x5000 image. Which could explain it.

    Depending on which order and what images I load. NW.exe will be either 126mb or 226mb. Even though you select another image as it goes back to use the old one. Its all a bit weird to be honest. Something with how the images are stored seems wrong.

  • Problem Description

    [quote:q63961jp]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?

    ************************* NEW *****************************

    Sorry that I reopen this again and that it gets a bit messy, but its a bit confusing when these bug reports are just closed, without even being tested.

    You wrote that this could be a workaround:

    [quote:q63961jp]There is a workaround though: load a different image in between. If you load "image.png", then load "dummyimage.png", then load "image.png", it will really load it again since the URL has changed every time.

    However I should have tested it to see if it worked. But now I ran into the problem once more and since the original bug report was closed and no answer to my question in it, I kind assumed that it wouldn't/will be fixed.

    So I tried the workaround that you suggested and it doesn't work. The image is stuck in memory or whereever it is stored until the application is restarted.

    This is crucial for my program that this is possible and im starting to run out of idea of creating workarounds for this, except having to redesign my program yet again based on all these weird limitations.

    So please reconsider my suggestion in the original post:

    [quote:q63961jp]Wouldn't it be possible to simply duplicate the "Load image from URL" and make one called "Load image from disk" which forces update and if you need to use it for web you use the first one and if its from the disk where internet speed is not an issues you can use the other one?

    Or some other way, don't really care how its done, Maybe as someone suggested in the "General" section, something that will force it to clear memory or something. I can see the idea of not having to load images all the time. But what is point of keeping stuff in memory that doesn't even exist anymore.

    *************************************************************

    Added from old post

    [quote:q63961jp]'Load image from URL' is asynchronous: the action only starts it working, and it completes later when 'On image URL loaded' triggers. During the loading you synchronously copy and overwrite the file that is currently being loaded. This effectively makes it random which image you load, depending on which the system manages to do first: read the file, or copy the file over it. Further reading and writing to C:\ normally requires admin permissions on most systems, which C2 games don't run with by default.

    If you still think there is a problem, please file a new bug report that has a clearly ordered sequence of operations, and doesn't attempt to read or write files to/from system locations that normally require admin permissions to access.

    [quote:q63961jp]UPDATE:

    I have moved the files to my users folder and the files are copied only in this directory. And the problem is the same. I think you might have misunderstood the problem as its a bit weird to explain. But you write that it "depends on which the system manages to do first".

    But its not relevant in this case, because the two things are not happening at the same time.

    Meaning, between the copy and actually using the URL from where it was copied to, I can wait 5-10 seconds or whatever before I even tell it to use that path, and it will still load the old image even though that image have been deleted from the hard disk. Also the files are 1.85kb in size, so it should be more or less instant regardless.

    The problem happened when you do it exactly the way I descripted in the old post, but ill try to explain it again.

    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:\Users\<Name>\Test\Test.jpg" Right clicking the image will load the image from C:\Users\<Name>\Test\Test.jpg.

    Steps to Reproduce Bug

    1. Double click one of the images and select a jpg file. The two images now uses the image selected through the chosenpath. At the same time a copy of the file is copied to "C:\Users\<Name>\Test\Test.jpg".

    2. Right click one of the images to use the URL "C:\Users\<Name>\Test\Test.jpg".

    3. Double click one of the images and select another jpg files than in step 1. The images now changes to this file as expected.

    4. Right click one of the images again to use the URL "C:\Users\<Name>\Test\Test.jpg" However instead of using the image from step 3, it uses the image from step 1, even though it is not at that URL anymore, and the image from step 3 is in that location it doesn't load it.

    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

    r202

  • You could make a "Check system" that would go through all pawns. Since you already know the position (Depending on how you made it of course), you should be able to store the values in an array as variables for each pawn, whatever you prefer.

    Board and there indexes

    (0,0), (1,0), (2,0)
    (0,1), (1,1), (2,1)
    (0,2), (1,2), (2,2)
    [/code:2zaip23m]
    
    So if you place a pawn on (1,1) you add that to a list.
    
    List:
    (1,1)
    
    Then you use this to check surrounding indexes. So if there is a pawn on 0,0 you add that one as well.
    
    List
    (1,1)
    (0,0)
    
    And you keep doing that until there are no more pawns to be found surrounding the index you are checking. And if the list have 5 elements you know that there are 5 pawns.
    
    However that will ofc not account for them being on a straight line etc. so you will have to make sure that is taken into account as well. And also you have to make sure that those pawns already on the list is not check vs again. 
    
    But in theory I think that should solve it.
  • Might not be 100% correct since its some time I checked up on it. But then someone can hopefully correct me

    But for character its best as I recall to make them with following dimensions, due to how graphics are loaded.

    So 8x8, 16x16, 32x32, 16x32, 256x256, 32x64, etc etc. Since graphics will take up space in memory using those sizes. However im not 100% sure so unless someone can confirm it, maybe just keep it in the back of your head or you can probably find some information about it on the web some where.

  • If I understand your questions correct.

    There are no "rules" regarding how many events sheets you should use. The reason why it can be a good idea is solely for organisation.

    Imagine you have a game with 2000 events all made in one event sheet and you are trying to find a specific event. It can take quite a long time to find. Especially if you are not 100% sure what you called it.

    So a good practices is to organize your events into event sheets, so you know where to find them. Since the amount of event sheet doesn't impact the performance of your game you can add as many as you like. An example of how it can be good to organize your event sheets could be something like this (This of course depend on the type of game you are making).

    Map generation (All events that you use to generate your map.)

    Map generation functions (This hold all functions that might be used. The benefit of adding functions to there own sheet is that they will never run per tick. So its both easier to find them, and you don't get them mixed up with normal events and triggers.)

    Player control (Hold player movement, attack, death, experience, level up etc.)

    Enemy control (The movement of Enemies, enemy attacking, death etc.)

    Enemy AI (If you need some more advance AI for enemies it might be a good idea to separate that from the enemy control, so it doesn't get to big.)

    Etc etc.

    And as with the map generation example it might be a good idea to add a Function version only for functions for player and enemy as well. But in general whenever you think that you can group functionality together into an event sheet, its probably a good idea.

  • That is normal, however think the way it works is only logic to C2 and not for the users as we wouldn't assume there was an overlap in such case.

  • Problem Description

    When using the video object and the video is paused it is not possible to change playtime. Only if Play is used afterwards or you do a workaround using a wait between a play and pause video. Which is not very convenient.

    Attach a Capx

    No need.

    Description of Capx

    Steps to Reproduce Bug

    Add video object

    Pause the video

    Change playtime

    Observed Result

    Doesn't change playtime

    Expected Result

    That it would change playtime even though the video is paused.

    Affected Browsers

    Tested in NWjs

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r202

  • 2D vector shapes, such as lines, boxes, circles etc. That can be manipulated through control points. That would be a very nice addition I think.

  • Thank you very much for your reply.

    Excuse me but I really did not understand it refers to.

    Could you elaborate a little more please?

    If you right click for instant "On left arrow pressed" you can inverse it. Meaning as long as "Left arrow is not pressed" it will be true.

    Since you need to test vs several key press at the same time, there are more options than simply to test vs one.

    So you have to add a "On left arrow pressed" and "On up arrow pressed, if you would like you character to jump to the left for instant. Like so:

    Left arrow is down
    Up arrow is down
    [/code:2ghh01d1]
    
    Since you also have one for moving left:
    [code:2ghh01d1]
    Left arrow is down
    [/code:2ghh01d1]
    
    Both of these will trigger if you for instant Jump to the left. Because moving left will trigger true whenever left button is pressed. So to make sure that it doesn't do that you can do like this:
    [code:2ghh01d1]
    Left arrow is down
    X Up arrow is down (Inversed)
    [/code:2ghh01d1]
    So as long as left arrow is down and up arrow is not, then you character will move left. So you have to do that for all the possible ways you want you character to move.
  • Not that I can tell you what is wrong, but it sounds a lot like some sort of bug. So if I were you I would try to post it in the bug section and maybe Ashley can clarify it for you. At least that my best advice

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies