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 ?