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

Removing Unit Tooltips?

Status
Not open for further replies.
Level 11
Joined
Jun 15, 2011
Messages
447
By using a trigger, you can do that... Like this:

First, set the food cost of your unit to 0, in this way, the food cost value and the icon will disappear (of course)

Second, make a trigger:
Events - A unit sells a unit / Begins training a unit / Finishes training a unit (choose one)
Conditions - (none)
Actions - If unit type of sold unit / trained unit (choose one) equal to (Unit) then do set food used of owner of sold / trained unit to arithmetic food used of owner of (Unit) +1

(Then make another trigger, that when a unit dies, reduce the food used...)

That's just an example, you can also use dummy unit,
so that when you buy an item (fake unit), you order an invisible/hidden building to train a certain unit and move that last created unit to the position of the selling unit...
 
Level 10
Joined
Apr 22, 2010
Messages
422
Slight problem to your method karassu,
There needs to be an Action that cancels the train order IF i dont have enough food, or else i can just go over my food cap. Unfortunantly, I cant seems to find a trigger that can do that. :l

Anyone know what the trigger is? Or do I have to use custom script?
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
yes, you need to use Custom Script, it's not possible in GUI since you cannot response to the unit that is in training progress.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins training a unit
    • Conditions
    • Actions
      • Custom script: set udg_u = GetTrainedUnitType()
      • Set tempPoint = (Position of (Triggering unit))
      • Unit - Create 1 u for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
      • Game - Display to (All players) the text: (Name of (Last created unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Last created unit)) Equal to (Your Unit)
          • (((Owner of (Triggering unit)) Food used) + (Your Unit's Food Requirements) Less than or equal to ((Owner of (Triggering unit)) Food cap)
        • Then - Actions
          • Player - Add (Your Unit's Food Requirements) to (Owner of (Triggering unit)) Food used
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Training Begins
        • Else - Actions
          • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851976)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Build more farm to ...
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation (udg_tempPoint)
you need 2 variables there :
1. Unit-Type Variable (i named it "u" there).
2. Point Variable (i named it "tempPoint", for leaks cleaning.).

EDIT : hold on! i need to find a way to cancel the training, give me some time.
EDIT 2 : Fixed!
EDIT 3 : i re-look at your thread, and just found out that you set the food value to 0 for all unit, so my trigger need to be re-work. give me some time.
EDIT 4 : Done!
 

Attachments

  • Training Unit.w3x
    17.7 KB · Views: 33
Last edited:
Status
Not open for further replies.
Top