NEONN64's Forum Posts

  • Awesome

    Thank you very much HItskin.

    Yep, changing visibility and focus actions into the variable's values events instead of the keypress events, and using the key released event did the tricks.

    I just changed the events a little so Enter would also show the textbox if it is invisible.

    Oh, but it is not a chat, just the option to change the name of your save file (for 2d games I like to use the arrow keys for movement and Z, X, C and V for other actions. In this case C is the "OK" button).

    Anyway, thanks for your help

  • Hi, I'm having some issues focusing and unfocusing a textbox. I was working on a large project when I bumped into this issue, so I made a smaller one to isolate the problem.

    This small project starts with a blank layout, if you press Enter or C a textbox becomes visible, focused and an instance variable is set to True. If then you press Enter the textbox becomes invisible, unfocused and the variable is set to false. Basically, pressing Enter or C should switch the textbox on and off.

    It mostly works, except for a small issue that is bothering me. After making the textbox invisible I have to press C twice in order to make it visible again (it should work with a single press), with Enter it works with a single press (as it should). It is as if even after unfocusing and making the textbox invisible the C key is still not registered by the event sheet (it could be something else, but that is the impression I'm getting).

    Event sheet:

    Capx:

    https://www.dropbox.com/s/p8lm5tmzkus9knx/TestFocus.capx?dl=0

    Some other things worth mentioning...

    * If I'm understanding things correctly, when you press most keys when a textbox is focused the key "goes" into the textbox and not the event sheet, so, if there are events related to key presses they get ignored. Because of this, even if according to my event sheet, when pressing C while the textbox is visible it should become invisible, It doesn't (that's ok, it actually fits the behavior I'm trying to achieve).

    * If I use C to turn the textbox visible for the first time it works ok (with a single press). But if I've pressed the C key before, I'll need to press it twice.

    * At some point I made another variation, instead of making the textbox visible/invisible I created it and destroyed it each time, the results were the same.

    * At some point I added a text object and the action of appending an X to it as soon as the C key was pressed (no more conditions or subevents). This was to observe if the event of pressing C was being triggered or not. I noticed that when I had to press C twice, the first press was not triggering the append action at all.

    What I'm expecting to happen:

    1) Press C: Textbox becomes visible

    2) Press Enter: Textbox becomes invisible

    3) Press C: Textbox becomes visible again

    What actually happens:

    1) Press C: Textbox becomes visible

    2) Press Enter: Textbox becomes invisible

    3) Press C: Nothing happens

    4) Press C: Textbox becomes visible again

    Also, another minor issue. Just by using the Focus action the textbox doesn't get focus, I had to add a Wait action to make it work. Any ideas why?

    Well, I guess that is all the information I can provide. I hope somebody can tell me what am I doing wrong.

    Thanks

  • I agree.

    This behavior is very common in video games, so I think it is very reasonable to expect an option to do this.

  • I think this would be really, really useful.

    Yes, there are workarounds, but subfamilies would help to make things easier and faster. It is not only about the things you can do with Construct, but also about how fast, intuitively and efficiently you can do them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Great idea ^_^

    It would be very useful and time saving.

  • Well thats several new rules rules now isn't it?

    You won't be able to use solid on both player, and enemy if they both use platform, but it's all doable with overlap at offset.

    Yes, I should have mentioned it in the first place

    Anyway, that is why I'm suggesting the "solid filter", there can be situations when it would be very helpful.

  • The bridge, but not as a solid.

    You will need to use overlap, or overlap at offset in events.

    Mhh... I'm still not following you (what do you mean by bridge?).

    Perhaps a little example can make thing easier.

    Black is solid, green is player, red is enemy.

    Player should be able to stand on solid and be stopped by it (so he is forced to jump over it/climb it/go around it ). Enemy should be able to pass through solid as if it was just a background. If both (enemy and player) touch the solid at the same time, player should be stopped and enemy should be able to cross it.

  • All of that can be done in events... no idea what dynamic pathfinding, or slope/elevation means.

    NEONN64 use a dummy object

    What do you mean by "a dummy object" ? And a dummy object of what? The solid? The player? The enemies ?

  • "Solid filter"

    I'm not sure if that is the most appropriate name, but the overall idea is to let the user define certain objects to be able to go thru objects defined as solid. For instance, player can't cross certain object but enemies can.

    As far as I know there is no way to do this. ( If this is already possible then please tell me how lol ).

  • This question comes up from time to time. My counter question is: what should the scale return if the object is twice as wide but half as tall?

    A single scale value would be impractical because as you point out, changing the objects proportions would completely mess up the scale, so...

    How about having 2 scale values ?

    In your example it could be something like:

    X Scale = 2.0

    Y Scale = 0.5

    Is something like that viable?

  • I have an intro video and I want the player to be able to stop it by pressing a key.

    I can pause it, but I don't see how to stop it

    Also what does the "Set playback time" action does ? The description says "Set the current playback time in seconds". I guess I don't fully understand what "playback time" means (I'm not a native English speaker so perhaps that is part of my problem)

    P.D.: I'm using the new video plugin.

  • Is this in yet. Has anyone heard anything?

    As far as i know nothing like this has been implemented yet.

    And that is a shame. Seriously, this feature NEEDS to be implemented.

    Now that multiplayer and shadows/lights have been implemented I really think this should move to the top (or close to the top) of the to do list.

  • Ok, I'm not sure if this is a bug or if I'm just missing something. Anyway, while I was working on my game I noticed some strange behavior, after testing a bit I realized the following:

    If an OR block has 2 or more conditions that have the same result, the actions corresponding to the OR block will execute once per each condition.

    I made a quick project just to test this.

    The project displays the number 0.

    If you press the Up Arrow the number will increase by 1.

    If you press the Down Arrow the number will decrease by 1.

    The text object is called "Text" and it has an instance variable called number.

    This is the event sheet:

    So far it works fine, but if we make an OR block and add a second condition(which has the same result), the actions will execute twice.

    Now, when pressing Up the number will increase by 2 instead of one. And if we added a third same condition it would increase by 3.

    The obvious "fix" would be to not use the same condition more than once, but sometimes you have to use different conditions which have the same result. Example:

    If the value stored in the dictionary's key is the same value for the Up Arrow then the number will increase by two just like it would with the code in the second image.

    In my actual game, there is a menu for the user to customize the controls, by default the Arrow keys control movement (you move up with the Up Arrow key, etc). The relation of keys is stored in a data dictionary.

    The problem arises during menu navigation. I want the user to move from one option to the other using both: The arrow keys and whatever keys they defined. And, as I mentioned earlier, the default keys are the Arrow keys, this lead me to a situation exactly the same as in the third image (an event which asks if the Up key or a keycode corresponding to the Up key has been pressed).

    I'm sure there can be a few workarounds, but the problem is the code behaving in an unexpected and unintuitive manner. Even if I have the same condition more than once in an OR, I would expect the corresponding actions to execute just once.

    So... is this somehow normal and I should just use a workaround or should I post this in the bug section

  • Can you attach the capx?

    Go full editor - and upload attachment and attach the capx of your test.

    That will save us time. I suspect your json isn't formated correctly.

    Sorry to butt in, but I'm also trying to learn how to use json files.

    I'm trying to populate a dictionary with a json file. But when I try to get the values from the dictionary (after the loading is completed) I only get a 0 on each of them. I guess my json doesn't have the right format.

    So I'm trying to manually populate the dictionary and then Download it as json (so I can inspect the file and see the format) but I can't find the resulting json file. So...

    When you Download something as a json file where is it stored?

    (For example: In the capx you provided, after populating the array you download it as json with the file name "carddata.json". But where can I find "carddata.json" ? I can only see the project file "CData2.json".)

    EDIT:

    lol, I found my answer. I had node webkit for previews. I changed to Firefox and after running the project now I see it ask you where to store the file as any regular download. So, please omit this post.

  • Yep, this should definitely happen.