Drakkith's Forum Posts

  • Sorry, I don't think I have the ability to post those yet.

  • That looks like it is exactly what I need. Thanks so much!

  • Hey all.

    I've got a problem. I'm using a small, invisible "collision sprite" to guide a larger sprite around and make it bounce off of walls. Since I don't want to have hundreds of these things bouncing all over the place after their larger sprites are destroyed, I put in an event so that when the larger sprite is destroyed the collision sprite is destroyed as well. But the problem is that when the first enemy is killed, ALL of the collision sprites currently on screen are destroyed...

    Obviously this is bad. How might I correct this issue?

    Thanks.

  • I got it to work. Thanks Jobel!

  • Hi Jobel,

    Thanks for the tips. I'll try it out and see how it works.

    Now, time to go look up the details on functions and parameters...

  • Hi all.

    I'm trying to make my game spawn random enemies in a room. My current method is to have a global variable called "EnemyThreatValue" that increases as you progress. Each enemy has an instance variable called "Threat" assigned to them. I want to choose a random enemy, spawn that enemy, deduct "Threat" from "EnemyThreatValue", and repeat as long as "EnemyThreatValue > zero. But for the life of me I can't figure out how to get the program to choose a random enemy. Any tips?

    Thanks.

  • Have you tried r195? We recently fixed a memory leak causing the editor to slow down over time.

    I have not, but I will as soon as I have the time.

  • Same here after working for a long time with C2, the editor becomes unresponsive and slow.

    I found a workaround though - when I start to feel the UI is getting sluggish, I change the skin/theme, that seems to force a refresh of the widgets and you're good to go for another few hours !

    I'll have to try that. Currently I either wait, or press Ctrl Alt Del and bring up the task manager. I don't actually do anything in the task manager, but bringing it up apparently clears my issue for a few minutes.

  • it could be the intel card as you stated. Can you post what type it is? Also have you tried updating you Gfx card drivers and any other updates for your system?

    Yes, I've tried all of that. I'd love to post what display adapter I have, but I can't seem to find any specific info. Both the control panel and DXDiagnostic just say it's an Intel(R) HD Graphics Family.

  • 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?

  • Had an error in my events list. I edited the above post to correct it.

  • Try Construct 3

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

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