Drakkith's Recent Forum Activity

  • Do you have any webgl effects in your project? I've found that if I apply too many demanding effects, it can slow parts of the editor to a crawl, providing 'preview effects' is enabled.

    Nope. No WebGL effects present.

  • R190. I don't have any text objects at all and I'm running 1 layout with less than a dozen objects.

  • I'm using windows 8.1 on my new laptop and I'm running into a problem where Construct 2 becomes slow to respond to my inputs. Clicking and typing take forever to respond. This is happening within the editor itself, not a running game.

    My laptop easily exceeds the minimum and recommended requirements, except that I appear to have an Intel video device, which the manual says it recommends not using. Could this be causing the slowdown?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Had an error in my events list. I edited the above post to correct it.

  • Solved it. Create the following events:

    System: Every tick

    ----Gamepad: Gamepad 0 Right Analog X axis > 0

    --------Gamepad: Gamepad 0 Right Analog Y Axis < 0 : Player: Set Angle to 360+atan((Gamepad.Axis(0,3))/(Gamepad.Axis(0,2)))

    --------System: Else : Player: Set angle to atan((Gamepad.Axis(0,3))/(Gamepad.Axis(0,2)))

    ----Gamepad: Gamepad 0 Right Analog X Axis < 0

    --------Gamepad: Gamepad 0 Right Analog Y Axis Not Equal To 0 : Player: 180+atan((Gamepad.Axis(0,3))/(Gamepad.Axis(0,2)))

    Note that the parameters for Gamepad.Axis(A,B) may be different for you. These were for an XBOX One controller who's index was 0 (first controller connected), making the A value 0 (it would be 1 if it were the second of two controllers connected). The value B is 2 for the right stick's X-Axis and 3 for the right stick's Y axis. My controller is also set up so that the analog stick Y-Axis is a negative value when pressed up and positive when down. Your controller may be different. To check, I went to the controller settings in windows and could see the Y rotation bar increase as the stick was pushed down, and decreased as the stick was pressed up.

    For those interested in what this is actually doing:

    The atan((Gamepad.Axis(0,3))/(Gamepad.Axis(0,2))) expression performs an arctangent function on a Y and an X variable to get a degree value as follows: arctangent (Y/X), where Y is the position of the right analog stick along the Y axis and X is the position of the stick along the X axis. Because of how the arctangent function works, it is necessary to set this up into different events because different combinations of + or - stick positions along each axis can return the same value.

    Adding the result from the either 360 or 180 is necessary to get the angle we want since the arctangent function only returns a value between -90 and + 90 degrees. In the first event we add the arctangent result to 360 because performing the function on any of the possible combinations of X and Y values for this event will always equal between -90 and 0 degrees. For example, if the stick position is 50,-50, diagonally right and up, the function arctangent (-50/50) gives us -45 degrees. Adding 360 to -45 gives us 315 degrees, which makes the player face up and right, just like the stick.

    You can do the math for the other events if you want to.

    Edit: Corrected a mistake in the events list. Turns out I accidentally set one of my conditions to check the Left Analog Y-Axis instead of the Right Analog Y-Axis. I was able to merge two events into one, reducing the number of events required.

  • I'm getting help on this on another site, but since I don't have the rep to post URL's or send private messages I'm not sure what I can do. Also, the link in your post doesn't work since it was converted to plaintext and shortened.

    Try searching google for "physicsforums converting 2 axis input to an angle". My thread should be the first hit.

  • Update: Found a tutorial on arrays.

  • Thanks, Dutoit. Do you know of any good posts or tutorials on using arrays or functions in this manner?

  • Hey all.

    I'm trying to get a character to fire one of a number of weapons depending on the upgrades/selections they have and I'm not sure about how to set up the logic. How can you set it up so that your "fire weapon" command references some other event logic which itself will determine which weapon is selected and is fired? IE if the player has upgrade A then weapon X will fire, but if they have upgrade B then weapon Y will fire.

    Thanks!

    -Drakkith

  • How are you currently spawning the spikes?

  • Construct 2 runs events from top to bottom. So in your first picture, the last action in line 2 sets pause to 1. It then goes on to the next line and since pause is set to 1 it runs the event. With an Else condition, line 3 cannot run if line 2 runs.

Drakkith's avatar

Drakkith

Member since 29 Aug, 2014

None one is following Drakkith yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies