Hello, I hope someone will be able to help me.
I'm making a game with one player controlled unit, and many tiny units that can be issued commands via keyboard + mouse clicks. I have no problem with this so far.
The section that works properly:
Right click, create a "Collection Area" sprite. One random unit that matches the requirements through instance variables (is not busy, is of a valid type, etc) is then issued the command to go to the Collection Area marked by the sprite, and perform his collection duties. He picks up an object, brings it to his destination, drops it off, and then goes back to the collection area, and repeats. This all works great.
The issue I have is, I want to be able to 'cancel' specific Collection Area routes. I have the events based on an "On Creation of Collection Area" Sprite, so when the Sprite is deleted, nothing happens. I can't just have a 'send all' command to all the units, because I need each unit to be directly linked to each Collection Area.
Essentially, I want each Collection Area to be 'linked' to the unit that is carrying out that command. When that specific Collection Area sprite is destroyed/canceled, I want the unit that was working on that to be notified he can go back to his normal duties.
Any ideas?