Exion's Forum Posts

  • I like to reset all the button animations first, then check if mouse is over a button, I pick the top one (in case you have overlapping buttons) and set its animation to hover.

    Thanks for the solution. It's working now. :)

  • I got many instances of same object 'Button' which is a sprite object. When i hover the mouse over single button only that one needs to glow.

    I created a 'Mouse Cursor is Over Button' as well as inverted 'X Mouse Cursor is Over Button'. So when it is hovered over a button it's animation gets changed. While the inverted condition is there to change to default animation once it is no more over the button.

    But when i move the cursor really fast over many buttons while making it remain inside one of the buttons, all of the ones i drove the cursor over glows. Since the first condition is not at all broken since the cursor has somehow not left any of the buttons. Only when the mouse has left the button, all of them goes to default animation.

    The problem is that the 'Mouse Cursor is Over Button' condition applies to any of the buttons and not just a single button. I tried giving them instance variables but hovering over any button still seems to give the same result as all of them are still passing the value instead of just one, i think.

    How do i fix this ?

    Example Test : https://drive.google.com/open?id=1WODl0PlDOKdwAsj7VRbVHcwRPYESaqaC

    Tagged:

  • Thanks a lot again. It took a bit of experimentation with it yesterday and it's working very well now.

  • I was trying to parse values from a text file. So when i used AJAX it seems like there is a delay to wait for the request to be completed and during that all the dictionary keys i previously used which i am replacing with AJAX don't get filled for the other events to be run with. This causes the game to not even start. Before this i had used events to set all the dictionary key initial values so it was instant causing no problem. But now what would be the most efficient way to deal with this ? Should i add a flag to everywhere where i am using a dictionary key to solve this to wait for the AJAX request to be completed ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for all the replies guys.

    I postponed this feature since it was giving me a headache and moved on to another and other sections of the game. I will check it out and reply once i get back to this to work on it and test it again.

  • Here is the new rendering with it, full size here : https://imgur.com/a/S7GzN

  • Thanks a lot fisholith. The issue is solved now.

  • Here is the goal and the issue reconstructed as an example file. It is working in here but not in game. Here are the screenshots for the both.

    In the working example,

    The goal here is to stretch the sprite upto the text. Here is the .capx file for it.

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

    Here is the original section which is not working an having the problem i mentioned before. Here, i am trying to extend the collider upto the text.

    Here is the full size image of the above. The one above gets cut off a bit.

    https://imgur.com/cCshU97

  • When i rotate a sprite a bit to a different angle it appears like this. Even in the editor. How to fix this ?

    Here is the .capx file,

    https://drive.google.com/open?id=1f8I-rOgzNQqEBrxupLvZ0obozsyGjSRU

  • Hello.

    By typing ObjectA.width = ObjectA.width + ObjectB.width you're giving Object A the width of Object A and Object B together.

    Why don't you just give object B width the width of Object B?

    ObjectA.width = ObjectB.width

    Let's say you want it to change whenever Object B width is being changed, you can do}

    Every tick --> set width ( of object B)--> ObjectA.width

    Did I get you right?

    It is supposed to be the sum of their width itself.

    If width of object A = 100 and object B = 50 then object A should become 150. If object B's width changes then object A's width also need to change with respect to that.

  • For Example,

    ObjectA.width = ObjectA.width + ObjectB.width

    Here, the object A should just have the size of object B dynamically updated to it. But object A keeps getting bigger infinitely.

  • I need to use the same function with a sprite object in it to loop and work on any sprite that is send to it.

    As an example,

    When layout is loaded, Function : Call "GenerateEnemy" ("RedEnemySprite", 100, 12)

    Function : On "GenerateEnemy",

    • Set RedEnemySprite instance variable Hitpoints to 100.
    • Set RedEnemySprite instance variable Attack to 12.
    • Create RedEnemySprite at SpawnLocationSprite position.

    Like in this example, anything like RedEnemySprite, KnightEnemySprite, MonsterEnemySprite or GhostEnemySprite need to be send to the same function so that instead of RedEnemySprite, it will do that. Otherwise there is the need to create the same three events for each enemy like this.

    So is it possible to send a sprite through a parameter or variable so that different ones can be passed through it and to act on it ?

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