Greaver's Forum Posts

  • Did you add that layout name (the layout with your UI, health bar, gold count etc etc -) to each layout?

    To add a layout to each layout? Or do you mean layer? lol, yes my layers are global.

  • > And yes i made everything global in layers on the first layout, i still cant access any of them in the second.

    >

    Did you make the layer itself global?

    Yes i made all my important layers global, they dont appear on the next layout ^_^

  • Greetings there!! ^_^

    So, i have made some nice UI, health bar, gold count etc etc -

    However when i enter the 'next' area, (-> Go to Layout) - then None of it follows? All the layers are gone also, the ui is gone

    and there is not even a character there unless i place it out in each layout?

    Is there a way to just transfer everything in the first layout to the next? Health bar, mana bar, gold etc..?

    And yes i made everything global in layers on the first layout, i still cant access any of them in the second.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are literally dozens of ways to do this. You'll need to experiment and find the way that works the best for you. I've put together a capx of one way for you to hopefully get you started.

    https://www.dropbox.com/s/ox5igc3xe1bin ... State.capx

    EDIT: I just noticed that you said you wanted an effect animation to change, not the player animation. In that case, you would do it the exact same way as shown in the capx, just add the variable etc to the effect sprite rather then the players. I've updated the above capx with an example.

    Hehe hey!! Gotcha now!! ^_^ - Thanks alot for this!! You really took your time man, very much appreciated!! ^_^

    Thanks! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Yes, I do this all the time. What I do is make the value of the variable the same as the animation name, then you can make an event like this:

    On Q pressed set player var_animation to "animationname"

    (whatever trigger you like) set player animation to player.var_animation

    or

    If player var_animation="walkleft" set animation to player.var_animation

    Hehe hey, this is so good to hear!! But i dont quite understand what u mean.

    When character jump, depending on item equipped, a different animation plays (on the effect)

    So as far as i understand it, the Variable has to be the same name as the effect right?

    So ability name: BootsFX

    Global Variable name: BootsFX

    If player equips Boot 2 -> Set BoostFX (Variable) to 2.

    If player equips Boot 5 -> Set BoostFX (Variable) to 5.

    When HeroX performs ''jump'' - Set animation to BoostFX? The variable that is?

    (If the boots equipped is Boot 2 (BoostFx2) - If i play the Animation in Variable, will it be BoostFx2 Effect??

  • Basically to play Animation 1 if Variable is 1

    Play animation 2 if Variable is 2. Etc

  • Greetings there! ^_^

    So i have about 55 animations that needs to be played, depending on *items*.

    Now, it is a bit too long to do;

    ''When button Q is pressed''

    ''If (Global Variable is 1) = Play animation 1.

    ''If (Global Variable is 2) = Play animation 2.

    ''If (Global Variable is 3) = Play animation 3.

    And so on, and so on.

    So my question is, can animation be played by a Global Variable number? For example;

    'When Q button is pressed''

    ''Set animation to *(the variable)*''

    So if variable is 1, it plays animation 1, if the variable is 2 then play animation 2 and so on? Or do i have to take the long way by IF and do's?

    Thanks alot ^_^

  • Should not. Plz upload a .capx.

    I am trying but i cant. It seems the line of sight is what is blocked by solids.. :/

  • Hehe greetings there! ^_^

    So i wanted 'coins' to move towards the player when nearby, by using Line of Sight.

    However even if i set 'Obstacles' to custom, it is still blocked by 'Solids'. Even if i ''clear'' all obstacles, then it is

    still blocked by solids. Any way to remove this??

    Thanks! ^_^

  • Greetings there!! ^_^

    So i am currently experimenting with damage which comes from stats + weapons, and then display it in text.

    However depending on the damage, sometimes its ''25.7'' or ''25.9'' - now is there a way to make the

    number display to round up? Like 25.7 should be 26. And so on.

    Since the damage scales in % wise, the decimals keep happening.

  • > Health - (Damage - Damage * Armor/100)

    >

    > must be Damage and Armor and Health.

    >

    Isn't it faster if we set Armor = 0.8

    And just do Damage * Armor? - Shorter code no?

  • Divide by 100 to get percent. (20/100 = 0.2 AKA 20%)

    multiply result to get percentage (0.2 * 60 = 12 AKA 20% of 60)

    subtract percentage from self (60-12 = 48 AKA 60 dmg - 20% (armor))

    subtract result from health (150 - 48 = 102)

    Health - (Damage - Damage * Armor/100)

    150 - (60 - 60 * 20/100) = 102

    Yeah that does not work because we cant willy nilly pick any number, the armors are fixed Variables. Try to do it with these variables instead -

    Health = 150

    Damage = 60

    Armor = 20

    Now go. When hit, *Substract from Health* = ???

    Your part above, go show me - The armor on each target vill vary and not be the same, so we cant use random numbers in the code, must be Damage and Armor and Health.

  • Ninja'd, but anyway:

    To get 20% of something, you multiply it by 0.2 (that is 20/100).

    So assuming I understand, if damage is 60, but you want to reduce it by 20%, 60 * 0.2 = 12, so 60 - 12 = 48 (adjusted damage). What was being pointed out above, is that you can do it simpler by multiplying by 100%-20% = 80%. So 60 * 0.8 = 48.

    Hey i dont understand what he is trying to say honestly, maybe u can help? ^_^

    I know the counting but i cant use the above to get the code.

    Health = 150

    Damage = 60

    Armor = 20

    So the code is, when hit, *Substract from Health* = ?? what? How to do it using variables of the above?

    Becuase if armor was 0.2 instead of 20, then using = Damage * Armor - Damage will become a negative number.

  • round(value / value) * 100

    round(55 / 80) * 100 = 69%

    Im sorry what? That explains nothing... Like seriously i know u guys trying to help but ur not making sense at all.

    My Code is, ''Substract From ''Health''; Damage - armor''

    Health = 150

    Damage = 60

    Armor = 20

    I want the code above to deal 60 dmg - 20% (armor.)

    I cant make it a constant 20% since armor will vary..

  • [armor] - [dmg] * multiplier

    Set the multiplier to 0.2 to only use 20% of the damage.

    Use 0.5 to use 50%.

    Im sorry what? That does not make any sense to me, sorry.

    Basically when Player is in colission with bullet -

    Subsctract Damage - Armor from Health

    If armor is the value of 20, i wanna turn it into 20%

    So if Damage is 100, it should be 100-20% = 80 dmg from health