InDWrekt's Forum Posts

  • From your original question, I thought you meant you just wanted to replace a single image with another one. This new question looks more like you want to be able to swap images on the fly in game.

    You should look into Spriters Character Maps feature. Using this, you can define a single animation but using the character map, change any image of the animation. You would have both your sword and dagger items in the single Spriter project and can swap between them using the character map.

  • I have checked on this question a couple times over the past couple days. I would love to be able to help you solve this but unfortunately, without access to your project, I don't think you'll be getting an answer. Can you post your project so I can take a look at what is going on and try to help you solve it?

  • I use Spriter with Construct quite a bit. If the image you are adding is exactly the same size and the key points in the image are in the same location, you could be fine swapping it in the construct files. Given the state of the Spriter plugin, it would be easier to do it this way. You will have to find ALL the different places the image you are replacing is in the construct file and make sure the new file is named the correctly but it can work.

    If the new image is not exactly the same size with all key points in the same positions, you definitely want to do it in Spriter.

    If you are running the beta version of Construct and have the version of the plugin that is built for the beta, I would say you would be better of doing the change in Spriter. The beta version of the plugin is MUCH easier to load edited versions of the project.

  • Francesco2020 It appears you don't have a Construct 3 paid license. dop2000 suggestion is the best way to do what you are trying to do but is unfortunately a premium feature. The Free version can't use families. To get what you want without families, the easiest thing to do is, make all your sprites for the menu into different animations in a single sprite. Then you only have 1 object to worry about. Then, name the animation the same thing as the building sprite is named and use the system create object by name method passing in the animation name. It is slightly less simple then using a family but still works just as well.

  • Try using the JSON.Path reference in your loops. That should get you the key at the current loop location. It also makes the code more generic meaning it can handle more things than just chopLog. See the picture below. In the events, you can see I do a compare on the value type to see if it is an object. This is where the system would get your preconditions and events.

    Here is the example I built to figure it out.

    drive.google.com/file/d/1po9DyAyt7RhQ4upD-_h6JNZYdHLCfmas/view

  • drive.google.com/file/d/1NxkWaP-P3R8DDSKWOT147vJXFNmfMV2Y/view

    This is a small but surprisingly advanced example. It uses the Date plugin to get and format date information and compares the timestamps of the items to see if the due date is passed. I didn't add in time so you will have to figure that out but it is just the same as what is done. In the example, I store the date string. You could instead store the timestamp which would make it harder to find and edit manually but again, I'll leave that up to you to work out.

    Good luck with your project.

  • Thank you for posting your project. calminthenight is correct but here is a little more information. When you set variable1 to 0.06, the system is registering it as 0.060000000000000005.I know that seems strange but is a problem that computers have when storing really small numbers. These 2 values to us are functionally the same but the computer sees it differently. If you change your variables to integers as calminthenight suggests, you won't have this problem. I am unclear why you are using the decimal value in this project in the first place but I would suggest converting to the decimal only where you need it.

  • Try this, in the LAYOUT PROPERTIES window, look for "Unbound Scrolling" and put a check in it. Then run your project. If it does what you want, then your layout is too small vertically for what you are trying to do. For scrollto to scroll to the position you are trying to scroll to, the position needs to be <= the height of the layout - the height of the window. If that doesn't work still, we would need access to your project to find the problem. A screenshot of your events isn't enough information.

    Plus, you can reduce your events/actions for setting the position to a single event.

    + System: Every tick -> System: Set scroll Y to 100000 × Variable1 + 500

    Since you already have an "Every Tick" event, if you put the single scroll action into that event, these 8 events would become 2.

  • You should add all these sprites to a family and give the family the instance variable. Then, you just need to pick all instances of the family.

  • I knew there are some GCSE-level programming basics that I'm missing :D

    Some extra reading helped: bbc.co.uk/bitesize/guides/zs3qrwx/revision/1

    Thanks for the demo! I think I got it.

    Out of curiosity - how does the text attach itself to the targets? Both visually and logically - I see no pins or position definitions.

    You're right, there are no pins or position definitions. I am using a container.

    construct.net/en/make-games/manuals/construct-3/project-primitives/objects/containers

  • An array could work but it would be more clear/readable and thus easier to upkeep if you use instance variables. Here is a small example to get you started:

    drive.google.com/file/d/1eDWdZQR7hY_ocfak7CJT1ndQtzMCCoiw/view

    It will probably take a bit of studying to understand everything going on but it should answer all the questions you've asked.

  • You're welcome. Good luck with your project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So, there was something bothering me about the original example and I couldn't help but mess with it some more. Download the project again. I simplified it. The original example drew the circle in 2 events. 1 split the circle into 8 parts and the other filled the 8 parts again splitting them into 8 parts. I got rid of the second draw event and instead just divided the circle into 100 even parts in the first event. It basically looks the same but reduces some memory use and CPU processing. Plus it's easier to read and upkeep.

    drive.google.com/file/d/12DTzuTArnmAPlzMk6DOdKBqUIbC5Gl92/view

  • Here is a small sample of that chase mechanic built in Construct. The enemy has line of sight and move to behaviors. Tap to move the green character. The red character will chase if it has line of sight. If the red character is within attack range (stored in a range variable on the red character) it will stop moving and start shooting. If the player moves out of range, the red player will go back to chasing. If the red character loses line of sight, it has the ability to try to get it back by moving to the last known location of the player. If it reaches the last known position and still doesn't have line of sight, it stops and waits.

    drive.google.com/file/d/166bydrsqn_XCW5L1q7Z1b_drnzxfeSq0/view

  • You're welcome. Good luck with your project.