• 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.

number of peon for gold

Status
Not open for further replies.
Level 2
Joined
Jun 11, 2023
Messages
9
in patch 1.26, can I show the number of peons for gold?
Безянный.png

as indicated in the screenshot
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Here's an example of creating Floating Text (see my posts):
All of the Floating Text actions are under the Floating Text category so it shouldn't be too hard to figure out.

Then you use a Floating Text array variable and an Integer array variable to link the Floating Text to the gold mine and the Worker count to the gold mine.

The linking can be done using the Unit Indexing method or something like it. (Link in my signature)

Then you detect when a Worker right clicks the Gold Mine using an Order Event and in response increase the gold mine's Integer by 1.

Then if that Worker changes Orders you decrease the Integer by 1. Each time you adjust this Integer you also change the Floating Text.

The Increase trigger would look something like this (assuming you have a Unit Indexer):
  • Events
    • Unit - A unit is issued an order targeting an object
  • Conditions
    • ((Ordered unit) is A peon-type unit) Equal to True
    • (Issued order) Equal to (Order(smart))
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Target unit of issued order)) Equal to Gold Mine
        • (Unit-type of (Target unit of issued order)) Equal to Haunted Gold Mine
        • (Unit-type of (Target unit of issued order)) Equal to Entangled Gold Mine
  • Actions
    • Set GoldMine = (Target unit of issued order)
    • Set GCV = (Custom value of GoldMine)
    • Set WorkerCount[GCV] = WorkerCount[GCV] + 1
    • Floating Text - Change text of GoldMineText[GCV] to (String(WorkerCount[GCV])) using font size 10.00
You can figure out the names of orders using this trigger:
  • Display Orders On Screen
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (String((Issued order)))
 
Last edited:
Status
Not open for further replies.
Top