• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

GUI Mining and Lumber system for heroes.

Status
Not open for further replies.
I decided to redo my lumber and mining system for my map and I'm looking for some experise from anyone who has already did this effectively before.

Basically I only want players who have purchased a pickaxe to be able to mine rocks, and players who have purchased a hatchet to be able to cut down trees.
I have ranged heroes too that I want to only be able to attack rocks and trees at a very short range.
Any ideas?

This is for a map similar to LOAP so it doesn't really have to be super complex, and also I will be constructing the system.
All I am really looking for is some suggestions for the best way.
What I am NOT looking for is comments about the nature of GUI. Do us all a favor and KEEP IT TO YOURSELF! Thanks in advance.
Also anything helpful will result in +REP. =]
 
Make the rocks/trees units and make a damage detection system. Once a unit of type rock/tree gets damage, if the damage source owns a pickaxe ((Damage source) has an item of type Pickaxe) Equal to True), then save +1 to the damage source via a hashtable
  • Set Gold = (Load (Key(gold)) of (Key(Damage source)) from Hashtable
  • Hashtable - Save (Gold + 1) as (Key(gold)) of (Key(Damage source)) in Hashtable
Make the trees/rocks targeted (Combat - Targeted as) as "Ancient" and add to your units the "Ancient" in the Stats - Targets Allowed, so that not every unit can target your trees/rocks.
 
Status
Not open for further replies.
Top