Vilehead's Forum Posts

  • okey now i want to cut myself...

    in your cap, you have 11 frames, and i have 11 frames. in your all frames are correctly displayed coresponding to values. in my, max value frame is like only displayed when Current is higher then Total. the only diffrence is that your cap doesnt have the auto regeneration and doesnt uses decimal values.

    and yes i know i am stubborn but i still havent learned why my method doesnt work when basing on logic it should work.

  • [quote:1qldbgrl]1- you can simply create a secondary set of animations with 8 angles and program your own animation, or create a "turnaround" animation with different angles that's being showed when the character is turning. To me, it won't really improve the visual quality of a game and cost a lot of HDD space.

    hmm thats not exactly what i meant. i mean, if you look at the animatior there are only 8 angles. i would like to place more then just that for not only turning but also movement which has all 360 degress. of course i wont make that many. but twice the default - 16.

    and why it would cost more space? i mean, obviously it will. but perhaps just 100kb more. when i properly convert pgn, each frame is not more then 10kb. so instead of full animation being 80kb total, i would have 160kb. and whats 160kb comparing to my hi-res planet texture which alone weights 3mega.

    and btw - i dont know what conditions i can use to make the engine detect turning around

    [quote:1qldbgrl]

    2- I haven't seen such a function with the platform behavior, but you can store the position of the object during 3 frames and combine them so you obtain two 2-dimensionnal vectors. You compare the two vectors and... you can see if your character is accelerating.

    Or you can program your own platform movement with events.

    hmm... i see. thank you.

    [quote:1qldbgrl]3- It will be attached to the same image point (the same name or ID). You only have to place it on every animation you make for your spaceship.

    ahhh splendid! thank you very much. thats what i wanted to hear

    [quote:1qldbgrl]4- Dunno the right technique. I'd personnally draw objects on the screen to hide a part of the map, according to values stored in a dynamic array, but I think this isn't the best solution.

    yeah i figured that one out too =\ i cant think of anything more. and today is like 3rd day of me thinking.

    MAYBE, just maybe there is a way if i would be somehow able to directly from in game cut off some pieaces of the object. but for something like that i need someone with higher and biger knowledge and understonding of Construct then me.

  • 1. Is it possible to have more then 8 angles to make the rotation animation even more fluid and smoth?

    2. is there a way to set the condition for a moving object "when accelerate/deaccelerate", so a custome animation is being played when object speed is increasing/decreasing?

    3. lets say i have an object which has a rotation animation on X dimension (i dont know the english word for it, i mean Y and X and Z - i hope you know what i mean). Now this object has some other objects attached to it on a fixed position. lets say a turret on a spaceship. if i would assing that turret object to image point with specific name, will he be attached to it even if the animation changes? (think two diffrent animation with the same image points but placed on a diffrent possition). diffrently said - will they update their position to the new possition of image point?

    4. old question but... fog of war(starcraft style). i know how to simulate this effect: i would attach an invisible round object to the player character. then make two fammilies: structures and units. and then make it so when that round object overlays the structures - it makes them visible on the layout. and for units i would make it so that ONLY when round object and units fammilie members object they are visible making them go invisible as soon as round object and units does not overlays anymore. or it can be just done by more elegant - code based by creating an conditions always checking for distance betwen the objects and switching their visibility dynamicaly. this would simulate the visibility of "fog of war" but not the visiuals. ofcourse half of the visiouls can be made just by placaing light object on the player. but this would be everything else pitch black or semivisible. and we all know that a proper FoW effect is made by 2 visiouls: 1. for unknown(pitch black) and 2. for known but not in range(pitchblack with some sort of noise + blur + darken effect. now when i know how to make one of them i dont know how to make both of them work - at once. the only idea that crosses my mind is to spawn hell load of pitch black objects around the whole layout + semi-pitch black light based effect. but i can only imagine what a slideshow the game would become with some many objects. so, any ideas?

    i would write more but then some people will bash me for this wall of text

  • oh! so its just another variation of "round" expresion? O.o

    so... i can use my method but i just need to add round...?

    i just dont see whats wrong with my method (aside from the obvious - that it isnt working lol).

    i mean - why? i am just like a guy who was drinking coffee and sudenly his coffee mug explode.

    i am like - What The Hell?

    also... Tulamide. for some reason frame 11 (graphical 100%) is never shown. the value must get higher then 100% like 100,6% in order for it to be show. how can this be fixed? can it? i mean - i can live on never seeing totaly empty ShielBar but never seeing Maxed bar is rather depresing and anoying. this is mostly because of that weird XX.0989987% result i am getting from the proccesor - i know. hey is there a way command to round down or up (or something) variable? the only event options i know are add substract and compare. otherwise i will be forced to follow Arima advice and pass on 0.XX values aka adjuct the whole points system by adding two more zeros to any value (so 0.01 will be now 1). but thats hell of a job and will turn any numbers into massive values (weakest game shield being 10000 instead of 100)

    and well, i still dont know any method of capping a value. beside the obvious IF ShieldsCurrent is greater then ShieldsTotal substract -0.01.

    [quote:t20jw1o1]

    This is confusing more than helping.

    totaly agree no offence of course. i just think i need to "level up" few times and ill be able to get hold on this.

    anyway. thank you VERY KINDLY. all of you. this is an extreme convo and i learn alot.

    in fact, just using/learning Construct and talking with you guys is more brain-stimulating then 5 years of my high-school had been.

    PS:

    and please note that i am NOT using you as my freeware teechers who are just waiting for me to whistle to come runing in lust of serving my needs. i respect you, you time and your imput. no one pays you for what you do, and i am aware of this.

    but laso think how constructive and informative this thread is for any newbie like me who maybe have similiar problems.

  • [quote:3u0a6okv]->sprite set frame to int(shields('health')/100)

    hold on, what do you mean by shields nad health?

    i mean which is Total and which is Current? and do i need to set it for every state or like tulamide?

    sorry. i still dont quit get what int expression really is. but this is more of english language problem rather then me being math-handycaped.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • come on people - say something!

    you know you want it

  • [quote:1nsm11e8]

    Yes, they are, but isn't it much better to work on only one problem until it is solved, then go on to the next, instead of getting information overkill?

    hmm. i need to agree with you but not entirely. you see my values system is all based on "set" event. for example imagine 100 shields types all called with "call function" event. and within that event the changes made by shields switching are made by "set var" event.

    now imagine later when ill type all that engines, shields, weapons, reactors ect stats and ill find out that to have a buff/boost/bonus thing i must use something else then "set var" event. and now 2-3 days spent on rewriting all the "call functions".

    its not like i want to do everything at once, its just i am a well planer aka i always try to met an dead end and be forced to go allll the way baaack.

    thats why i want to know that before ill reach the "point of no return".

    here, today i would propably use few extra variables to get the total value. like total value = valueReactor + valueBonus1 + valueUpgrade1 + valueAllYourBaseBelongToUs. but i would need to reserve a space for such variable. hmmm thinking of it... maybe ill just make that emergency variable after all? so when i change the TotalValue count so all the totalValue scatered around "Call Functions" be get auto-fixed.

    [quote:1nsm11e8]It converts a string or a float to an integer by rounding down.

    string = text and float = ?

    but... oh man. this might be beyond my capabilities. thats sound like chinese to me. its like saying it converts Er'Zuhz or a De'ruhn to an Elhe'lion by rounding down (thats dwarfish btw).

    dont get me wrong, i am not jumping at you. i just look down, with pity, at my lack of understanding asking myself that horrible question - em i really sure i want to make a game with so less near to nothing programing knowledge. at this point i cant see how i am supposed to finish my game without some 2nd dev helping me out constantly(that wasnt any kind of suggestion, just my growing depresion).

    [quote:1nsm11e8]The formula I wrote down is designed to show the shield status 100% only, if EnergyCurrent matches exactly EnergyTotal. On the other hand it displays the 0% frame also up until a certain amount (when using 11 frames everything below 10%)

    If you want to tweak its behavior, just replace 'int' by 'round' or 'ceil'. Ceil rounds up to the next integer, and round rounds to the nearest integer [=> round(1.49) = 1, round(1.5) = 2]

    If you use 'ceil' instead of 'int', then the 0% frame is only shown, if EnergyCurrent is exactly 0, whereas the 100% frame will be shown for every value above 90%.

    <img src="http://1.bp.blogspot.com/_UME67yLANIY/SvMhgOzXSEI/AAAAAAAAATw/Ay8PDdHDVAU/s320/jawdrop1236883259.jpg">

    umm, so what? hold on. so okey umm and what if i want the opposite? i mean to have 0% be drawn when value is 0-9%? (+/-) or both? like 0% only when 0% and 100% only when 100%?

    i am so sorry Tulamide, you must be feeling like talking to a rock

    [quote:1nsm11e8]Just because I have a

    HUGE

    lead over you in programming. Just keep on doing and you will solve such problems by yourself with ease. Promised.

    there, fixed. and i am more interested "why" technicaly my doesnt work.

    like - all the ranges are being set, are conditions are being met. but it still doesnt aint working.

    100% = show frame 11 (100%)

    90-99% show frame 10 (90%)

    80-89% show frame 9 (80%)

    and so on. i dont understand why the engine cant get it and is either stuck on 1st frame or the 11th totaly ignoring everything betwen. and i am asking also because - not always the % splits we'll be the same. imagine a situation when i would want/need 10% frame be drawn on 20%, 20% be drawn at 60% and 30% be drawn on 90%. thats 3 diffrent jumps and the splits arent equal. with my method (if it would be working that is) i can easly adjuct any range(s) how i please when with your (even if its working) i am stuck with equal pieces.

    and well, in most case i am uncertain will it work or not. but in this case was was 100% sure this will work. the rain started falling, ive opened my umbrella but my head still gets wet. i want to know why. where are the holes in the umbrella and how can i fix them.

    EDIT:

    oh great, it apears i cant define Variable with a sum of variables. like variable 1 = variable a + variable b. at least not from variable manager. my only idea is to set a "always" event defining that var. shame the variable manager doesnt recognise expressions though.

  • thats wicked.

    and it almost works. and i dont know why.

    the problem is, last frame suppose to be 100% ShieldEnergy only, just the first frame 0% should be displayed only when ShieldsCurrent hits 0%. with this the last frame 100% is for some reason never played, or should i say - it is but if ShieldCurrent is about 100% (100,000001% for example).

    so anyway, two questions:

    why my method doesnt work and why your does.

    also - what the heck is int expression??? i never seen that before on both expresions and system expresions pages on wiki.

    and well... many my previous issues are left unasweared

    [quote:3th6hoph]That's because of rounding errors - floating point numbers like 1.2 can't be counted on to be calculated exactly. It's a limitation of processors. If you want exact numbers, stick to integers (whole numbers without decimals like 1).

    wow. everyday i learn something new. never knew about such thing. how weird is that O.o like - it can easly count 2 + 2 but have troubles with 0,2 + 0,2?

  • hmmm. somethings wrong but i dont know what. now it works partialy. so when Current = Total it displays the 100% value but stays at it and doesnt change.

    i triple checked the animation, its setting, constrollers, variables and all is okey.

    from what i have traced - for some reason ONLY the first condition

    IF global('Spaceship - EnergyTotal') * 1[/code:1cq7u4wl]
    is being exectuded. the rest is just ignored. 
    
    sample of the rest:
    <img src="http://img84.imageshack.us/img84/8453/14403168.png">
    
    so i presume they are to blame
  • What trigger once does is it runs the code the one tick where the condition became true and will only run again if the condition becomes false then true again. Without it the code would run every tick while the condition is true. It does not simply run once period.

    What you want to do for your second question is use global variables. When you change a global variable it'll be changed for the entire program. So for your example have a variable for you door and have it 0 when the door is closed and 1 when it has been opened and it'll stay opened/closed if you change layouts.

    Thank you kindly.

  • * off-topic *

    And here a description of the modulo operation:

      The percentage sign, when used outside of a string, is an operator, just like +, -, *, /, etc. And it does divide, but a modulo division, aka 'mod', giving the integer remainder of the division:
        13 % 5 = 3 -> can also be expressed by: 13 - floor(13 / 5) * 5 -> you can also do ((13 / 5) - floor(13 / 5)) * 5 -> it is just returning the decimal places of the division multiplied by the denominator
          13 / 5 = 2.6; 0.6 * 5 = 3
      Modulo is often used in programming to get a repeating list of ordered numbers. For example, the timer returns the milliseconds passed since start of the application. You want a sprite to constantly fade in and out repeatedly and every fade should last 1 second. But the sprite's opacity is expressed by a value ranging from 0 to 100. So what we need is converting the timer value in a way that we get a value repeatedly growing and shrinking between 0 and 100.
      • There are 1000 milliseconds in one second, but we need one second to be 100.
      • If doing 'timer % 100', the results returned will raise from 0 to 99, then immediatly fall back to 0 and raise again. [0, 1, 2, ..., 98, 99, 0, 1, 2, ...]
      The first issue is solved by floor-dividing timer by 10. The second issue is solved with two other tricks. First, we set the denominator to 201. This way the values returned will range from 0 to 200. Second, we make use of 'abs', which returns the absolute value of a number regardless of its sign (-4 and 4 both have the absolute value 4) The final expression now is: opacity = abs(100 - floor(Timer / 10) % 201) The returned values will be [100, 99, 98, ..., 2, 1, 0, 1, 2, ..., 98, 99, 100, 99, 98, ...] and every range 0-100 or 100-0 will last 1 second

    I just thought I explain it for those who are curious beginners. If it is inappropiate, I apologize.

    <img src="http://goteaminternet.com/img/docs/65991.jpg">

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

    done and ready. still not working.

    New issue #1:

    another weird thing that i have just discovered is weird effect of "every X milisec's" contidion.

    for value regeneration i use plain "Each X miliseconds" conditions and offten my values are like 1.20 0.80 3.33 ect. my problem is on example of Shields Regeneration. it starts with

    0 value with 1.20 regen rate and goes all the way to 38 and then BLAM 40.7999999999999, and becomes even more and more messed up with each second. now how 1.2 value multiplyd by any round number can become 40.7999999999999??? O.o

    i know that i can fix at last the shown value by adding round() around the var but its just like pushing trash under the carpet instead of cleaning it.

    new Issue #2:

    Bonuses/buffs. in many games you have those. like a ring of power +9 to str, magic shield +10 to AC, skill that grants you a passive +10% to all dmg.

    now how can i do this in Construct? what sort of conditions i should use? the only i can think of is hell of a work to make the Total value be (var value + value bonuses) and opening another var names bonuses and then enlisting ALL kinds of bonuses i can have.

    on example of my game. i have variable EnergyTotal that is being set by the Reactor Function. but would like to also have like batteries, special perks, rare awards that add passive values to var EnergyTotal. and there would be no problem IF i would have just one type of reactor. i would just use var add value. but i have many types of reactors and i want the EnergyTotal value be always updated with the bonuses. like for example:

    Reactor 1 with TotalValue 100 and a bonus +15 to TotalValue. so the total value is 115.

    now i change Reactor 1 for a better one Reactor 2 which has value 200. so i want that bonus to be added as the last and combine with other bonuses. otherwise the previous TotalValue of ReactorValue + Bonus 1 will be overwrite with just the total value set by new Reactor 2, so instead of 215 ill get 200.

    any ideas?

  • 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:3ffo3wza]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)

    ih man i knew this most be something obvious right in front of my nose!

    Thank yiu for that link Newt. i did check the "espressions" page, didnt figure out theres another diffrent one hah

    now - many things became so simple

    [quote:3ffo3wza]In that case, it's always better to simply not allow that to happen.

    thats the problem. if the would be just couple of conditions that changes this var i would just turn them off by auto with conditions, but the problem is - theres lots of conndtidions that changes this one and its an ant-job to add off switch for all of them or even keep track of them.

    thank you very much for the cap mate

    EDIT:

    okey guys it seems i screwed up once again

    whats wrong with this?

    clamp(global('Spaceship - EnergyTotal'),global('Spaceship - EnergyTotal')*0.6,global('Spaceship - EnergyTotal')*0.69)[/code:3ffo3wza]
    
    <img src="http://img829.imageshack.us/img829/908/shit0.png">
  • actualy i was just an idiot and though that if i write % mark it would (just as using your calculator) divide. forgoten this obvious fact that 10% are in fact 0.10, and to get 10% of something i need it be multiply by 0.10.

  • [quote:1pwehmyb]To get 50% of a value just multiply by 0.5.

    now i feel like an retard lol. damn you elementary math!

    Thank you R0J0hound!

    so the condition would be IF global('ShieldsTotal') & = & (global('ShieldsTotal') & * & 0.5) ?

    even so - i still dont know how to form a range of values (e.g all betwen 40 and 70)

    and obviously i still havent figured out how to make a variable change its value to another variable value. if i use

    IF variable X = or > then variable Y

    then

    set variable X equal variable Y

    hell breaks loss and both variables becomes linked togather - so if i change any of them the second follows.