• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Help making a trade route mechanic

Status
Not open for further replies.

Stefann

S

Stefann

Hello,

I'm working on a map and amongst other things I want to make trade routs in the sense that there is a merchant that patrols the map and when he passes nearby a player's market building that particular player earns gold.

I've been trying to make this happen with a response event to "notices a target in range", but I can't find the event response condition for that, just "targeted unit" and "acquired target".

Am I missing something? Is there an easier way I can make this mechanic happen?

thanks!

Stefan G.
 
Managed in the end, here's how
 
yeah, I adjusted it, but overall it works for me. I hope it's of some use for others as well. The Merchant unit patrols the map and is invulnerable. The point is in placing markets along the trade route.
 
Good idea. Quick suggestion on how I might do that? Because I can only think of remaking the trigger for each player and the disabling it for a certain amount of time after the gold is given
 
Sounds great, will do that. What event, event response and action should I use?
 
You add a condition to your enter range of merchant trigger that tests that the triggering unit's owner's (array index from player id) timer has expired (remaining time 0). In the actions you start the triggering unit's owner's timer for some timeout period (maximum income rate).

You create another trigger for all the timers expiring. You resolve which player's timer expired by performing a linear search though the timer array. In the actions you search all nearby units (make sure to deal with any group leaks) and look for markets owned by the timer owner. If at least 1 is found you add more gold to the timer owner and restart the timer again.
 
Status
Not open for further replies.
Back
Top