newt's Forum Posts

  • [quote:21s5xrmq]This is confusing more than helping. Please have a look at my long post about it. There are two variables that are related to each other and influence each other. Also, my expression never reaches frame 0, I think it is a better way to make sure you don't get unwanted values instead of hoping that Construct will catch the error.

    What ever.

    Still say it's a better way. He just needs to get the value of the variable before he even thinks about setting the frame.

    Then there's the lerp method. You can use 1-10, 1-11, 5-20, and change the modifier to n*0.1.

    And if your terribly worried about returning a zero, all you have to do is change the always condition to a comparison making sure its greater than 0.

  • Yeah^

    Int() just means that you want to use an integer, or whole number.

    Not 0.5, 1.98988, but 1, 2, 3....

  • Lets look at this in a more simplified way.

    If your max shield hp is 1000, and you have 10 different states, you can use that as a percentage.

    always

    ->sprite set frame to int(shields('health')/100)

    Note:

    Frame 0 is not possible, but the system will use the closest to it frame 1.

    http://dl.dropbox.com/u/666516/framepercent.cap

    And while your looking at the system expressions take a look at lerp.

    int(lerp(1,10, Sprite.Value('hp')/1000))

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think your over complicating things. Try getting rid of the Else's and put every condition as a separate condition.

    If that works, then you can go back and try to simplify it more.

  • does this help?

    <img src="http://dl.dropbox.com/u/15587147/answer1.bmp">

    Just as Tulamide pointed out that a sub condition if fine with used with Else, Trigger once is best used as a sub condition. Since it has no condition to compare it will probably run every time, which is something you want here, but for logic's sake an Always would make more sense.

  • Take it easy. It'll come

    Ampersand (&) is for strings(text), so that's really not where you want to go here.

    There's another page you might want to take a look at: system expressions.

    http://sourceforge.net/apps/mediawiki/construct/index.php?title=System_Expressions

    If you look there you'll find clamp:

    [quote:1xcn8spr]Clamp(Value, Lower bound, Upper bound)

    Returns Value if it is between Lower bound and Upper bound. Returns Lower bound if Value is less than Lower bound. Returns Upper bound if Value is greater than Upper bound

    So...

    clamp(variable,40,70)

  • I wouldn't call it a bug, it's just that the debugger is very particular.

    Good in some ways, bad in others.

  • You have two conditions on 6. Else means run if the tied condition is not met, so another condition saying not to run causes the error.

  • Looks like somethings getting turned into a string. Might try adding an int() on both sides.

  • I don't think you can get anything other than a single pixel. Even if you could detect a quadrant, what if there's more than one color within that group?

    You would need some sort of algorithm to get a mean, and that would undoubtedly slow it down even more.

  • Heh, yeah it's kinda like that other thread about the avi object. It sounds good in theory, but the logistics really take a bite out of it.

  • Its been broke well before the 0.9's, and I think a couple fix's to the object as well.

  • Ahh, well in that case, I'd say you don't have to load an external file.

  • You don't necessarily need python to do that. In fact the array object works quite well for this.

    You do know the object can save, and load an external file don't you?

  • You need to add an event to plot your objects on the minimap.

    Something like this should work:

    + System: Always (every tick)
    -> Minimap: Clear terrain
    -> Minimap: Draw terrain Sprite with scale 2
    [/code:2tu2713y]
    

    Actually I think there's a bug with draw terrain. In the past all you had to do is draw it once, and it would stay on the minimap. You can do that now, as shown in the cap, but if you put the scale less than 2 it won't show the plot for another object.

    http://dl.dropbox.com/u/666516/minimapbugdrrawterrain.cap