I have not saved this as a library. I suppose you could call it a work in progress.
For the map that I submitted to the contest, I had created a trigger that would create patrols for me, which I had originally intended to work into other parts of the map. When I was working on another map today, I realized that I wanted this trigger, and then that others might find use for it as well.
What it does:
Spawn a unit that has a veterancy level scaled to the player, as well as optionally changing the number of spawned units based on the level of the player (currently +1 every 2 levels)
What it should do / was planned to do, but does not do:
Originally, I had intended for this to be rolled in to "every time an enemy creates a unit, do this trigger to it" kinda deal, but I never got around to it.
Also, write a trigger that fires when the player gains a level, and award extra exp to certain units.
Also, rewrite the debug patrol into a function that gets passed a unit type. This would actually be relatively easy, but Zerglings made just fine patrols :P
Finally, I wanted to incorporate it into a periodic that would basically slowly populate an area with patrols, wiping out old ones, and replacing them with new ones, to have some variation in unit levels.
What you need to know:
There is an effect which adds XP, which this thing calls. I wound up with too much lag when using it at 1exp that I changed it to 10, since all of my level experience points were in multiples of 10 anyway. There is a library a few posts down for giving XP through triggers that will do an even better job, I only didn't include it because I was on a bit of a purity kick with the map.
Finally, the code:
PatrolsEventsGame-PlayerAnyPlayertypesachatmessagecontaining"patrol",matchingExactlyLocalVariablesZerglingsToSpawn=(10+(StackcountofProtag_VeterancyonProtaganist[1])) <Integer>
empty variable 1 = 0 <Integer>
empty variable 2 = 0 <Integer>
EXPtoGive = 0 <Integer>
Conditions
Actions
General - For each integer empty variable 1 from 1 to ((Experience level of Protaganist[1]) - 1) with increment 1, do (Actions)
Actions
Variable - Set EXPtoGive = (EXPtoGive + (50 * empty variable 1))
Variable - Set EXPtoGive = (EXPtoGive / 10)
General - For each integer empty variable 1 from 1 to Zerglings To Spawn with increment 1, do (Actions)
Actions
Unit - Create 1 Zergling for player 15 at (Random point in Patrol Zone 1 between 5.0 and 50.0 distance from enemy units of player 15 (prefer points within 10.0 of an enemy building)) using default facing (No Options)
AI - Enable script control for (Last created units)
Unit - Order all units in (Last created units) to ( Patrol targeting (Random point in (Region((Position of (Last created unit)), 10.0)))) (Replace Existing Orders)
Unit - Add 1 Protag_Veterancy to (Last created unit) from Protaganist[1]
Unit - Add 1 Strength to (Last created unit) from Protaganist[1]
Unit - Add 1 Agility to (Last created unit) from Protaganist[1]
Unit - Add 1 Intellect to (Last created unit) from Protaganist[1]
General - For each integer empty variable 2 from 1 to EXPtoGive with increment 1, do (Actions)
Actions
Environment - Execute Give 10 EXP on (Last created unit) from (Last created unit)
Unit - Set (Last created unit) custom value 7 to (Real((Experience level of (Last created unit))))
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have not saved this as a library. I suppose you could call it a work in progress.
For the map that I submitted to the contest, I had created a trigger that would create patrols for me, which I had originally intended to work into other parts of the map. When I was working on another map today, I realized that I wanted this trigger, and then that others might find use for it as well.
What it does:
Spawn a unit that has a veterancy level scaled to the player, as well as optionally changing the number of spawned units based on the level of the player (currently +1 every 2 levels)
What it should do / was planned to do, but does not do:
Originally, I had intended for this to be rolled in to "every time an enemy creates a unit, do this trigger to it" kinda deal, but I never got around to it.
Also, write a trigger that fires when the player gains a level, and award extra exp to certain units.
Also, rewrite the debug patrol into a function that gets passed a unit type. This would actually be relatively easy, but Zerglings made just fine patrols :P
Finally, I wanted to incorporate it into a periodic that would basically slowly populate an area with patrols, wiping out old ones, and replacing them with new ones, to have some variation in unit levels.
What you need to know:
There is an effect which adds XP, which this thing calls. I wound up with too much lag when using it at 1exp that I changed it to 10, since all of my level experience points were in multiples of 10 anyway. There is a library a few posts down for giving XP through triggers that will do an even better job, I only didn't include it because I was on a bit of a purity kick with the map.
Finally, the code: