R0J0hound's Forum Posts

  • I think the default is mouse.x just grabs the bottom layer. I think it would be complicated for construct to automatically guess what layer to grab the position from or it may just be impossible most of the time to make a good guess.

  • You can use the enable/disable collisions action of the physics behavior to do that, at least somewhat.

  • I can't open your project, but would being able to get the mouse position on different layers help?

    You can do that with the mouse expression Mouse.X(layer).

  • Glad you were able to figure it out. Invisible trailing spaces and new lines are pretty hard to spot.

  • I think we are limited but what modules are included in nwjs. Unless you know how to add more?

    Running regedit to find the documents folder is one option. But seems messy.

    There is a winapi function that you can use to get the location of the documents folder, but it's only accessible from c. Or we could get it with the node ffi module if it was included with nwjs.

    Anyways here is the source of a simple c program that just prints the users documents folder location.

    getDocumentsFolder.c

    #include <stdio.h>
    #define CSIDL_PERSONAL 5
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>
    #include <tchar.h>
    
    int main()
    {
    	TCHAR DocumentsPath[MAX_PATH];
    	SHGetSpecialFolderPathW(NULL, DocumentsPath, CSIDL_PERSONAL, 1);
    	wprintf(L"%ls", DocumentsPath);
    	return 0;
    }

    To build that with the tiny c compiler

    tcc getDocumentsFolder.c -l"shell32"

    Then to run it you need to run basically this javascript:

    require("child_process").execFileSync("getDocumentsFolder.exe",null,{encoding:"utf8"})

    Basically it synchronously runs a file and returns the output of the program as utf8 text. I had to modify it slightly as it needs the full path of the program.

    Anyways here is my test of it working in nwjs from c2. It only works on export at the moment though. It includes that exe compiled from the source above.

    dropbox.com/s/cpwuxmmj7ekocxx/nwjs_getDocumentsFolder.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The sampling method affects how the textures are blended. Hence the nice anti-aliased lines on the textures on the 3d shape. The 3d shape itself is drawn with triangles and the edges come out aliased like that. I don't think there's a solution within construct other than a layer effect to blur it or something.

  • Looks cool. The fact you used it for your own projects first is a good sign its well fleshed out. I know in the past I often released plugins too soon and had design issues later. I'm especially intrigued with the binding of other objects. Sounds like a handy way to do things in a slightly higher level way.

    -cheers

  • Look at the date plugin. With that you can access the computers real clock. I think the basic idea is you'd save a timestamp to local storage when you close the game. Then when you run you game again, it compares that timestamp with the current time to see how much real time has passed.

  • You do not have permission to view this post

  • Me too. This isn't a beginner project. Here's one attempt that will find if two clicked on tiles have a free path between them with no more than two bends.

    The idea is when you click on a tile it marks spots horizontal and vertical from the tile that are free. The same is done for the second tile. Then each pair of spots is looked at. If a pair is found to be horizontal or vertical, and there are no tiles between them then we have a free path. The final step is to draw a line from the tiles through the spots.

    dropbox.com/s/h4nmjc95i8r11wu/onet_test.capx

    Maybe some ideas can be gleaned from that. It has some limits and I won't work on it further.

    I think there was a previous discussion that utilized a pathfinder to find the paths too. I forget if anything came of that.

  • The trick is you need to check the positions from where you start dragging to where you want to drag to and stop short of the first overlap. As is the drag and drop behavior teleports the object so the 8dir collision response will only push out the closest direction and has no knowledge if it jumped through walls.

    One possible way:

    dropbox.com/s/73awi7luxpqyji7/drag_notThroughWalls.capx

  • It's using 8direction.speed in events 3-6 when setting the offset. That's fine when only moving in one direction but when going diagonal it's too fast. You should use vectorX and vectorY instead.

    I won't salvage that example though. One every tick event should do it. The first part sets the offset and the second part corrects it when negative because of how % works.

    every tick
    set x offset to (Self.ImageOffsetX + Player.8Direction.vectorX* dt) % Self.ImageWidth
    set y offset to (Self.ImageOffsetY + Player.8Direction.vectorY* dt) % Self.ImageHeight
    set x offset to Self.ImageOffsetX<0?Self.ImageOffsetX+Self.ImageWidth:Self.ImageOffsetX
    set y offset to Self.ImageOffsetY<0?Self.ImageOffsetY+Self.ImageHeight:Self.ImageOffsetY
  • I'm not sure what's up there. The logic looks sound.

    You can do a check to see if the key exists and log an error if it doesn't.

    currentkey = commentables.dictionaryName & commentables.index
    [inverted] dictionary: has key currentkey
    -- set errorText to "key '" & currentKey & "' doesn't exist"

    Maybe some weird characters are getting in there? You could open your json in something like notepad++ and have it display all characters as a check too.

    It shouldn't matter but you can simplify the logic a bit too. However I don't think that has to do with the issue you're seeing.

    dropbox.com/s/ga5etfamg5en96g/dictionary_messages.capx

  • Here's one possible way if the objects move along a grid:

    dropbox.com/s/avc6xvknf80shlo/follow_rpg.capx

    You move the player or lead sprite like normal. Then for the rest of the sprites you move each one to the sprite ahead of it.