Sumyjkl's Forum Posts

  • So I just found out it's actually not possible to change the operating system drive letter. As far as I can tell it's hard-coded.

    You should be fine using

    "C:"&NWjs.UserFolder[/code:cgg2e6ck]
    Otherwise you would need to test for which directories have write permissions.
  • Hmm, so you're trying to find the user's user folder path?

    That's tricky. Is there any particular reason you need to use the user folder?

    Personally, I would just try to use C drive, and if that failed (incorrect path) then use the current folder. As far as I can tell NWjs isn't capable of finding the Windows drive letter.

  • It seems to work fine on my side.

    NWjs.AppFolder[/code:13lu71wk]
    Returns
    [code:13lu71wk]C:\Users\Username\Desktop\New project\win64[/code:13lu71wk]
    When the project is just exported to the desktop.
    
    It also works for external drives:
    [code:13lu71wk]E:\win32[/code:13lu71wk]
    When I put the win32 folder on my USB drive.
  • The closest I can think of is to make a copy with all the content removed or unloaded from your game. Then you can run it in NW.js (or keep running in a browser).

    The problem is NW.js is window based, and C2's multiplayer can't deal with multiple instances, so you'd have lots of windows open, and any overhead NW.js (just running it) has would be multiplied. Also as far as I can tell NW.js doesn't support running multiple instances by default.

    In regard to rendering, you can't remove objects from the game obviously since it wouldn't sync with peers, and neither can you change the collisions or other properties without desync, so you are stuck with having those objects in. I'm not sure if this would help, but I imagine removing all transparency from sprites would help with decreasing overhead. That or (depending on how Canvas works*) blocking the whole layout with a fill layer to make the program think it's finished rendering when it gets to that layer.

    *I have no clue how canvas works.

    I'd recommend changing all the settings to their least performance-heavy options. I don't know much about performance, but I imagine this would be the most extreme you could get:

  • You may be best to read this.

    I cannot understand your question, and I doubt others would be able to either. My best guess is that you want to duplicate the contents of one array and place them in another.

  • I think the other replies may have missed your last sentence.

    [quote:33xgymb2]I just need to know the best way about getting them to take the place of the original ship, and then slowly float apart.

    I don't have a nice easy solution to this, but I'm guessing there isn't one.

    I would just bite the bullet and set the individual pieces to the right positions and angles when you create them.

    If they have the physics behavior, you might need to be careful with the collision polygons overlapping.

    If you want to set this up without needing to test it constantly, I'd suggest disabling all collisions/physics/moving parts and place each gib where it should be over the object. Then you can print out the position of each (relative to the main object) and move it by that much when they are eventually created.

  • I believe On Destroyed is like the other triggers, in that it triggers separately for each instance.

    Not sure if there is a nice solution to that though. You may need to test for that when you destroy them, rather than using On Destroyed.

    Another less pretty solution is to test if more than one has been destroyed this tick by assigning a variable to Object.Count at the end of the event sheet, and comparing that when an object is destroyed.

  • As long as you have the same objects with the same instance variables and names, you can copy an entire layer at a time. Then you can re-position the paste.

    You can do the same with events, as long as everything is the same across the projects, mainly variable and object/family names. If some things are in a container in one but not the other, you may need to redo that.

    Copying actual objects is impossible though, as far as I can tell, so you'd need to re-import or re-copy the frames of animations over.

  • Theihe

    If you're still looking for someone, I PM'd you!

  • Lovely colors! The shadow effects really make it look 3D :)

    Thanks!

    Not sure if I went overboard on the saturation :)

    Then again, it is supposed to have a sort of... Gamey feel.

  • A quick prototype I made to test out some assets I've been making for a multiplayer isometric hacknslash.

    The effects are done using this method.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • C-7 Thanks for the help!

    It's a lot closer to what I was looking for, but it's still not quite perfect, since I wouldn't be able to overlap them.

    (Very late edit: since I was trying to keep the effects on the same layer.)

    But! I got it!

    Using your method of Source Atop on the mask instead of the object, the mask obscures the effect behind.

    Like this:

    Capx

    [Google Drive]

    Changes:

    • Mask is now white
    • Effect layer is set to force own texture
    • Effect layer has the multiply effect
  • Solved, see below posts

    I'm very confused.

    I have a layer with effects on it (sprites with multiply effect), but I need a way of "masking" where the effects are, either by saying where the effects can be, or a way of subtracting from the effects.

    In my capx, I have two layers. One is for objects, the other overlays effects. What I had hoped to do, and what didn't work, was to set the mask to Destination out, which in theory would subtract from the rest of the layer. The problem is it also subtracts from everything else in the layout. I've tried setting 'force own texture', but it of course only works when the layer is not transparent, which is really quite important.

    Anyone know how to get around this?

    Link to capx

    [Google Drive]

  • So I've been trying to create a multiplayer game, and with some success. Currently I have peers connecting to each other, a chat room with a couple commands, and a completely broken rest of the game.

    First I followed Multiplayer tutorial 4: real-time game and created a simple "you can move around and the other player sees it" game, and it worked! I made a multiplayer thing! So everything in the project to do with the player object and multiplayer is essentially identical to the tutorial.

    Anyway, after doing that I thought "the whole, [on peer connected] thing doesn't suit my game, since they're already connected in the lobby (chat room) and so it won't trigger when you go to the actual game, or more importantly, when a player dies".

    So I tried something.

    I disabled the normal method, because I was about to replace it elsewhere:

    And then I created a different method, on the host's side, for spawning an object for each peer:

    I thought a for loop would be perfect. It could cycle through each peer and assign an object to each one.

    The bit on the end is the debug method of determining what object is associated with each peer.

    It didn't work. On the peers' side, every object is associated with the host, because it was previously relying on [on peer connected] to get the Multiplayer.PeerID for when it was created:

    Having spent about 10 hours straight trying to work out a way to fix this, I feel like I've tried everything at this point.

    • Having the peers send a message to the host to create an object. This should mean the host would have a Multiplayer.PeerID to send to each peer other than it's own. It didn't work. For some reason, it still thought it was from the host.
    • Making player.peerID synced with peers. I can't see how this wouldn't work, but sure enough, same as before. In fact, I remember it doing other weird things, like having a blank peerID.
    • Having the host send a message with the UID of the object and the Multiplayer.PeerID to associate it with. Having explicitly asked it nicely not to, it somehow screwed it up.
    • Only spawning a single instance of the object, instead of the for loop, and then forcing it to associate with a single peer (with Multiplayer.PeerIDAt(1)). Again, no progress.

    So, is there a proper way to do it? Have I missed something? I need to be able to create new peer objects whenever I want, but at the moment it seems like [on peer connected] is the only viable option.

    Thank you so much if you have any advice!

  • Kyatric

    Thank you so much for the example.

    I ended up doing a similar workaround to yours.