Unconnected's Forum Posts

  • I don't fully understand

    "You did't change that '0.3' each tick, and therefor you got one value in return."

    I tried litetween before I posted this post. 'Time Scale' seemed to be interfering with it. I couldn't find anything in the manual or post about 'Time Scale' or "Delta Time'. I got it to work correctly but there was a delay in the 'Time Scale' variable change and I can't have that. The change has to happen instantly.

    I understand how lerp works mathematically. It is actually very simple. It takes two values and finds the difference using a 0>1 number as a percent. 0.5 will take 50% off of the remaining difference until it can't any more. 100, 50, 25, 12.5 , 6.25, 3.125....etc

    lerp(50, 800, 0.3) is only returning one value no matter where I put it.

    The only logical thought I came up with is it is running lerp correctly but since it isn't getting a reference to the object itself it is always returning the same value.

    I had it under a variable = 1 condition with and without 'Every Tick'

    I had it by itself with no Condition with and without an 'Every Tick'

    I am using 'Set Size' where it sets width and height at the same time.

    I even tried doing 'Set Width' and 'Set Height' individually and it is only returning one value.

    It just isn't working, it always returns one value.

    I understand lerp(Object.Width, 800, 0.3) never reaches it's target.

    It is why I put in a condition to fix it.

    I've spent way to much time trying to make it work.

    What I did made it work and it looks correctly when adjusting it's size and position.

    I had to do this with "Set Position" as well.

    I will gladly fix what I have if I can find an example Capx or if someone can point out why lerp(50, 800, 0.3) isn't working.

    I can't find an example of someone not placing the first lerp value of something related to the object. The first lerp value is always object.X or object.Y in all of the examples I have found. I also can't find an example of someone using lerp to change the size of an object. I can only assume it is similar to moving an object with lerp.

  • I found my error...

    On lerp I had:

    lerp(50, 800, 0.3)

    I changed it to:

    lerp(Object.Width, 800, 0.3)

    I think it was interfering with itself, I should have noticed that rather quickly... opps.

  • That is what I have been trying to do. For some reason I am having trouble with it. Instead of going to it's expanded size it treats the third number as a % (as it should) but it only moves once. As in if I have it at 0.5(or 0.1) it instantly makes the object 50%(or 10%) of the size it is supposed to be and it stops expanding. I thought maybe Time Scale was effecting it because I have Time Scale set to 0 when this is happening. I disabled the trigger to set Time Scale to 0. When Time Scale is 1 it still does the same.

    I am sure it is the way I structured the events. I am needing an example of a box sprite expanding in size when clicked and contracting back when clicked again, or the conditions that should be used. I wanted it to be a function so it skips unneeded events unless clicked. I thought that may be the reason so I tried otherwise and it acts the same. It needs to be unaffected by Delta Time.

    Thank you.

  • I will probably have to use width and height and adjust the box's position when it is scaling down. I wish there was an easier way though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No. I know of that, the box isn't gonna be in the middle of the screen. It would look correct when it expands out but when it contracts it won't look correct. There would be a lag on the side that is closest to the edge of the Layout.

  • I have a small 50 x 50 box (Scaled down) and when it is tapped it's position should stay the same and it should adjust in size to fit the Viewport, or seemingly do so. When the player is done the box should adjust back to it's original size and position. I only know how to move boxes and adjust width equally on both sided as well as height. I am unaware of how to adjust each side of the square according to it's potion within the Viewport. I was going to use Lerp for this, but I just don't know what to use for the box's edge or points. I am aware of Viewport Top, Left, Right, Bottom.

    The box is just a solid color.

  • I am wanting to make a time based upgrade system for a game. I would like to know how, or be pointed into the right direction on how to make a timer that will seemingly count even if game is closed and can tell if device time has been changed.

    I know you can do this by comparing the device time during game play and at start of game play and change accordingly, but not sure how to accomplish this.

    Example: An hour timer is started. Player leaves game and does whatever with device. Player comes back in 55 minutes and timer has 5 minutes left. How do I achieve this and how do I detect if someone changed device time and/or daylight savings time clock change took place?

  • Okay thank you for your time and the plugin. Both were very useful.

  • Thanks I will use this, it seems better anyway.

    I still need to know how to call XDK Plugins for later when/if I come across this again.

  • In Intel XDK I added the Insomnia plugin to prevent the screen from sleeping during game play. In the instructions it says:

    "The device will never fall asleep after calling keepAwake."

    ".....you can allow it to sleep again by calling allowSleepAgain."

    My question is how do I call keepAwake and allowSleepAgain?

    To me it seems like it will have to be an event in Construct 2. Otherwise the plugin won't know when to keep awake or to allow sleep. I plan on adding a counter that will reset every time the screen is touched. If the counter gets to a certain number it will be allowed to sleep.

    I am wanting to know how do I use Handles for plugins, or I need to be pointed into the proper direction if I am going about it wrong.

    I am also wanting to know if Caps matter when calling the plugin's handles.

    As in will using KeepAwake instead of keepAwake make the plugin not work, or will depend on the plugin?

  • So what condition do I use then? Setting the Family Variable and Sort Z Order are both actions.

    The condition I have organizes by ascending Y. I don't need that as a condition if Sort Z Order using the YVariable will be an action. Do I just leave it blank?

  • I have a Function called Sort, it goes like this

    For each Object order by Object,Y ascending.

    Object Move to top of layer

    The above way is working the way it should. If I change 'Object' to a 'ZOrderFamily' it stops working correctly. I only have two different objects in the 'ZOrderFamily. If I remove the second object and only have the original 'Object' in the family it still doesn't work correctly. It doesn't Z-Order them correctly.

    For each ZOrderFamily order by ZOrderFamily,Y ascending.

    ZOrderFamily Move to top of layer

    All I did was change the Target Object to a Family and it stops working. I am not sure how else to Z-order using an objects Y than what I have. I can only assume 'For each' may be the problem since I went from an object to a family.

    I need to know what I am doing wrong. Nothing else is effecting the objects Z-Order because there is nothing else I have that can effect it. The only events associated with the objects are the ones used to create them. The 'Sort Function is called a tick after they are created (Wait 0 Seconds). All of the objects are on the same layer. The 2nd object will always be created between a few of the original objects, so they seemingly need to be Z-ordered together.

    Can someone please tell me what condition/expression to use or another way to do this so it works.

    Thank you for your time. I may have a slow reply, but it will be appreciated.

  • I realized this and was trying to remove the post. Windows updates started without asking and slowed my internet down so much I couldn't do anything... Thank you for your reply.

  • I am wanting to have a menu that displays an image of game objects that can be found during game play.

    An example would be a building that can be upgraded so it will have different frames. During game play the building will have reactions to other objects. I am wanting to add the image of the building on a menu. It needs to show the same frame as the game play building, but not have it adopt it's events and triggers associated with it.

    Is there a way I can just grab a frame of an object and have it displayed in a 2nd location, so it doesn't have events or triggers associated with it? Is it possible to make a 2nd object and use the first objects animation frames, but it will still be it's own object and won't adopt "on created" events etc. Or do I have to make a 2nd duplicate object with the same Animations? I am not wanting to waste ticks that are not needed on the 2nd building image if possible.

    This brings up another question. If I do an overlay on a layout as a menu, how do I prevent drag and drop items from interacting with what is below the menu overlay?

  • I know the difference between Global, Local, Static and Constant. I was only asking what the point of a Constant was. I can only assume the reason of setting a variable as Constant would be so Construct 2 will prevent the user from changing it with events/actions. I usually just set every variable as a Static and add a description to it.