Grimmy's Forum Posts

  • I have a bunch of numbers in my JSON data array like so...

    "achievements_unlocked": [ 9, 5, 4, 6 ],

    Is there an easy way I can sort these numerically? eg(4,5,6,9)

    Cheers

  • SOLVED:

    Change the line:

    JSON_MAIN: Set JSON_MAIN.CurrentValue to 9999

    to

    JSON_MAIN: Set JSON_MAIN.Path to 9999

    (which actually changes the value of the current path)

  • I am looping through a bunch of JSON values and if a value equals 1 I am trying to set it to 999 by using set JSON.CurrentValue.

    However, when I print the current value straight after this 'set' command it still prints as 1.

    here is the code as text..

    + JSON_MAIN: For each entry in "profile_"&Current_Profile&".achievements_unlocked"

    ----+ System: JSON_MAIN.CurrentValue = 1

    -----> JSON_MAIN: Set JSON_MAIN.CurrentValue to 9999

    -----> Browser: Alert JSON_MAIN.CurrentValue (This Alert prints 1???? I expect 999)

    Anyone know what I'm doing wrong?

    Thanks

  • Yes it was. Thanks for that ! :)

  • I have an object which is instanced in 2 layouts.

    When I try to delete one it says that this is the last instance of the object. ANd it goes on to delete it in both layouts.

    Is this expected behaviour? I want to just delete the individual occurrence in a single layout.

    Thanks

  • Perfect. Thank You!

  • I understand that I need to do the following type of thing (see events below), however what angles should i be looking for when swiping left. Swiping right is always somewhere between -10 and 10 degrees(weird numbers) but left seems to be either something positive like 180 or something completely weird like (minus) -165

    + Touch: Is in touch

    ----+ System: Touch.SpeedAt(0) ≥ 200

    // Swiped Left

    --------+ System: 190 ≤ Touch.AngleAt(0) ≤ 170 //WHAT ANGLES SHOULD I BE LOOKING FOR (these are wrong)???

    I would expect 90 degrees to be right and 270 to be left , but there seems to be some angle craziness going on.

    ?

  • I couldn't find any in the help and it would be most useful.

  • Cancel that I found it. I use..

    -> DrawingCanvas: Paste object UserMedia without effects

    at the instant I take a photo and it works..

    I have no idea why UserMedia takes 3 seconds to do exactly the same thing. I'll just use this instead.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm, any idea how I do that? I cant see any relevant actions.

    I tried Save snapshot then On Snapshot>Load Snapshot to canvas but it doesn't seem to do anything?

  • I want to take a snapshot and show a preview of the shot taken. However, on device it takes a few seconds for the snapshot to be ready after taking the shot.(On PC this works instantaneously)

    So, In the meantime I would like to 'freeze' the camera view in the same frame otherwise it becomes confusing when you take a snapshot and the result of the shot it spits out is something that doesn't correlate to the current display of the camera. Is it possible?

    Note: if there is a way to speed up the time it takes between UserMedia.SnapshotURL. TakeSnapshot and OnSnapShotReady that would be preferable (Currently it's at about 3 seconds on quite a high end android)

    Thanks

  • I have exactly the same issue. It seems like a very long delay (3-4 seconds). Setting the JPEG quality to 0 has no affect on the speed either.

    Did you find an answer?

  • I understand but there are a some points to consider:

    -Even when I do my Network stuff on Android the connection always reports success regardless of whether it fails or not.

    -There is a disparity between the PC version and the Android version.

    For example: the following works fine on PC but reports always connected on Android with all wifi/mobile data disconeccted..why?

    var xmlHttp = new XMLHttpRequest();
    	
    	//alert("Csxsxs");
    	xmlHttp.open( "GET", "https://www.pigobo.com", true );
    	xmlHttp.setRequestHeader("Access-Control-Allow-Origin", "*");
    	xmlHttp.send();
    	
    	
    	xmlHttp.onreadystatechange = function(e) {
    	
    		if (xmlHttp.readyState != 4) {
    			runtime.callFunction("Change_Connection_Status",0);
    		 return;
    		}
    
    		if (xmlHttp.status == 200) {
    			runtime.callFunction("Change_Connection_Status",1);
    		}
    		else
    		{
    			runtime.callFunction("Change_Connection_Status",0);
    		}
    	}
    

    TBH what consists of online or not is really a design choice I should be making but the issue is that when this kind of thing is happening I am unable to carry it out consistently on different devices (PC or mobile); which is probably the real issue.

    That said, if this question can be answered then I'm a happy..

    Is there a consistent way I can check if my app can connect to a specific website (on a mobile device) and return success/fail?

    Cheers

  • I tried that too but it didn't work either. From what I remember it always returned the same on device.

    I think it was already reported as a bug but I don't think it was addressed There is a report here: github.com/Scirra/Construct-bugs/issues/3087

  • As an exported debug apk on device it doesn't seem to work. Does it work for you like that?