Ashley's Forum Posts

  • Why don't you use the Turret movement's rate of fire feature? Set the rate of fire in milliseconds in the properties, and use the 'On Shoot' trigger to fire a bullet. This keeps the reload time independently for each turret saving you Every conditions and problems like these.

  • BTW since it's been a request a few times, the next build has an updated Turret movement which can target objects with a nearest-always method (which means if something else comes closer, it'll target that instead) - so it will be able to be used for finding closest objects too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want to do it by adjusting the position, you can use:

    + Always

    Set X to original x + cos(.Angle) * 'Recoil'

    Set Y to original y + sin(.Angle) * 'Recoil'

    Original x/y is the starting position of the object, eg. 320,240. 'Recoil' is a private variable which when 0 means it's at the original position, otherwise its the distance of the recoil. So if you change Recoil to 20 and gradually decrease it back to 0, it will jump 20 pixels and gradually move back to the original position.

    If it goes the wrong way, use .Angle + 180.

  • What do you mean? What is the original position and how do you want it to move there?

  • "You require to open this file" is actually a bug, it's meant to have a plugin name substituted in, ie. "You require Plugin.csx to open this file". The other one is just a stray caption... I try not to put in silly error messages deliberately since they serve a genuine purpose and could end up really confusing people, but I think somewhere, somehow, there's code that says something about wormholes if things go seriously wrong

  • I read deadeye's post as being a harmless joke, albeit poorly worded, because I can see how that can be interpreted as trivialising his point. Still, hopefully we're now clear there was no malicious intent.

  • OK, well I've changed the error message to:

    Your DirectX installation appears to be out of date.  Please install the latest version of DirectX by clicking 'OK' in order to run this application.  The required component, 'd3dx_30.dll', was not found.
    
    [OK] [Cancel][/code:80qmsyg9]
    
    We'll see how it works out.
  • LOL guys, I know it's a picture of a girl, on the internet of all places!

    I wouldn't normally go as far as photoshoots for a game I was making, I'm too lazy to do my own graphics, sound etc, so kudos for the effort

  • + Always

    Set X to .X + cos(.Angle) * 100 * TimeDelta

    Set Y to .Y + sin(.Angle) * 100 * TimeDelta

    '100' means it moves at 100 pixels per second. Replace it with a private variable and you can control the speed.

  • Worth mentioning the 'Distance' expression - you can get the real distance using:

    distance(Orange.X, Orange.Y, Purple.X, Purple.Y)

    and that's always a positive value as well. (It does the sqrt(dx^2+dy^2) formula behind the scenes)

    It's worth noting the spread value/fastloop pattern is redundant in Construct - always use a For Each instead. The Turret behavior can track objects in range, but if an object enters range it will track it until it leaves range (ignoring any objects which may move closer in that time) - perhaps a 'target closest' option would be handy for Turret...

    I think the difficulty with finding the closest object with multiple orange and purple boxes is you have to first identify the closest one, then pick it with a separate event. You'd also have to track the targetted object being destroyed, other objects coming closer, etc. etc. I'll give you the events if you want, but I'd recommend the Turret behavior for now.

  • I'm not sure if it's relevant today, but the Directsound SDK warns against using a lot of frequency changes for performance reasons, which is part of the reason why you have to explicitly enable frequency changes on a channel. Just mentioning it so you're aware of that, but since Vista is moving to an entirely software-based audio model, perhaps it's not a significant issue - need to find out more about that...

  • Exported game EXEs in Construct require d3dx_30.dll to run - distributed in an updated version of DirectX 9 since about 2006. If you don't have it (ie. you have DirectX 8 or DirectX 9 pre-2006), I've written a messagebox to pop up saying:

    A required DirectX component, 'd3dx_30.dll', was not found. Please install
    the latest version of DirectX 9 in order to run this application.
    
    Click 'OK' to visit the Microsoft to install the latest updates for DirectX 9.
    
    Click 'Cancel' to terminate the application.[/code:2ydjt4xb]
    
    And as it says, if you click OK you're taken to a Microsoft page where you can download DirectX 9 - then the game works.  I've been poking around some forums to see how Construct apps are generally being received and people who get this error generally seem to say something like "It's broken!  Missing some DirectX DLL file or something."
    
    I get the feeling people are just seeing a messagebox that mentions a DLL file and assuming it's not going to work.  My theory with error messages is to try to provide enough information for the user to solve the problem themselves, and annoyingly people seem to skim the text and not try again.
    
    Has anyone found this problem?  What do you think is the best way to get people to realise they just have to update DirectX to run the game?  I feel like I need a little animation of a guy waving saying "Hey!  Pay attention!  You need to upgrade DirectX!" or something, but there's probably a less extreme solution, heh
  • Yeah, I think it works more like changing the playback frequency of the file (the rate at which samples are mixed with the primary buffer), which as a side effect changes pitch. Perhaps this isn't the best way of doing it - setting frequency to 30KHz for example could either increase the pitch (for a 22.050KHz wave) or decrease the pitch (for a 44.1KHz wave). I think your idea would be a more elegant way of doing it, ie. instead of 'set (playback) frequency' action have an 'alter pitch' action which works as a percentage of the original sample rate. So 'Alter pitch' to 50% would always halve the playback frequency, always reducing pitch by an octave for any wave. I think I'll do something along those lines for the next patch.

  • I suppose you're talking about the skidding on the turns, which can be reproduced with the Skid Recover Rate in the Construct behavior. Lower means more skidding. It's not particularly realistic though so better to keep it subtle.

  • [quote:30ncl4r9]Hey Ashley, would it be worth your time to add pitch variation to Directsound?

    Set Frequency changes the pitch, as does enabling Doppler effects.