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

Get help using Construct 2

Post » Fri Feb 19, 2016 12:10 am

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.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Fri Feb 19, 2016 2:33 am

A capx would help, it is hard to visualize your situation.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Fri Feb 26, 2016 2:59 pm

oosyrag wrote: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.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Mar 23, 2016 5:19 am

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.
B
12
S
2
Posts: 267
Reputation: 1,344

Post » Wed Mar 23, 2016 7:56 am

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!
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Wed Mar 23, 2016 10:31 am

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.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
52
S
24
G
30
Posts: 537
Reputation: 19,651


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Seruza and 11 guests