Exion's Recent Forum Activity

  • Hi,

    This is a mock up event section to illustrate the example. Here, there are two variables, one that is damage and the other that is hitpoints. Both of them need to be send through a function to deal the damage.

    Any of the above global variables above need to be sent through it to apply it.

    The question however is that if it is possible to send a variable name to directly change them with just one line like,

    Function | On "DealDamage" | * System | Subtract Function.Param(0) from Function.Param(1)

    Where Parameters 0 and 1 would be the variable names to do it directly. Instead of using temporary local variables to do so. It's basically sending a variable itself to be modified using parameters instead of using other variables to do so.

    The ultimate question is how to and if it is possible to send a variable itself to modify it directly with the parameter itself.

  • Thanks a lot. It's solved now. dop2000's example fully cleared it out and it was also educational and well laid out. Thanks a lot for everyone else's guidance too.

  • Hey Exion,

    its because the sub-events of the for-loop do not specify which button to turn blue. Right now it says: is there a button that matches the condition? -> turn each one blue.

    I suggest to create another instance variable 'TotalCost' for your BatchBuyButton, so you dont need the division 'Cash/10'.

    It should purchase the upgrade 5 times with including the cumulative upgrade costs with x5. Each upgrade bought increases the upgrade cost by 10% by multiplying the previous upgrade cost by x1.1. So when it is clicked once while upgrade cost is 10, it will have the total cost of 10 + 11 + 12 + 14 + 15. Why i am not using a formula here instead is for both accuracy and to retain the accuracy for any new mechanics to be added so it will emulate to imitate the single click purchases done multiple times.

    I have tried many methods including the one suggested right now but still i am very confused how the Include and Sprite operation priority works with conditions. The problem is likely with the Include itself. When the include is used even the batch button purchases are messed up eventhough on it works fine. When i include it for finding total upgrade cost for the glow, it gets messed up.

    I have even tried this here with direct value comparison with 'else'. But when clicking batch buy button the upgrade costs are not working eventhough it should not be effected while trying to just do an animation change for a sprite.

    In this one, only x 5 glows and rest of them does not glow on top of messing the batch button purchases with the included event sheet to convert the cost. Problem is there with the way use 'include' too conflicting with other 'includes' which i would like to understand on top of this.

    Here is the .capx project file for the above implementation.

    BatchBuyTest2.capx

    https://drive.google.com/open?id=1ps4DvNR4kWmN1dTgtfkPH4xtSN1rNlbi

    It will be great if someone can correct it with an efficient example so i could understand. Eventhough that might be asking too much. I self-learned most of Construct 2.

    You are trying to use "include" as a function or macro. That's not how include works. Copy the code in-place and you'll see it starts working better. Include is generally added at the top, once, which is like having that code all at the top of the same event sheet, running as if it was physically there.

    The Include and Event Sheets were used this way with the Repeat event in another event sheet to be copied to anywhere where i want to get total upgrade cost. It was used to create a temporary variable to find the total upgrade cost to be used for any operations. Instead the entire events should be copied to where ever it's required ? Is there any way to run the same events like Go To Events or run a group with a event link ?

  • Hi,

    I been trying to make batch buttons that will buy multiple upgrades at once when clicked like in here when there is enough cash to purchase them. I am trying to get them to glow by changing their animation to blue when there is enough cash.

    It's quite simple really. I want to use the same sprite for the buttons x5, x10, x20.etc with the number of times they need to run as it's instance variable.

    But all of them are causing many types of errors. One time i got it right, all of them glow together as if the events ran only for the final one. Right now, it is however conflicting with the entire upgrade batch purchase eventhough otherwise it works fine.

    The following are the events that i am using for it. I have disabled that in the project file attached and it just needs to be enabled to see the problem coming up.

    Here is the attached project (.capx) file.

    https://drive.google.com/open?id=1sSTsy ... 8Lj-k4bg2A

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello guys, is there a way to apply patches after a game is released with new sprites and variables when save is turned on, without any problems? thanks

Exion's avatar

Exion

Member since 24 Nov, 2017

Twitter
Exion has 1 followers

Trophy Case

  • 6-Year Club
  • Email Verified

Progress

7/44
How to earn trophies