Tube's Recent Forum Activity

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

  • I'm so glad the "else" bug is fixed! Thanks for that.

    Is there a fix coming in the near future for the bug where clicking on / deleting / adding frames to animations for Sprite objects in the Layout Editor sometimes crashes the program immediately? Because that would save me a whole lot of headaches.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am still having problems with corrupted projects (I tend to add and remove families/private variables/stuff and then run into strange bugs).

    0.99.9 is still not the most stable in that regard, however it is miles better than the current stable release.

    Yeah, I'm in the same boat as you are. Corrupted projects are still happening for me as well with this version. Some odd, and seemingly unreplicatable bugs show up within the editor itself, and the project is never the same again. As in, writing the same exact script, line for line, in a new project seems to work as intended, whereas something or other will go wrong with the old project.

    Sometimes it's not even a runtime issue. My favorite one today involved construct.exe crashing every time I attempted to change the font in any Text object in a particular layout. Other layouts in the same project, no problem. Opening Construct again, still the same problem. I ended up copying the Text object to a different layout, changing the font there, and pasting a clone of itself into the first layout. Still, a lot of needless work for something like that.

    And every version I've tried seems to have the same intermittent bugs with the Animator window, wherein clicking on the animation name will sometimes work just fine, sometimes do nothing at all, and sometimes crash the program.

    So, yeah. This version isn't stable, nor is the previous "stable" version, nor the couple of versions in-between. But if we're using the "stable" version as our benchmark, 0.99.90 is as good as any.

    I don't mean to sound especially negative or disparaging, but it does get a little frustrating. I keep hoping the existing bugs will get fixed before new functionality is added, but most of the time the bugs that are squashed aren't at all related to things I use.

  • If I understand what you're looking for correctly, you want to change between levels that are functionally very similar (just different "time periods"). In which case, it shouldn't be terribly difficult, depending on what you have in mind.

    Consider making certain objects global, for one thing. That way you aren't losing access to important information when you change layouts. (Actually, this solves about 80% of the problems I can think of, from my understanding of your idea)

    You'll probably end up swapping around a lot of variables at runtime, each time you time travel, so that you sync up equivalent objects from each time period. Other than being a tedious bit of scripting, there's no reason that should be especially challenging.

    Does this answer your question at all?

    Good luck!

  • I love that you're generating maps via cellular automata. If you want another challenge, try doing it with Perlin noise (it makes for some excellent landmasses!)

  • We come to the borders of my knowledge, so my answer is a bit vague. I know that shaping a window is done by using a black&white bitmap and that it is done on the sytem layer. Also I would assume that shaping a window is only possible on the 2D-layer of the system. In other words: with DirectX as in Construct you can't have a shaped window, regardless of using Constructs parameters or using Python. I hope some other with a bit more knowledge can answer it more precise.

    For the sake of argument, I'm going to agree this is more or less correct. Suffice to say that it's generally outside the scope of what the DirectX or XNA libraries can do, much less Construct.

    If you really wanted to do this, it would be necessary to write code at a slightly lower level. It's certainly doable in C++ or C#, but you'll find that you're largely on your own for the graphics handling, etc, once you're at that point.

    I've never tried integrating DirectX or XNA with it, personally, so take this with a grain of salt: If you're feeling inclined to be adventurous, here's a link (C#) that could be useful. I suspect that you could take a form like that, render your graphics to video memory in the background (via DirectX), and blit them onto the surface of the form.

    Good luck!

  • How about something like this:

    + System: Is global variable 'EnemyBatch' Greater than 0

    + System: Every 1000 milliseconds

    -> System: Create object Enemy on layer 1 at (random(DisplayWidth), random(DisplayHeight))

    -> System: Subtract 1 from global variable 'EnemyBatch'

    Works like this: as long as EnemyBatch is more than 0, it will repeat once every second. Spawn an enemy, decrement EnemyBatch. Tested and working nicely.

    That's pretty much exactly what I said, isn't it?

    Seriously though, that's more intuitive than the way I put it. I really should just stick to writing pseudocode instead of over-explaining

Tube's avatar

Tube

Member since 21 Jun, 2010

None one is following Tube yet!

Trophy Case

  • 14-Year Club

Progress

14/44
How to earn trophies