How do you make the overlapping at offset action set values?

0 favourites
  • 6 posts
From the Asset Store
11 loops of RPG, chiptune/8-bit music. Suitable for any pixel art game.
  • I have made a sprite before that could switch values depending on what sprite it was overlapping at offset. The values was switching from left and rigth. And it worked well for that sprite. But now i tried making another sprite have this behavior. I have set up the variables and events in the exact same way and yet the Sprite does not show any reaction by overlapping the sprites. It is supposed to be to move in different way but it never starts moving. Then i tried using the clone object type option one the sprite that could have the behavior sucessfully. It makes the other sprite have the exact same properties. So i made the same events for that sprite and it still does not work event though it is identical to the first sprite. The thing i am aiming for is that the second sprite is going to get different values depending on which side the player is of it and it should only be able to set those values when the player is a certain distance away. I tried is whitin angle but that does not work either. So i would like to get help whit another solution to reach what i am aiming for.

  • A capx would help, it is hard to visualize your situation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A capx would help, it is hard to visualize your situation.

    I will share teh capx if my second explonation isn't enough. I want the enemy to react differently depending on which side the player is from it and how far away the player is from it. The enemy is supposed to begin moving when the player is pretty close to it. Using Line of sigth as a trigger for that doesn't seem to work. Having two sprites always being on one side and distance from the player doesn't work. Is there anything else that can make this work that i haven't tried. The goal being that the enemy is going to begin to move when it is a certain distance form the player and react differently depending on which side the player is to it.

  • https://www.dropbox.com/s/ntlcy96kxs75n ... .capx?dl=0

    Here is my capx. When you open the file you will start at Layout 42, where the problem is located. The sprte that has problems is Sprite 1073. Search for the name in Event Sheet 4 and you should be able to find the events related to it. The sprite does not look like it does now, i just changed it's appearance for private purposes. I have already explained what i want the sprite to do so i hope you can fix the problem yourself or find a way i can fix it. My project takes up alot of memory, now you know that and don't have to comment on that.

  • Sorry I was unable to determine exactly what is wrong in your particular project as it was heavy for me to figure out, but I think I have an idea what you are looking for...

    I've made a small example that will pick an object when is within a certain range of another, with sub events that differentiate which side it is on.

    You can add trigger once while true if you want the event to run just one time when the two objects come in range.

    https://www.dropbox.com/s/eb23u6823hs9b ... .capx?dl=0

    Hope this helps!

  • You don't seem to know how overlapping at offset actually works, so, I'll tell, since you wanted to know.

    Offsets correspond to cardinal directions, as X is left and right, and Y is up and down. Negative Y=An object's bottomside, positive Y=object's top (i.e, say Red from Pokemon Red/Blue, that would be his topmost pixels on his hat), positive X=object's right, negative X=object's left.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)