Somebody's Forum Posts

  • And that tree stump IS supposed to be in the background.

    It just so it won't look...bland.

    I'm pretty sure deadeye means you not using a different object for the stump - this saves video memory and lets you place the stump as you wish.

  • That's the thing - the conversion is a little tricky:

       DWORD HLStoRGB(hue,lum,sat)
       WORD hue;
       WORD lum;
       WORD sat;
        {
           WORD R,G,B;                /* RGB component values */ 
          WORD  Magic1,Magic2;       /* calculated magic numbers (really!) */ 
    
          if (sat == 0) {            /* achromatic case */ 
             R=G=B=(lum*RGBMAX)/HLSMAX;
             if (hue != UNDEFINED) {
                /* ERROR */ 
              }
           }
          else  {                    /* chromatic case */ 
             /* set up magic numbers */ 
             if (lum <= (HLSMAX/2))
                Magic2 = (lum*(HLSMAX + sat) + (HLSMAX/2))/HLSMAX;
             else
                Magic2 = lum + sat - ((lum*sat) + (HLSMAX/2))/HLSMAX;
             Magic1 = 2*lum-Magic2;
    
             /* get RGB, change units from HLSMAX to RGBMAX */ 
             R = (HueToRGB(Magic1,Magic2,hue+(HLSMAX/3))*RGBMAX +
       (HLSMAX/2))/HLSMAX;
             G = (HueToRGB(Magic1,Magic2,hue)*RGBMAX + (HLSMAX/2)) / HLSMAX;
             B = (HueToRGB(Magic1,Magic2,hue-(HLSMAX/3))*RGBMAX +
       (HLSMAX/2))/HLSMAX;
          }
          return(RGB(R,G,B));
        }
    [/code:2d4srpie]
    
    Then again I always worry about a program doing something a lot, when, actually, that's why we have computers, they can do millions of math operations in the blink of an eye. Perhaps doing it with events isn't that big a deal.
    
    [b]Edit:[/b] yet more - it looks like (well, to me) the canvas object takes whatever it's actual size (instead of inner image) size when making the texture for the screen. Is there any way to override this? That would make for some easy blur effects I suspect. As in - grab the layout - resize to 1/4 or so, display at the same size as layout = (slightly ugly, but) blur!
  • Actually if I use any of the "Grab Layout" options the Canvas is just pure white. Weird...

    I put it on top of everything, on a new layer on top, tried the "Force own texture" for layers, still white.

    Will have to look into it. Also, since you are here, Ashley - is there a command for HLS, like there is for RGB(R,G,B) for setting colors?

  • But that only works for the entire screen, right? It would be nice to have it per-layer, say for background only.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello once again!

    You can skip to the next green line if you are a tl;dr kinda person.

    Time for more Ideas for more things about which people can say "But you can do it with events!" and label me a lazy bum in their heads (or maybe not)

    Anyhow - right now a layer (and everything I guess) gets redrawn every frame, replaced with the new stuff. Not like the old days of, say, a ZX Spectrum where you had to erase the screen by hand to create the illusion of motion. But if you didn't there was the nice side effect of seeing all the trajectories basically burned into the screen.

    I tried to achieve this effect using canvas (check it out here http://dl.dropbox.com/u/1328856/Motion%20Trails.cap), but there's a certain limitation that you need to paste sprites into it and the result leaves a bit to be desired, since there seems to be no way to affect only the tint and opacity of what's inside canvas (actually a simple opacity option for Clear canvas would be real handy).

    So anyhow, right now when something moves in a layer each frame it does it like this:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/LR1.png">

    What would be great would be a layer effect (so that there's no object pasting, no canvas, no events) which basically takes the previous frame, but instead of erasing it completely just lowers it's opacity, thus giving us this effect (here we could assume it lowers the opacity by 20% each frame):

    <img src="http://i244.photobucket.com/albums/gg36/some9000/LR2.png">

    Even better if it can be given a tint, like this:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/LR3.png">

    I suspect it's not quite that simple - since the system probably handles the frame erasing process and you'd have to pretty much copy/paste the layer contents and adjust what's pasted.

    Still, it'd be a great effect - seen a lot in those Geometry Wars style shmups so popular a couple of years ago.

    As for parameters I think the best would be Time to a full fade out in ms - So if you enter 1000 then the effect will take one second to fully erase the trail. In an example of 60 fps that would be lowering each previous frame's opacity by 1.66% or so.

    So either this or additions to the Canvas object such as "Paste Layer to Canvas" and "Erase Canvas with opacity" would be very handy.

    Edit: Sort-of on topic - in the example wanted to give the ball a nice retro rainbow effect, but it seems there is no RGB(R,G,B) like command line command for HLS (or at least I couldn't find it). That would be a nice addition as well.

  • I could probably pull something like this together in around a day, so I'll probably take a crack at it.

    If you manage to make animatable proportional scaling... you'd probably get a big golden shrine in my little shmup (along with deadeye who'd probably be represented as an acquirable ally WWII fighter pilot who disappeared over the Bermuda triangle, is VERY good at shooting, hence the name and now flies his fighter plane ... IN SPACE ... we far enough off topic yet? )

    Seriously, though, would be great if you could do it some day.

    Not immediately, though, as I've got more important plugin related things I need to finish up at the moment.

    Yeah, the sprite button project looks pretty good. Actually all the previous ones are great as well - using Orbiter in a project as we speak. Keep up the great work

  • The wait object has quickly become a top one here (no counters, no extra events - awesome), so damn handy! But the poor thing has no Object image and the icon is all pixelly.

    So I made a nice bigger icon while trying to stay true to the overall style and the original:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/LittleClock.png">

    And here it is at 32x32:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SmallClock.png">

    Perhaps it could end up in Construct some day (well, if the author is up for it, I guess). If not - well, no biggie.

    P.S. Couldn't find any specific mention of this great object, hence the new topic.

  • How is this any different from the "Set width" and "Set height" actions?

    It's lazy people friendly and lets you enter a single value instead of doing something like this.height = this.height * percentage/100 or so.

    And those commands don't do it proportionally, do they?

    I'm just wondering what would make this plugin worth the trouble of creating

    Well, yeah, it's mostly a convenience thing and I must agree development would probably take more time and nerves than most users using it instead of events save. I'd still love an easily animatable Scale behavior. Using extra variables in objects always seems so... "dirty"

  • I'm pretty new to Construct myself, so no comment on the code, but wouldn't using a Repeat(MonsterDensity) event be easier here?

  • Hello, everybody, and above all talented plugin devs

    Having worked with Construct for a little while the need for one behavior pops up most often and that is � Scaling. Sure, it can be done with timers and events by doing some math, etc.

    But what would be AWESOME would be a decent Scale behavior. Something that lets easily scale a given object both statically and over time. I took the liberty of thinking up some functions it might have. To help illustrate here is our friend the gray rectangle:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SB1.png">

    And now for all the functions:

    PROPORTIONAL SCALING

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SB2.png">

    Scales the object proportionally.

    Would be great: Resize proportionally by width, Resize proportionally by height.

    SCALE WIDTH

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SB3.png">

    Scales only width.

    SCALE HEIGHT

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SB4.png">

    Scales only height.

    PROPORTIONAL SCALING OVER TIME

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SB6.png">

    Set the time in ms and amount to scale the object proportionally.

    SCALE WIDTH OVER TIME and SCALE HEIGHT OVER TIME

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SB7.png">

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SB8.png">

    Also awesome would be a feature to set the size by both pixels (for a straight up fixed size) and percent (to scale object to a given percentage of itself).

    If anyone would manage to build a behavior which does all this that would be simply amazing (a guaranteed place in the pantheon of godlike plugin coders for sure). Would try to do it myself, but C++ just isn�t a programming language I can digest.

  • Heh, had this very same question come up yesterday, now I know� why they were empty. Thanks again, deadeye.

  • Some keyboards, especially in central and eastern European countries, have Z and Y keys swapped. *shrug*

    I'm quite sure he means "Redo", which is usually mapped as Ctrl+Y

  • Okay, I've tracked down the bug in your .cap. It's the CyclopodDroneDamaged object that's causing it. Or, more specifically, it's the Rotate behavior that's on the object. If you remove the behavior, the game runs fine.

    Wow, thanks for tracking that down - gonna remove it, can do without it or do it differently anyways.

    Here's an example that uses Custom Movement:

    http://dl.dropbox.com/u/529356/mousecontrol.cap

    v0.99.82

    Hope that's the sort of thing you were looking for.

    Absolutely! Exactly what I had in mind. Thanks once again.

    The jaggies once again suddenly disappeared, although I tried the suggestion previously and it didn't help. Well, if all else fails less layers it will be.

  • Thank you! This is a thing of beauty - paired with turret behavior it makes some damn fine orbitals for a SHMUP game.

    And sorry for bumping this up after such a long time, but the author deserves it

  • There were some other examples of things like this going on in your game logic, but I'm not on my Construct computer right now so I can't recall exactly what they were. And like I said, it's not really "wrong," it's just harder to unravel.

    Yeah, will have to look into it - actually I only just now noticed the timer behavior for objects, d'oh! This should help untangle the object dependency problem. Since the CoreSpark was basically just a timer for the Core.

    Anyhow - closer to topic - finally transferred our friend the Phoenix MKII attack fighter from paper to a vector sketch and inserted it onto a new layer - a HUD layer on top of all others so that the ship is never obscured. This seems to instantly set the Sampling to point for everything (if the underlaying layer has Effects on it) resulting in crazy jaggies:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/Jaggies.jpg">

    I wonder if its a graphics card thing, a DirectX thing or some sort of Construct behavior. The graphics card certainly isn't being taxed here, without limits it goes around 800 fps easy with plenty of action on screen.

    Also - evilly exploiting your helpful nature - I'd like to have the ship mouse controlled, but with a 8-way like behavior = limited speed, slight acceleration and deceleration. Wonder if there's any way to do this without too many extra events (like changing bullet movement speed and direction depending on where the cursor is)?