Define unit cost and enforce them
Open Parent unit class:
Add integer variable
Open Unit style 1
Detail, resource amount to 150:
unit style 2, 200
Resource truck, 100
Go to player controller
In produce unit command, add follow (branch for false statement):
Create Resource not enough message
Go to MainUI Widget, add follow text, set variable, opacity 0:
in event graph:
Start by make custom event: Show not enough resources message:
Back to Player controller (for branch on true statement)
Collapse below into marcos, called Deduct Unit Resource Cost
Open the marcos, change follow input and output:
Setup (ToolTip) to show actual unit cost:
In Building Selected widget, add a horizontal box and rename it, set as variable:
Create a new interface, called RTS_Tooltips_Interface
add funciton:
Open Parent Building Class, add the interface
In event graph, start follow graph:
Create a new widget, called Unit1_ToolTip
Wrapping to 300 for double line texting
Border created by R click on horizontal box, wrap with border, then change its brush alpha and color
Duplicate the Unit1_ToolTip widget, for unit 2 and Truck
Associate tooltips made to production buttons:
Open Produce Unit1 Widget, event graph, create follow highlight nodes:
Duplicate the nodes above and put in Produce unit2, and produce truck widget