Conquering Mechanic

I’m trying to add a part of my game where when you interact with a Village or click the Sprite, it sends you to a scene where you kill enemies, after you do that to updates a Variable which updates the village Sprite showing you conquered it, but it works fine the problem is that it updates all the villages in the area and not the one you interacted with

I really need some help with this

Basically when 10 Drones are killed it shows the Exfil Sprite and when its clicked it updates the VillagesConquered Variable to 1, when its on 1 it then changes the Animation of Village to conquered
but its setting all the villages to conquered instead of the one the player interacts with

Perhaps you could set an object variable for your village object that could allow you to pick out the specific instance that the player is interacting with.
Then when you change the animation, use a “for each” condition.

Like, if player is in a village,
and all enemies are cleared,
repeat for each instance of village
__set village text variable “status” to “cleared”

If village variable “status” is “cleared”
repeat for each instance of village
__change the animation set to “Conquered”

maybe put a trigger once also.

The Village Sprite is in a completely different scene as the Battle scene which is why I used a global variable

I don’t know if this is what you meant but I tried and it did not work

Uhh… okay.
I guess you’ll need to set global variables all your villages then. And a matching id object variable for all the instances as well.

I believe it should go something like this:

Player is in village 1
village 1 is cleared
set global variable “village01” to “cleared”
save game

change scene
if global variable “village01” = “cleared”
repeat for each instance of village
if village variable id=1
__change animation to “conquered”

so I should make a structure global variable

Yeah. Global structure variable would be good. I think what you’re trying to do is similar to a stage or level selection scene. It might be good to look into examples of those.

Oh Okay, Thank you for helping me though

Sure. Good luck on your game!