WarpedOldMan's Recent Forum Activity

  • Ah, well it's good to know that I'm not just missing something.

    I'm a little surprised that I can delete files but not folders.

    Anyway, thanks for looking into this for me TiAm.

  • I may be missing something completely obvious.

    In Node-Webkit's actions I see the "Delete File" action, but no "Delete Folder". The "Delete File" action accepts a path, and I tried a path to a folder to be deleted, but it does not seem to work. All the other file and folder actions behave as expected, so I don't think this is related to a file or folder's access permissions.

    I've tried to check the manual entry on Node-Webkit but it seems to just lead to a download page for the plugin.

    I'm using the latest version of C2 and the Node-Webkit plugin.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah, it does work as you say. Thanks for confirming the intended behavior. Knowing this, I can rework my event structure appropriately.

  • If possible, I would like to confirm that something I am observing is intentional, unintentional, or an error in my events.

    Ok, so my layout has 4 instances of an object.

    I have a function named "deleteobject".

    • in a subevent's condition I pick one of these four instances (arbitrarily) by UID.
    • then use the normal "destroy" action in that same event for that object.
    • immediately following that action, in the same event, I set a global variable to object.count

    I call the function and destroy the object, then set the global variable to object.count, so object.count should return a value of 3 not 4 correct?

  • I think I figured out what the problem is, my example .capx is probably too complicated to be of much use to anyone but myself.

    When I deleted the node, and tried to get a keycount directly before that, a mix-up in the events also caused nodes to be added to the client list immediately before the deletion went through, causing a keycount of 3 instead of 1.

  • I've now tested this in both the latest stable release, and the latest beta; no change unfortunately.

    If anyone tries out the supplied .capx and needs further clarification about what the problem is and what I'm trying to achieve I can try to explain further.

  • Ah, that plugin is unnecessary to the project anyway. I've removed the plugin and attached the updated file. In the meantime I will try updating to the latest stable release and see also if that fixes my problem.

  • I'm not exactly sure how to explain my problem. Instead, I'll explain how to reproduce it.

    Firstly, you'll need to open the attached .capx file.

    Debug the layout. (I usually open the debugger in a separate window)

    Next you'll need to create a couple nodes. To do this, press the "1" key to begin placing a node. Click with the mouse to finalize the placement.

    Make two nodes in addition to the nodes that are already present on the layout on start.

    Place the two new nodes close to the existing nodes (preferably within 200px).

    Now, pay attention to global variable "diagnostic2", and middle click node #1.

    For some reason I get a value of 3, when it should be a value of 1.

    The key-count is too high, as far as I can tell only one instance of the dictionary is selected and it can only have 1 key at most (provided that my setup directions are followed).

    The relevant event in the project is #79.

    The project is quite messy and not commented in any useful way, however I hope that the issue is isolated enough that my mistake will be evident to an outside observer.

  • Hmm, for some reason I thought that dictionary keys weren't indexed. Your method looks like it will work just fine.

    Thanks for your help, this one had me stumped.

  • Ah hehe, that does... some of what I need. But I'm not sure I can adapt it for my all of my needs. Importantly, I need to mirror the values of keys between two instances of the same object. And, the keys can't be numbered unfortunately (sneaky you). Well, they could but it would get confusing as I would have to place the key name in the value of the key or an index; then use tokens and such to get a "key" name, index, or value depending on where I put each.

    However, excluding one key from this mirroring process is my problem, not the basic mirroring of the values.

    In order to differentiate between the two instances of the object, I need to keep one key's value separate. This is the "alias" key. In my post I mention that the "alias" key of one instance is set to "temp" and the other is set to "default". This is the only key that I don't want to mirror.

    I thought that the problem might exist with how the "for each key" condition on a dictionary object works. It's not impossible to just roll my own, so to speak, but since dictionary keys aren't indexed by default, I would have to do that myself. Which would get a little messy and I consider that route something of a last resort.

    Heh, I'm never quite sure if I'm going in the right direction, but can anyway see why I'm placing the object in two different families? I've done similar when it comes to managing collisions between instances of the same object and I seemed to have similar needs in this situation.

    Again, if anyone is having trouble understanding my first post's explanation of what I'm trying to do, then I can make an example .capx.

  • I'm having a little trouble with this one.

    So I have a dictionary object. At runtime I create two separate instances of this object. Each instance is given an identical set of keys. One is intended to store some default values so that I can restore the other instances values to an original state periodically.

    However, I also want to skip a key in the process. What I'm currently calling the "alias" key, which stores a little name of the instance to help differentiate between the two instances.

    To make this a little easier (or so I thought), I placed this dictionary object in two families: "dict1" and "dict2".

    Then, on a function, I pick each instance through the two families.

    dict1 - Key "alias" = "temp"

    dict2 - Key "alias" = "default"

    Now, these two instances and only these two should be picked.

    Then, in a sub-event I use a "for each key" condition on the "dict1" family.

    And in another sub-event I invert the following condition.

    dict1 - Current key = "alias"

    Now in the actions I do:

    dict1 - Set key dict1.CurrentKey to value dict2.Get(dict1.CurrentKey)

    I thought that this would loop through each key and match the value unless the current-key matched the key that I didn't want to restore. In this case the "alias" key.

    However, currently it's not skipping that key.

    Any help would be greatly appreciated. I may just be misunderstanding something simple. If necessary I can provide an example .capx

  • I used your method in my project. It seems... to work. I see now why my method wouldn't have produced quite the desired results. Oddly, I'm still not sure why I was getting the result that I was, i.e. the jumble of blocks.

WarpedOldMan's avatar

WarpedOldMan

Member since 5 Feb, 2012

None one is following WarpedOldMan yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies