tmntppn's Recent Forum Activity

  • I never had that problem. Seems like you have 2 chrome.exe? If you open a URL from shortcut, does it open the correct chrome.exe?

  • drive.google.com/file/d/0Bx4FqA ... sp=sharing

    Type the link without the '...' please.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure what are you trying to do too. Why do you want to repeat "on start of layout" trigger? These trigger usually placed in front of the other condition, example:

    on start of layout {
    	stop animation;
    }
    on object clicked {
    	start animation;
    	wait 4 seconds {
    		call function create_object();
    	}
    }[/code:16cjfw88]
    All those codes above inside the event sheet is repeated every tick by system default.
    
    You're asking about repeating several actions, but your illustration in the first post shows like you're repeating several condition.
  • Well to make it, you need to think about it.

    Specify your problem please.

    https://www.scirra.com/forum/tips-for-posting-in-the-quot-how-do-i-quot-forum_t62843

  • When I use the arrow to move..when it couches the grey border..it seems to go out a little then jumps back in..

    LOL... I did it on purpose as I thought it was fun and smother... <img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes">

    There are many ways you can adjust it. Just look at the big picture about how to detect your trigger (arrow keys) and validate the value before you make the move.

    Try this: https://www.dropbox.com/s/s68pe4hib7r18 ... .capx?dl=1 (this one isn't using the 8Direction behavior)

    I'm not sure what you intend to do with this, if you're going to make multiple objects and obstacle that aren't penetrable anyway, then adding wall objects and solid behavior will be much easier to do: https://www.dropbox.com/s/gmxpetto7mfsa ... .capx?dl=1

  • This is the closest I can get: https://www.dropbox.com/s/tetva39um81sj ... .capx?dl=1

    Enter the amount in the textbox. The error starting at n = 5, where the rounding (floor) will cause the difference.

  • Try this: https://www.dropbox.com/s/hor58fh29csb8 ... .capx?dl=1

    You can drag the green object with mouse or use arrow keys.

  • As chrisinfinger said, one weakness about overlapping condition is that it only measure "at least" overlapping. This means that you can have the object overlapping by a single pixel, while the rest is out of the square, and still considered overlapping. This depends on how you want it in your project.

    For example my project, I have a feature where the user can arrange a table layout in a room. This of course, cannot have a single pixel out of the square as the table would puncture the wall. In my case, I cannot use overlapping condition.

    I prefer with some comparison, as I don't want to add unnecessary object. Here's what I do (very simple actually):

    if (Table.BBoxLeft >= FloorObj.BBoxLeft AND
    Table.BBoxRight <= FloorObj.BBoxRight AND
    Table.BBoxTop >= FloorObj.BBoxTop AND
    Table.BBoxBottom <= FloorObj.BBoxBottom) {
    	[VALID LOCATION]
    	Table set animation frame to 0
    }
    else {
    	[INVALID LOCATION]
    	Table set animation frame to 1
    }
    [/code:3co0tcxe]
  • There are a couple of calculations and draw calls which need to be run sequentially. It use either wait for signal or wait 0 second (next tick) before running. Let's say it is possible to run things without waiting at all, but this will require whole lots of sub-events and it's going to be hard to manage (calling sub functions etc). Any suggestion to workaround this?

    Another thing that I want is to make a function, for example, to request a user input a pin number, then return the result 1/0 (success/failed) to the caller. Surely waiting for user input require a lot of ticks. Can this be done?

  • Thank you for your suggestion but the problem is not on the AJAX. I use AJAX a lot too and all already using its own on 'tag' completed. I never use AJAX on any completed. I've also been using a lot of signaling, so far so good.

    I've boiled down my problem and I think the problem is because the return value is only available after some ticks, so the caller already "expired", thus the return value is not returned to the right caller. So this probably is because of my method, not what I originally thought that return value applies to all functions globally.

    I run some test with 2 methods, a main body which call for 2 functions, and the function A and B itself, each wait for 1 second before returning the value (simulating this function requires some ticks to complete). Here's what I tried:

    -----FUNCTION A (NOT WORKING)-----
    function run_A {
    	wait 1.0 second
    	set return value to "result of A"
    }
    
    -----FUNCTION B (WORKING)-----
    function run_B {
    	set return value to "result of B"
    }
    
    void main() {
    	on button clicked {
    		set var A to Function.Call("run_A");
    		set var B to Function.Call("run_B");
    	}
    }
    [/code:33fw5n67]
    
    Result:
    [code:33fw5n67]A = 0
    B = "result of B"[/code:33fw5n67]
    
    I'm guessing that on my project, because both functions takes some ticks to complete, the return value isn't received by the caller. So my question is, how can I return a value that is not available at an instant or should I use other method than return value (static var and signaling perhaps)?
  • How about storing all related object's UID in an array, sort them, then pick one by one and set it to top?

    Probably 2 dimensional array, y(0) = Y coordinate; y(1) = object type ("sprite"/"tilemap"); y(2): UID. This way, you can sort by X axis and get the sort by Y coordinate.

    first store each UID in array;
    sort array by X axis;
    for each array x element {
    	if( array.at(array.curX, 1) == "SPRITE") {
    		pick [sprite object] with UID = array.at(array.curX, 2);
    		move object to top of layer;
    	} else {
    		pick [tilemap object] with UID = array.at(array.curX, 2);
    		move object to top of layer;
    	}
    }[/code:zpdjcf18]
  • The var value and pin is a sort of global object (in json form). Generally speaking, I'm trying to avoid setting the value directly within the function as this will makes it harder for me to manage the modules (I've use that method before but now I'm trying to do it more object oriented).

tmntppn's avatar

tmntppn

Member since 23 Mar, 2015

None one is following tmntppn yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies