I'm struggling with figuring out how to implement this. Right now, the map editor restricts me to pinpoint each mineral patch through a value (position value x, y) while the extension mod must be usable for multiple maps. I don't know how to have the triggers to read the entire map and tell me the points of where the mineral patches are and store them. When i reset the map, they should bring up the data from the storage and place them at the default position.
I hope this is enough information for someone to help. Thanks!
Have an integer counter and a global array variable of type point: mineralPositions[MAX_MINERALS]
Then make an action:
"Pick each unit in unit group - 'Mineral Field' units in region - entire map"
For each picked unit:
Set mineralPositions[counter] = position of (Picked Unit);
counter = counter+1;
That will store the positions of all the minerals on the map in the mineralPositions array, which you can later loop through to restore the mineral positions.
Have an integer counter and a global array variable of type point: mineralPositions[MAX_MINERALS]
Then make an action:
"Pick each unit in unit group - 'Mineral Field' units in region - entire map"
For each picked unit:
Set mineralPositions[counter] = position of (Picked Unit);
counter = counter+1;
That will store the positions of all the minerals on the map in the mineralPositions array, which you can later loop through to restore the mineral positions.
Thanks for replying!
I tried that method but it requires an object, in this case, would be a mineral patch but that is not available for me to select in "Unit groups" for the action trigger " Unit Group: Units In Unit Group Within Region".
Hi guys,
I'm struggling with figuring out how to implement this. Right now, the map editor restricts me to pinpoint each mineral patch through a value (position value x, y) while the extension mod must be usable for multiple maps. I don't know how to have the triggers to read the entire map and tell me the points of where the mineral patches are and store them. When i reset the map, they should bring up the data from the storage and place them at the default position.
I hope this is enough information for someone to help. Thanks!
Have an integer counter and a global array variable of type point: mineralPositions[MAX_MINERALS]
Then make an action:
"Pick each unit in unit group - 'Mineral Field' units in region - entire map"
For each picked unit:
Set mineralPositions[counter] = position of (Picked Unit);
counter = counter+1;
That will store the positions of all the minerals on the map in the mineralPositions array, which you can later loop through to restore the mineral positions.
Thanks for replying!
I tried that method but it requires an object, in this case, would be a mineral patch but that is not available for me to select in "Unit groups" for the action trigger " Unit Group: Units In Unit Group Within Region".
Sorry, the one I meant was "Unit Group: Units In Region Matching Condition"
Edit: And then change "Any" to "Mineral Field"
@DeltaV: Go
Would I just change counter = 1. Also could I just reuse counter var. for vespene gas?
@Fhekgor: Go
Yeah, set the counter to 0 before you start the loop (or 1 if you want to start there).
Yup you definitely can reuse it just set it back to its initial value again.
Edit: UNLESS you want to use it to store the total number of minerals and in that case you can't reuse it.
@DeltaV: Go
Could you tell me how to start the loop? I'm not CS programmer.
The "Pick each unit in unit group" is the loop. It loops through all the units in the group.
If you want to know more about basic loops I recommend you checkout some tutorials: http://www.sc2mapster.com/wiki/galaxy/tutorials/
http://wiki.sc2mapster.com/Tutorials
In particular: Basic Triggers
http://us.battle.net/sc2/en/forum/topic/11765436463