Unconnected's Recent Forum Activity

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Thank you for the Drag and Drop, that is very helpful.

    I am not understanding your explanation of Constant and Static. When are they reset? When I use a Static I never notice it changing unless an event or action made it. I've never seen a Static change by itself unless it was told to change.

    What is the difference in using a Static and not changing it with Events or Actions VS using a Constant and not being able to changing it with Events or Actions? I mean if I don't need it to be changed why would I try to change it?

  • I was curious if it is possible to change a variable type without having to change every event associated with that variable.

    From Local to Global.

    From Global to Local.

    While we are on variables can someone tell me the difference in Static and Constant? I am aware that Constant stays the same and Static can be changed, but I am not understanding why there is a need for that. I have never used a Constant, I only use Static. If I don't make an action/event that changes a Static Variable than why would I need to make it Constant? To me it just seems like Constant and Static does the same thing.

    Also in a variable is 01 the same thing as 1? I assume it ignores any 0s before any real numbers.

  • Everything is working correctly now. If a group is already in existence, it won't create a new group on top of it.

  • Okay that was simple. It was what I was needing. Can't believe I wasted that much time trying to figure it out, and that search results didn't bring up "compare instance variable". I probably typed in the wrong keywords. I guess I didn't realize that, that action could be applied if the variable value was missing. Thanks again.

  • I am still needing to check if an object exists or not. I need to use use it's GroupID because it is already used in other events and it isn't equal to it's IID. IID starts at 0 and GroupID starts at 2 for offset reasons. It isn't always a guarantee the Groups will be created in order as well. If IIDs are in order from left to right as 1, 8, 3, 4, 5, 6, 7, 2, then things will start to get confusing. I suppose this would happen if group 8 and 2 get destroyed and group 8 is recreated first.

    I would rather have an extra variable that gives a needed value than to use IID and still have to make a variable for offset to figure the value, or have to complicate other events with offsets.

    I need to check if GroupID X exists or not. If it exists I have to change a variable to prevent a new group from being made on top of it.

    I know how to check an existing variable on an existing object, I just don't know how to check if an object exists. I would suppose I could try blindly sending a variable change. If the variable changes it exists, if it doesn't it won't change. Either way I will know what to trigger. I am not sure what would happen if you try to change something that doesn't exist though. Perhaps a way of just having it check each existing object type for a given variable's value.

  • I don't think I am trying to redo the IID. I assigned an object to each group so Construct 2 usually only has to check 12 objects every few seconds and not 500+.

    Each group has an ID assigned to it. If group 9 is created and then group 1 is destroyed then group 1 will have higher IIDs wouldn't it? If an IID is destroyed does it's IID get re-issued?

    I can use IID as you said. I would have to apply it to the groups leader and not the group itself. How do I check to see if an IID value exists then? I will admit it is my fault I left that part out, sorry.

Unconnected's avatar

Unconnected

Member since 6 Apr, 2016

Twitter
Unconnected has 1 followers

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies