Sam Dimanche's Recent Forum Activity

  • hi Diablo ! Thanks for stoping by !

    I already have something pretty similar right now. I have :

      On any button pressed >> check if said button is mapped to an action >> toggle boolean variables of this action (ex : "JumpInput" and "JumpInputHold") On any button released >> check if said button is mapped to an action >> toggle "hold" boolean variable of this action

    It works very well, because I can let the player choose his own mapping entirely.

    Except now I've realised the "On any button pressed" trigger didn't work as intended ^^'

    It seems the only obvious solution is, like you say, to associate every button with a boolean. It's pretty tedious but I've been testing this early draft and it works well with my A, B, X and Y buttons on my Xbox360 controller : mediafire.com/file/5j6yi5kyvxs7ssx/PbDoubleTriggerPadV2.capx

    It's pretty tedious though, and I'd better cross my fingers nobody tries to use a weird controller with more buttons than usual :/

  • Thank you dop2000 for your help

    Your workaround is very interesting, but to me the biggest hurdle (in addition to the one you already mentioned) is that it doesn't work at all with the second trigger : the "On any button released". Because of the lack of appropriate property in the Gamepad object.

    Even if I get rid of the triggers altogether like you suggest in your last part it's still very complicated.

    I'm trying to think of something but I feel like I'd have to track the state of each button at every frame, as well as their previous state from the last frame, to see if a button has changed state etc etc... that sounds like a loooot of work. And a looooot of variables to store all these data.

    Or if I manage to know when several buttons are released, I could store the IDs of these buttons in a Text variable, separated with "/".

    I'd use the tokenat function to split the variable later.

    It's almost like building a virtual controller from scratch... Am I the only one to find it incredibly impractical ?

    What surprises me is that it looks like a pretty basic fonctionnality... I mean, it's common to mash several buttons at the same time. This trigger is almost useless, limited as it is

    Maybe I'm just watching it the wrong way.

  • Back from a big holiday travel. This is still bugging me. Can someone please help me find a workaround to deal with this issue ?

    Thanks in advance

  • Hi,

    I'm having a problem. See, I knew keyboards couldn't sometimes detect multiple simultaneous key inputs but I seem to be meeting a similar problem with an Xbox Gamepad as well oO

    Here is a very simplified version of the problem I've encountered : mediafire.com/file/rti3f1d2q85kz68/PbDoubleTriggerPad.capx

    Try inputting two buttons at the same time with a gamepad : you should in theory witness in the debug box "pressed" twice or "--" twice (for released buttons). Except no, oftentimes these words don't come in pairs, meaning one trigger hasn't been detected. Even if I were pressing the two buttons at the exact same frame I don't know why this would happen (and I'd be very surprised if I were able to do this consistently anyway)

    Is there a workaround around this ? Is it a software (C2) or hardware (controller) problem ? I'm developping a run n' gun game a la Metal Slug, you NEED to be able to detect several inputs simultaneously or quasi-simultaneously (such as Crouch + Shoot, Jump + Shoot, etc).

    Thanks in advance for your help. It is really troubling me :/

  • Your events are in the wrong order, if I'm not mistaken.

    Currently you have :

    IF (Enemy is not dead ; Enemy is attacking ; Frame = 4 ; Trigger Once)

    THEN for each enemy

    IF Is trgtInAtkRng

    DO something

    Meaning if ONE enemy meets the conditions for the first IF, you are checking the range of each enemy, when you just want to check the range for this particular enemy.

    Also : as long as an enemy meets this condition, since you have a Trigger Once, it won't happen again. If a lot of enemies are attacking, at all time you could have at least one with the AnimationFrame = 4, and that would block everything.

    Try the events like this :

    FOR EACH Enemy

    IF (Enemy is not dead ; Enemy is attacking ; Frame = 4 ; Is trgtInAtkRng ; Trigger Once)

    DO something

    Now each enemy should be independently checking its own Attack Range when the conditions are met and shoot only once

  • Can you post the capx ?

    Maybe there's a problem with the "health = 0", with your player's health going into the negatives, thus preventing the animation to start.

    But without a capx, and with such a small screenshot it's hard to tell.

  • try this code from Stack Overflow

    I'm not familiar with javascript so I can't implement this, but thanks for the suggestion !

    Maybe System->Is on platform to detect if HTML website or NW.js

    I think it works ! If I'm previewing on NW.js, the condition "Is on platform NW.js" is true, but if I'm previewing on Firefox "Is on platform HTML5 website" is the one that's true. That seems to be exactly what I was looking for !

    Thanks a lot to you both !

  • Hi friends

    I'd like to create a save system that distinguishes whether the player is playing online on a browser (example : on itch.io) or in "desktop mode" (using the nw.exe).

    • Player is online ==> I'm saving using the LocalStorage Plugin
    • Player is on desktop-mode ==> I'm saving using the NWjs Plugin to write a simple text file.

    The goal is to protect the desktop player from losing all his save data after using Ccleaner or another tool of this kind. I find this more comforting. I just save strings of text, so nothing big.

    My question is : how do I detect if the player is playing on a web-browser or in desktop-mode ?

    I thought I could use the Browser plugin to get data on the player's session (example : Browser.Name, Brower.Platform, etc...) but it doesn't seem to work as I'd like it to. The data doesn't look useful in this case. For example, running the game in preview mode on Firefox and on NWjs, Browser.Name is always "Netscape" and Browser.Platform "Win32".

    Can someone kindly tell me where to look for ? =)

    Thanks a bunch !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Mekonbekon ! Thanks for your reasonable advice. I think you're right : if it's not broken, don't fix it. Nobody ever criticized the definition, so why bother ? ^^

    I think I just needed to hear that to go on. See you

  • It works for Instance Variables yes. At startup you always have to recover the local storage data and store it somewhere in your game : you can store it in an instance variable just as in a global variable

  • Hi there,

    I have a question regarding the Window Size of a project. Foolishly I only found about this property after months of using construct 2. My project is well advanced but now I'm concerned about the fact I'm still using the "original" window size of 854x480 (with Letterbox Scale when fullscreen).

    To add to the complexity, at some point in the project (months ago already) I decided to zoom out a bit, thus game layers are scaled at 0.75 in the eventsheets on start of layout. UI layers (parallax 0,0) are not scaled however.

    I'd never noticed this property before, nor felt the use for it, since everything works just fine even when I'm in full screen mode...

    I'm considering changing the Window Size to a more common 1600x900 now, but it would imply a LOT of work to resize ALL my sprites. Would it really be useful ?

    1200x675 (still 16:9 proportions) could also be possible, because game layers would be less affected (854x480 with a 0.75 scale are already an artificial 1138x640) so I'd mainly have to resize UI elements.

    I have 3 choices then.

    • Keep the original 854x480 size and keep scaling back some layers to 0.75
    • Move to 1600x900 window size (I'll have to rework everything)
    • Move to 1200x678 window size (I'll just have to rework the UI)

    Tell me what do you think I should do, and what difficulties I'd be facing if I keep my actual window size. Thanks for reading !

  • You could also cascade the Else statements like this maybe ? <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    mediafire.com

Sam Dimanche's avatar

Sam Dimanche

Member since 31 Dec, 2016

None one is following Sam Dimanche yet!

Trophy Case

  • 7-Year Club
  • Email Verified

Progress

8/44
How to earn trophies