Your biggest issue here, is the “Watchtower distance to Watchtower”. the game is detecting if the watch tower is a certain distance to itself. It would work better if you detect if the towers are colliding instead of detecting distance.
Imagine this crazy idea
instead of checking if tower is in some distance to tower which is checking itself against itself
How about creating some custom object that would only be like exact shape of your range you want to check
When you pick tower or care to place new one
Now you do not check distance from tower to tower but you check if tower is in collision with that custom object
Of course you need to delete original tower and either place fake image of it on image of your custom object
Or better yet change opacity of picked tower to 254
And you check if tower opacity is 255 and tower is in collision with custom object
This way you can have new or picked tower centered on your cursor and your custom object at the same time while not affecting each other
And now if tower is in collision with custom object
You do not allow to palce new/picked tower
And that is pretty much it
Exactly
You do not need that custom object all the time
But only when you are moving one single tower
So you create it when you are moving tower which you either picked or care to place new one
The one that is centered on your cursor you change opacity to 254 heck even to 100 so it looks like is still not there
And now when placing tower while custom object is not in collision with other tower
You delete custom object and
You change your picked tower opacity back to 255
Open it
Click middle mouse button until you see build mode in upper left
now you can place bricks with LMB and remove them with RMB
Actually you can use mouse scroll up/down to change building item
BUT trick is you cannot place new item on existing item
And that is because i have this
I could add another event here where if builder is in collision with items i would tint it to red
Then to 1st event you see here i would need to just add action to tint builder to white
And builder is that cursor you have in build mode
So i am doing here exactly what i told you to do
You could have that custom object always centered on cursor and change its opacity depending on are you moving tower or not
Where you would still need to manipulate opacity of moving tower
Yet you could simply create / delete this custom cursor depending on are you gonna to move/place tower or not
My best tip is go step by step
One thing at time do not try to build whole system at once
Where is your origin point. I’m guessing at the base of the tower. If so, then the lower tower isn’t inside either circle. The distance condition is only checking 1 point.
Edit: the points are probably not at the bottom but my logic is still valid.
The objects might be close based on the X value but distance is calculated from the X, Y to X, Y
I agree, a hitbox would be a good solution. You only need to check the object being placed and only when it is being placed. Which would be more efficient.
I understand the circle is visual but if it’s accurate then the point that is used for distance looks like it might be in the area just outside of reach from each object.
I made the hitbox, and I did try to make the text show up when the red hitbox is in collision with the watch Tower, but there’s still the exact same issue…
I will edit this as a reply, since I’m a new user, I cannot make more than 10 replies
.
.
.
Everything works perfectly, thank you so much for everyone’s help
Final result:
You have collision check in top event and inverted collision check
MAYBE instead of in bottom event having inverted collision check
You make it normal and add there NOT statement
Add condition type NOT in search bar then add it
Shove under it collision check and see does it work now
Opacity check can be above or below NOT statement but can’t be inside of it
The second event overrides the first one until all watchtowers are close together. Get rid of the second event, and just hide May_not_place in an unconditional event before the event that checks the watchtower distance.
I’m not sure if comparing watchtowers compares a watchtower with itself. But use @ZeroX4’s suggestion of having a placing object before you set down the watchtower. It’ll avoid many potential issues.