R0J0hound's Recent Forum Activity

  • 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.

  • It involves rotating the points around the piggy center.

    dropbox.com/s/4332355gekn2sfn/distortmesh_rotating.c3p

  • I found this which is for desktop but is likely the same for documents. On windows at least, any language will have a "desktop" folder which points to the same folder with the translated version.

    stackoverflow.com/questions/57742157/node-js-how-to-find-the-desktop-path

    So for windows at least it would be this. Which will work for any language.

    NWJS.UserFolder&"Documents\"

    or you can also do a check to see if that folder exists and use this if it doesn't.

    NWJS.UserFolder&"my documents\"

    For mac and linux you can try. Notice the other slash. Actually you could probably use this for windows too. Windows doesn't care what slash you use.

    NWJS.UserFolder&"Documents/"

    I'm not sure if mac and linux do the same thing with different languages as windows. It looks like those are valid folder on those platforms like windows too.

    Worst case you can first see if the folder exists, and create it if it doesn't.

  • Dt is just used for things to change at the same rate no matter the framerate.

    Most common use is for something you want to smoothly move 100 pixels per second.

    set x to self.x+100*dt. Basically rate*time=distance.

    Sometimes the formula can be written dt/60, but that can be rewritten to 1/60*dt.

    There are other ways people use dt in formulas with varying complexity. You'd have to look at those formulas case by case.

  • I think you're mixing up some variables in there.

    every 30 seconds
    moneyInBank > 0
    --- add intrestReward*moneyInBank to moneyInBank
    
    every 30 seconds
    moneyInBank < 0
    --- subtract intrestCost*moneyInBank from moneyInBank
  • Like I said you can probably do it with js. You'd effectively be making at least parts of three plugins: "audio", "user media" and "video recorder". All to just add stereo recording, which it looks like is possible to add but I'm getting that from various sources when googling about it. It still is more work than I'm willing to do at this point even to test to see if you can record in stereo. Worst case the browser only has mono recording, or you have to handle setting it up differently for each export type.

    You can run other programs from a construct project with a nwjs export, but antivirus programs may complain, and then there's the matter of knowing where audacity is installed to run it. Unless you bundle it with your program that is. But the process of running a program, having it do something in an automated fashion and then feeding the result back to your original program is a very hard problem to solve, even if it's even possible. html5 and javascript within nwjs isn't the right tool for that job.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads