Tube's Forum Posts

  • Set up custom pathfinding for the truck objects, and give them both the Add Pathfinding Obstacle Truck and the Avoid Moving Over Truck. Then regenerate each one's obstacle map periodically, since they're moving objects. I think that should solve a majority of your issue.

    Alternately, have an invisible Sprite (use bounding box collision) with a larger radius than each truck follow them around (and probably match their angle), and use that for their pathfinding instead of the trucks themselves. It would give you a little less of that "trucks crashing into each other" effect. This gets trickier, though, since you'll need to account for each truck's own invisible sprite so that it will actually move at all.

    Beyond that, there's something to be said for checking if the trucks are within a certain radius of each other, then if so, using the LinearAim System expression to find out where they're headed and then veering away from that point. It's going to take a little more number-crunching and finessing for you to do to get it the way you like it, but it might be the most satisfactory option when you're done.

  • If anyone complains about the weapons themselves being unrealistic, they're overthinking it. Besides, it really comes down to who's holding the thing, after all.

    I mean, let's take the broadsword/claymore example: both of similar lengths and weights. But if my grandmother has a broadsword, and King Arthur has a claymore, I'm pretty sure about the odds on who's going to slay the dragon with it and rescue the fair maiden, all other things being equal.

    What I'm really saying here is, don't let it bother you, just make sure they're all balanced the way you'd like, and attribute any strangeness to the Squishies themselves.

    There's probably something to be said for making sure certain classes of weapons have certain things in common, even if damage isn't one of those things. Range is a really good example, and it doesn't seem like there's a real bonus to making a rapier shorter than any other sword; it might as well be a big dagger or something, at that point, which is likely to read better intuitively (meaning there'll be no surprise for the player when it also attacks more rapidly).

    Props to you for asking for advice here Few people seem to do it, and I suspect it's largely a matter of ego. Everyone wants their game to fit their own personal vision, after all, and soliciting advice somehow "dilutes" that vision for them. But that's a bit silly, as you well know; the best games aren't conceived in a vacuum, but with a lot of serious collaborative effort.

  • If it helps at all, I answered a similar question recently over in Help/Tech Support.

    Maybe that will be of some use here.

  • Sounds good by me. If nothing else, it's more stable by virtue of the fix to "else".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If the RTS behavior could limit itself to certain kinds of objects or families for its travel, rather than just avoid them, I would probably use this exact approach myself. It's incredibly handy and consise, the way you've done it!

    As it stands, I'm trying to solve basically the opposite problem, which turns out to be a bit more work. This is a nice bit of inspiration, though (yours too, toralord).

    Oh, just one little suggestion: Movement's a bit smoother if you change out the "Every 500 milliseconds" condition for "If != Hunter 2 is moving". Assuming you don't want the pauses, anyway.

  • As an alternative to set layer angle(that doesn't work) we have a nice camera plugin

    Although you will have to create a custom movement for it to work,but this method you don't need large rotating sprites and can create your levels normally

    Yeah, this right here is probably the best (or at least easiest) solution. Rotate the whole world with Advanced Camera, rotate the player by an opposite amount, and switch to Custom Movement. I can't think of any reason why it shouldn't work.

  • I think you're on a newer version of Construct than I am, so your .cap won't load for me, but have you checked to make sure your layer isn't set for Linear Sampling? Even if the application is set to Point Sampling, try setting that one layer to Point as well, just to make sure.

    Also, I've occasionally noticed some blurriness when using transitions, so see if turning off any transitions between the previous layout and that one makes a difference of any kind.

  • See, my game is a 2D platformer, and since I'm relatively new at Construct, I don't have any idea how to make cutscenes. If there's an "easy" way, I'd like to know it first before getting into the tough intricate stuff. I have the unstable version (0.99.91) if that matters. All I'm really looking for at this point is "This character talks, then this character talks, then this character moves, repeat it a little, then it's over". I wish I knew how to do it myself but I don't really have any idea.

    I just tackled something similar in nature myself, about a week ago. I ended up doing everything via an array, so that I could save and load files between it and an external editor.

    Forgive the really rough pseudocode, but basically the logic is something like this:

    * At the start of the layout:

    • Load Array from the file
    • Set the variable 'Step' to 0
    • Call the "NextStep" function

    * On timer "StepTimer"

    • Call the "NextStep" function

    * On function "NextStep"

    • Add 1 to 'Step'

    ** If Array(Level#, 'Step', TimerSlot#) > 0

    -- Start "StepTimer" with the value in Array(Level#, 'Step', TimerSlot#)

    * Always:

    • Write the text at Array(Level#, 'Step', TextSlot#) at speed Array(Level#, 'Step', TextSpeedSlot#)
    • Display the appropriately numbered sprite found at Array(Level#, 'Step', BackgroundSlot#) and move it to the background area, and make all other sprites from the background category invisible
    • Display the appropriately numbered sprite found at Array(Level#, 'Step', LeftPortraitSlot#) on the left side, and the same on the right but with RightPortraitSlot#, and make all other sprites from the portrait category invisible
    • Play the sound effect, if any, defined at Array(Level#, 'Step', SoundSlot#)

    * If Array(Level#, 'Step', TimerSlot#) = 0

    • Prompt the player to push a button to continue

    ** On the push of that button, call the "NextStep" function

    * If Array(Level#, 'Step', TimerSlot#) < 0

    • Proceed to the next level

    Anyway, I'm sure you could adapt this to your purposes. Just add more Z slots to your Array to do more things, and of course more X and more Y slots for levels and maximum steps per cutscene, respectively. Mine's presently at about 10X, 40Y, 8Z; it's much easier to handle with an external editor (or a dedicated layout), as you can probably imagine. I guess if you're strongly inclined, though, you could just set a whole mess of values by hand in an include sheet.

  • What I think is actually going on is that time delta continues while things are loading (i.e, the time delta for the first frame of a layout includes the time it takes to load the layout as well as the time it takes to execute the events and draw the screen) but the event sheet isn't running extra times. That's what happens with my game. How I solved that was in the application properties/runtime properties/advanced, set the minimum frames per second there to something like 30. That way the time delta won't keep racking up while it's loading.

    Instead of using a countdown timer based on time delta, what you should use (again, what I'm using) is a tick timer. Basically, if value is greater than zero, subtract one from that value. Every time the event sheet runs, you'll know it by watching that value.

    As for a loading screen, you can do that too. Before going to the layout that takes a long time to load, put a black sprite or box across the whole screen and your loading image somewhere as well in the previous layout. There is a trick, however; you have to display that one frame before going to the other layout (let the layout finish running its events), or it won't draw the loading graphics before going to the other layout.

    I tested the idea of it being based on TimeDelta, and no luck. I've already got minimum FPS, etc, set up. When I ran a simple once-per-loop increment counter, it seems that there are multiple ticks (between about 165 and 750, depending on the machine I've tested it on) of actual game logic going before the layout is visible.

    As for implementing a loading screen, I should have specified that it's not an issue of getting something like that working, but rather of overcoming this particular hurdle in order to make it work. I've got a nearly feature-complete game here, and this is one of the biggest obstacles it's still facing. The suggestion is appreciated, though, as a month or so ago when I first picked up Construct I was trying to do everything like I would do it the hard way in C++ (old habits are hard to break!)

    Any other thoughts on this one?

  • I've run into a bit of a snag, and it's probably not one that comes up often. I've got a layout with, quite frankly, a whole ton of objects on it (predominantly low-resolution sprites). Accordingly, it takes a long time to load (roughly 4 seconds on my machine, probably worse on others).

    When the player starts the level, obviously it would be handy to know when they're actually going to be able to see what's going on in the first few seconds. For whatever reason, the script's still running even though the visible display hasn't actually switched over.

    I've got a little countdown timer at the beginning of the level, presently set to 5 seconds, during which time the main loop in my script is disabled. But, of course, 4 seconds of that are already gone by the time I can see what's happening, and I'd like for it only to be 3 seconds (and visible!) anyway.

    Yes, the objects are strictly necessary.

    What I'd like to do, ideally, is to make an opaque layer visible while all the objects are loading, with a standard little "Loading..." message in the middle of it. But, since I don't know of a way to test for that, I was hoping someone here might give me some advice on the best way to accomplish it.

  • Turns out, in this case, that it (and some other odd incredibly problems that were cropping up and making my game completely unplayable) were due to a stray "System: OR" in a completely unrelated section of my script. I don't know how it got there, frankly, since I don't use the OR condition, and am well aware that it's bugged. But there it was, mocking me. (Any chance that could happen due to Construct corrupting the file when saving?)

    Also interesting is the fact that I have specific checks before setting any animation about whether that animation is already playing, and those were completely bypassed. So that's doubly strange.

    Anyway, problem solved, and I hope that the "OR" condition is fixed at some point.

  • What sorts of things can cause a Sprite's animation to completely stop, besides calling "Pause animation"? I've got some characters running around in a particular project, and occasionally they completely lock up - no movement, no animation, etc. Other Sprites don't have this issue. This is a recent problem, and they have been working without issue up until now, and without any changes being made to the animations themselves, or even to the properties page of the Sprite.

    Just not sure where to hunt for this bug. Thanks!

  • That worked great for me, until it crashed (on exit). But it's awesome that you made it happen!

    Not that this necessarily is the place for it, but on the off chance it helps you with writing your plugin, here's basically what I'm doing in C#:

    namespace LaunchWithFonts
    {
        class Program
        {
            [DllImport("gdi32.dll")]
            static extern bool RemoveFontResource(string lpFileName);
            
            [DllImport("gdi32.dll")]
            static extern int AddFontResource(string lpFilename);
    
            static void Main(string[] args)
            {
                Console.WriteLine("Loading dependent font files...\r\n");
                
                //Set these to actual font names being used in main executable.
                String[] fonts = { "font1.ttf", "font2.ttf", "font3.ttf", "font4.ttf" };
                LoadSomeFonts(fonts);
    
                //Load game .exe (edit to the correct file name first)
                System.Diagnostics.Process.Start("Construct-app-name.exe");
            }
    
            public static void LoadSomeFonts(string[] strFilesToProcess)
            {
                if (strFilesToProcess.Length < 1)
                    return;
    
                for (int i = 0; i <= strFilesToProcess.GetUpperBound(0); i++)
                {
                    FileInfo objFileInfo = new FileInfo(strFilesToProcess[i]);
    
                    if (!objFileInfo.Exists)
                    {
                        Console.WriteLine("Couldn't find font: {0}", objFileInfo.Name.ToString());
                    }
                    else
                    {
                        AddFontResource(strFilesToProcess[i]);
                    }
                    objFileInfo = null;
                }
            }
        }
    }
    [/code:2plotmnm]
    
    It's cobbled together from a couple of sources, and some work of my own, so my apologies if it looks a little sloppy.
    
    edit: Apparently I had that routine set up with a 1-index and not a 0-index, oops! Too much Construct for me these days, and not enough C++/C# I guess.
  • That actually makes better sense, as I didn't see anyone complaining that resources weren't working, per se. It's just the first time I've tried to mess with them, and there's literally nothing in the usual places to suggest a better way to do it.

    As for the fonts, sure, I'd very much appreciate a .cap that does what you explained. Outside of playing sounds directly from files, and using the Array object's save-to and load-from file features, I've done basically nothing at all with files in Construct.

    Of course, there may still be the issue of having to run the program as Administrator in order to install fonts, since that directory is typically writable only with admin permissions. I found a C# routine to temporarily load fonts until the next time Windows is restarted, and I may have to resort to that if your solution doesn't solve it.

  • Ok, so I'm fairly certain there's no Resource Bar anymore. (It's still in the wiki, and the Object Bar isn't, but that's a different issue) I could probably go back and pore through the changelogs and see when that happened, but I'm guessing it was with the release of 0.99 (do I win a cookie?)

    So there's that neat little tree hierarchy in the Project Bar instead, and sections for "Sounds" and "Music" and "Fonts" and whatnot. That's what I want to discuss.

    "Sounds" can be .WAV or .OGG, which is awesome, and probably typical of what most people need.

    On the other hand, "Music" could probably use a tiny bit of fine-tuning. Presently, you can choose from:

    • .WAV files. Alright. No sense restricting your options, I guess, but heaven help you if you're including music of any length, because you're talking tens of megs per file.
    • . MP3 files. Cool. Standard enough that they should be here, and it's what everyone associates with music anyway.
    • .WMA files. Neat, whatever. Although I don't care for the format personally, I'm sure people use it for music, especially music they got from other places.

    Notably, though, you can't include .OGG files in "Music." Which seems strange, given that it's a format made for, you know, music. Not that it's not a perfectly good format for sound effects as well, but it would be nice to say "Hey, Construct, I want to stop whatever music is playing" instead of "Hey, let's figure out what channel I arbitrarily set the music to, which will of course be listed as a sound effect and not music anyway, and stop it."

    So, I suggest that little change be made. It's a pretty minor thing, really.

    Of course, that's all completely moot right now, because resources simply don't seem to show up at all in the dropdown for the XAudio2 object, regardless of whether they're in "Music" or "Sounds." I can only assume that's all something that's being worked on right now (I'm on 0.99.9, if that makes any difference). If this is a bug, rather than just the expected state of things, could someone let me know?

    While you're presumably working on that, mind making the "Fonts" resource section actually work? It would be tremendously helpful, as presently the install packager doesn't seem to have the functionality to include fonts either, which means it's necessary to use a third-party installer if any non-standard fonts are being used in the game. That, in turn, means that the person installing the game needs to run the installer in Admin mode, and that just opens up a whole bucket of worms.

    Ok, that's all I've got for now.