It all depends on the conditions of the task. Maybe this one will work: link to Google Disk
Trigger "Recalculation" Local variables: - player number: "_player" - amount of minerals: "_summMineralsCost" - amount of vespene: "_summVespeneCost"
Action:
From a certain area, all the units that are needed are taken and recalculated.
Mineral and gas costs are taken from each unit and added to local variables: "_summMineralsCost" and "_summVespeneCost". So we find out the total cost of units for minerals and for gas.
Further, its new cost is recorded in the Catalog for a specific unit.
Functions: - Total cost: "Calculation_Of_AllCost" Returns the sum of the cost of a unit by minerals and vespene.
- Mineral cost: "Calculation_Of_MineralsCost" Returns the cost of a unit by minerals.
- Vespene cost: "Calculation_Of_VespeneCost" Returns the cost of a unit by vespene.
You can return both the current cost (now it's in the function) of a unit OR the cost from the Catalog (see where we recorded the cost of a unit in the trigger). Also, you will have to make exceptions (If-Then-Else) in functions, as some units have "non-standard" cost, for example: archon, zerg unit morph.
In a normal game, you can train units. And in the editor, you know you can do that with an ability of type "Train". This ability can have up to 30 fields.
Ok. Now, imagine you set the same unit for 10fields.
I give you the idea : Show / Hide the command button with help of "Prerequisite".
A) Create the ability "Train". Then insert data info. Use tech. costs (Ex : 5 / 10 / 15 / 30 / 50 minerals) and remove costs for the unit in "Unit" tab (else it will add costs) ! We will come back here later. Hint : Use raw data to copy / paste fields.
B) Create 10dummy buttons to know which command is which. Duplicate the one you want and use numerical suffix, for instance.
C) Create 10 "Prerequisite" with "Show +" value as follow :
D) Modify A) and set buttons and prerequisites to respective rows.
E) Add the ability to your building (or unit) which will train the unit.
F) Add all buttons to the command card of the building (or unit) which will train the unit. You may stack all buttons (1 to 10) of the ability.
G) (OPTIONAL) Don't forget to add an ability "Queue" (Ex : Queue (5) ) to the building, allowing the player to cancel the training. Of course, you need to add the button to the command card.
How can I increase the unit cost according to the number of units on the field
It all depends on the conditions of the task.
Maybe this one will work: link to Google Disk
Trigger "Recalculation"
Local variables:
- player number: "_player"
- amount of minerals: "_summMineralsCost"
- amount of vespene: "_summVespeneCost"
Action:
From a certain area, all the units that are needed are taken and recalculated.
Mineral and gas costs are taken from each unit and added to local variables: "_summMineralsCost" and "_summVespeneCost".
So we find out the total cost of units for minerals and for gas.
Further, its new cost is recorded in the Catalog for a specific unit.
Functions:
- Total cost: "Calculation_Of_AllCost"
Returns the sum of the cost of a unit by minerals and vespene.
- Mineral cost: "Calculation_Of_MineralsCost"
Returns the cost of a unit by minerals.
- Vespene cost: "Calculation_Of_VespeneCost"
Returns the cost of a unit by vespene.
You can return both the current cost (now it's in the function) of a unit OR the cost from the Catalog (see where we recorded the cost of a unit in the trigger).
Also, you will have to make exceptions (If-Then-Else) in functions, as some units have "non-standard" cost, for example: archon, zerg unit morph.
Hello,
This a "Data Editor" question.
In a normal game, you can train units. And in the editor, you know you can do that with an ability of type "Train". This ability can have up to 30 fields.
Ok. Now, imagine you set the same unit for 10 fields.
I give you the idea : Show / Hide the command button with help of "Prerequisite".
A) Create the ability "Train". Then insert data info. Use tech. costs (Ex : 5 / 10 / 15 / 30 / 50 minerals) and remove costs for the unit in "Unit" tab (else it will add costs) ! We will come back here later. Hint : Use raw data to copy / paste fields.
B) Create 10 dummy buttons to know which command is which. Duplicate the one you want and use numerical suffix, for instance.
C) Create 10 "Prerequisite" with "Show +" value as follow :
> 1st prerequisite : CountUnit(Marine,QueuedOrBetter) <= 0
> 2nd to 9th prerequisite : CountUnit(Marine,QueuedOrBetter) == # (with # is respectively 1 to 8)
> 10th prerequisite : CountUnit(Marine,QueuedOrBetter) >= 9
D) Modify A) and set buttons and prerequisites to respective rows.
E) Add the ability to your building (or unit) which will train the unit.
F) Add all buttons to the command card of the building (or unit) which will train the unit. You may stack all buttons (1 to 10) of the ability.
G) (OPTIONAL) Don't forget to add an ability "Queue" (Ex : Queue (5) ) to the building, allowing the player to cancel the training. Of course, you need to add the button to the command card.
Aaaaaaaaaaand you're done.
Have a nice day !