Sam Dimanche's Forum Posts

  • dop2000 I tend to do that, yes ^^'

    Well observed, important corners were indeed overlapping either 0 or 2 other points. I hadn't noticed that and it led you to this version !

    I've toyed with the demo and it works fine now except I detected a problem if the sprite moves in a U shaped zone. Sometimes it will take an unauthorized shortcun, cutting through the air. That's why I added instances variables in each Points, storing the authorized moves from there so that the Sprite can check them when it's looking for a new target.

    Again, maybe it's not optimized but it works.

    Well, I think we're close to having our final build here. I hope it will be useful to someone (OP ?). I know I'll maybe use it some day myself

    The link here (I'll try to keep it store for a long time for those interested) for the last version :

    mediafire.com/file/lu1fk1dwnzyt3de/ExerciseStickingMob_dop2000_semorehV2.capx

    Cheers !

  • Yeah alextro the line is definitely the best way to do it if the position of the tiles remains the same, but the challenge here was to create a path that can adapt if the Blocks are randomly positioned =)

    Really cool, straightforward Demo though !

    dop2000 : thanks for the improvements !

    • I like your way of creating every points and THEN deleting those we don't need. It's much more straightforward than my previous method.
    • Your idea of using Families instead of "Zones" to refer to two different points in a condition is neat.
    • You got rid of 8-dir behavior and now the movement of the sprite is continuous
    • Overall, great optimization !
    • I can't find any MoveTo behavior. Is it a plugin ?

    I tried to improve over your version one last time. The changes :

    • I've modified blocks' Imagepoints so that the sprite is really "sticking" to them and there's no margin.
    • It created new problematics namely in concave corners, where several points were slightly overlapping. Now they're considered "clones", and if one was the LastPoint, then neither it nor the clone is considered a potential target.
    • I've reworked the movement a bit so that the sprite never moves diagonally

    Here is the new Capx : mediafire.com/file/gkk4jd9n7bdmf4e/ExerciseStickingMob_dop2000_semoreh.capx

    Science, yay !

  • Hello Fakov !

    I'm not saying it is the perfect solution, I'm not a "pro" but here is a solution I've come up with :

    mediafire.com/file/7xbcx7rb9uk1f9t/ExerciseStickingMob.capx

    Everything is explained into the Capx, but to sum up, my method is :

    1/ Creating Nav Points around blocks, which the Mob will be able to follow.

    2/ When the mob reaches a Point, he decides where to go next by selecting another close point as long as he doesn't go backwards

    I hope it helps. I was unsure I'd be able to do it so I took it as a challenge ^^

    If someone has remarks regarding that Capx, I'm interested (for science !)

    ++

  • It's indeed written in the manual and it explains everything, my bad. Thanks a lot for your help ! =)

    Case closed.

  • Hi NN81 thanks for your answer.

    I exported without touching anything, so all three options (Window Frame, Rezisable Window, Kiosk Mode) were indeed enabled.

    I've tried to disable Kiosk Mode, and now the game doesn't open in FullScreen anymore but in Windowed. The FullScreen toggle then works just fine and there is no more crash. So this solves the problem ! Nice !

    Thanks a bunch !

    One last thing : can you explain what the Kiosk Mode is supposed to do ? Am I losing something by not enabling it in my project ?

  • Hey guys !

    I've bumped into a major and consistent crash problem after compiling my project. It is related to a new functionality that was supposed to enable/disable FullScreen in the Parameters Menu of my game.

    For information, I'm previewing my project using NW.js in C2, and it works like a charm.

    However the preview doesn't seem to be helping at all, because when the project is indeed exported... it doesn't work.

    • the game opens in FullScreen mode (but somehow he doesn't "realize" he's in full screen, cf the DebugBox in the files I'll link to)
    • if I ask him to go Window Mode (by using the Cancel FullScreen action of the Browser object) the game instantly crashes and I have to go CTRL+ALT+SUP to close nwjs.

    I don't know how to solve this. I've tried to :

    • cancel FullScreen as soon as the game loads, but it doesn't work
    • play with the Window Size using the Nw.js object, but it doesn't work.

    You can download both the preview mode and the Exported version of the simplified project here :

    The full export project (linux, osx, windows) : mediafire.com/file/jjs3u2w8ack3t7q/FullScreenTest.rar[/li]

    Thanks in advance for those who'll take the time to help me !

  • dop2000

    Oh ! I love your system, the use of the For Loop and the Dictionary, much more compact !

    There's a slight difference with my previous system : when a button is pressed, I start "holding" on the same frame it is pressed, when you only start "holding" one frame later since you can't have PRESSED and HOLD at the same time in the Dictionary.

    That said, I'll probably adapt your system a bit and use it, it is much less tedious to write so I can more easily add more buttons

    Also, I love these kinds of expressions :

    [quote:12h3srhn]Set Keyname to loopindex=0 ? "A" : loopindex=1 ? "B" : loopindex=2 ? "X" : "Y"

    What's the name of this advanced way of writing ? Is it Java ? If so I need to give it a shot, it's very convenient.

    (isn't it missing a "loopindex = 3 ?" before the "Y" ? Maybe there's a difference because it is the last one)

    Thanks a bunch \o/

  • I was worried about the fact my Keyboard triggers may be broken too and would need to be reworked, but surprisingly they're not. You can input several keys at the same time, and one normal trigger is enough to detect them all. Maybe it's just that the detection range is shorter, so it's harder to "mix" them ?

    (of course at one point my keyboard stops detecting too many simultaneous inputs, but I know it's a mechanical limit)

    Here is a V3 of my capx with this result : mediafire.com/file/i7a4a0c6c72sasg/PbDoubleTriggerPadV3.capx

  • Interesting, but I don't like the "unprecise" aspect of the tick range. I'll stick with my solution so far, but thanks

    It's impressive that we're proposing all these colorful workarounds when it should really be a basic fonctionnality of construct's gamepad object

  • 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 :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.