Ashley's Forum Posts

  • Ignoring input is bad IMO.

    Actually, it kind of makes sense: pressing both left and right at the same time causes equal acceleration in opposite directions, resulting in a zero force overall.

    [quote:1430iv5h]In a fighting game ignoring input might mean a move not coming out.

    How come? Why is the 8 direction movement responsible for affecting your events involving a separate object (mouse & keyboard)? It doesn't make the key get globally ignored - the mouse & keyboard object still sees all keypresses - it's only the 8 direction movement that has a special case for left and right held down. If you code a key combination to produce a move with the mouse & keyboard object, the 8 direction movement will not affect this.

    [quote:1430iv5h]Remember I have to make it remember when it's double pressed even when it's moving in the opposite direction.

    Why does this require 200+ events? Surely you don't need to take in to account the current direction. You could just do:

    + On 2nd tap of double tap

    -> Set angle to ... (assuming 8 direction updates direction of motion here as well)

    -> Set speed to ...

    Alternatively you could always ditch the behaviors and code your own custom movement, which I think one of your examples demonstrates. It's not a large amount of events to reproduce the 8 direction movement. I can't figure out why you think you'll need so many events!

  • When you hold the left and right arrow keys, the 8 direction movement ignores both, acting as if no keys were pressed at all (as Deadeye says, in response to bug reports about holding both left and right down at the same time). However, you can always circumvent this by using a set speed or something instead.

    I think what you want is a set X and Y velocities manually in 8 direction? It seems the problem arises when you Set Angle in the sprite and the 8 direction's angle of motion doesn't update.

  • Motion blur is broken in 0.97.7 - fixed in the next build. Turn it off for now to return things to normal-looking.

    I don't know whats wrong with the other things though, I'll try to find the time to take a look soon. If you can reproduce the problems in a blank .cap with as few objects as possible, it'll be much quicker to fix.

  • Put the objects on a layer with the Scroll X rate and scroll Y rate set to 0.

  • Humph, I'll make a thoroughly error-checked version soon and send it to you, maybe that will help identify what's wrong.

  • Looks like it'll be a good article! Going to put it on the wiki?

    + On "Punch" control down

    ->Trigger Once

    This event looks confusing, you probably don't want to use it as an example. 'On punch down' looks like a trigger (ie. on key pressed) and therefore adding Trigger Once has no effect. You could have 'Is key down' and 'Trigger once', but why would you do that instead of 'On key pressed'?

  • Hey, nice use of 3D box

  • A waypoint is just a location to move to. If you say 'Move to X, Y' and enter a coordinate the other side of the map, obviously the unit tries to reach that coordinate. If you say 'Add waypoint at <position other side of map>, Add waypoint at <original position>' then the unit goes to both waypoints, in order. It'll go to the other side of the map, then come back to its original position.

    As for units moving over each other - use 'Avoid moving over object' action on start of layout. The RTS basics template has an example of this. Units will negotiate in to a queue and not overlap too much.

    It's not perfect though and I've been planning on improving it, especially since it's annoyingly easy to set up parameters that make them spin around in a dumb way, and you have to tweak the parameters at the moment to get it to work right. Hopefully I can come up with a better engine. It's really tricky stuff though.

  • Well, suppose you want to get the value interpolated at X = 4.7. First you want the integer part and float part (4 and 0.7), which are floor(X) and X - floor(X) respectively.

    The expression lerp(a, b, x) does linear interpolation - so we want to interpolate between the two nearest array entries, floor(X) and floor(X) + 1.

    Which is something like:

    lerp(Array(Floor(X)), Array(Floor(X) + 1), X - floor(X))

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What have I told you about eating the fungi in your back garden, David?

  • Scytos, open a crashing file with the XAudio2 object in Construct, and press Debug All instead of Run all. It should (hopefully) report an error via a messagebox. I just remembered the normal preview silently supresses errors - running a Debug will show you the error messages. If you could paste the error, if any, to me here then I can see what might really be wrong!

  • Actually, I just made a small sample myself that plays a XAudio2 object and it crashed. So there's the problem.

    Hmmm... you do have a sound card, right? Does it just crash straight away or does it crash when you try to play a sample?

  • Deadeye, can you send him a version of the game with the XAudio2 object deleted from all layouts and see if that works?

  • No, that's the Construct runtime wrapper message for when something crashes, so you don't get the 'please report this message to Microsoft' message. It could be anything... they definitely have up to date DirectX installs? Did you build it with the latest version of Construct? Does it crash on just Vista/XP/any other specifics?

  • That's a good example, but it's framerate dependent. If you run at twice the framerate, you move twice as quickly towards the scroll location. That might not matter that much for scrolling, but if you want the same thing for important gameplay elements, this is the framerate independent formula:

    lerp(ScrollY, Sprite2.Y, 1 - 0.0001 ^ TimeDelta)

    0.0001 is the number to change for how quickly it goes. Smaller makes it go faster.