I'm creating a map that's centered around holding capture control points scattered around the map, ala Dawn of War. However, I want to make it so that these control points gain "experience" as units from all sides die around them, which causes them to generate more resources.
The way I was thinking about doing this was to give the control point an ability that generated an amount of resources and have this ability have several levels, essentially making the control point act like a hero. I could make the control point a "hero unit," but is there a way to generate resources using the data editor or only through triggers?
Also, how do you make a unit capture-able, but retain it's allegiance if the capturing team moves away?
EDIT: figured out how to generate resources using effects. It's under modify player.
Retaining allegiance should be the default for certain setups, Neural Parasite maintains control as long as the buff exists for instance. If anything reverting ownership to a non-hardcoded previous owner is the hard bit. The Interact ability (which iirc only shares control, not ownership) automatically cancels when you move out of range.
A conceptually easy version of the "corpse harvest" would be to give every unit a buff with a damage response (tick the "Fatal" flag!), which then applies a stacking buff to a nearby capture point. Each stack could then generate resources on its own timer, or you use validators to have fixed "tiers". Buffs stacks are limited to 65536 or so, that's the maximum number of deaths each point could handle without compounding stacks through multiple buff types.
If your map is early in development and doesn't have many different units yet, you can give each of them the damage response buff in the editor, and set its "damage handled" effect to a Search. This would then look for a nearby capture point and apply the buff to it. Buff ownership could be a problem in this case (the dying unit is the "caster", and its owning player also owns the buff), and you'd have to give the buff to every unit you introduce.
The other easy setup is a pulsing aura around the capture point to apply the damage response locally, then apply the stacking buff to "Caster" (i.e. the capture point). I don't know how bad the CPU/network load is between fast-pulsing auras vs. "unit dies" triggers though.
If the amount of additional resources should depend on the unit type you definitely need to hardcode that anyway, in this case definitely use Veterancy levels or the first of my suggestions. Depending on the amount of variation that can eat through your buff stack limit rather quickly though (if a BC death is worth 100 SCV deaths, you're already capped at 655 BC deaths)
I've intended to make it so that enemy units within a certain proximity of the control point will begin converting it to their side, probably taking several seconds to completely do so, while friendly units near the control point block the capture. While I'm certain this is possible, I have a nagging suspicion that it is more the purview of triggers rather than the data editor. Is there any way to do what I'm trying with the data editor or is it time to learn some more complex triggers?
Stacking buffs, always stacking buffs for counting anything in Data. In this case energy on the cap point could also work if it doesn't have any other energy-driven abilities, and would add a nice automatic progress bar.
If counting isn't necessary you can work with abilities or buffs which allow proper progress bars in the UI, but scaling that dynamically would be very hard (timescale etc.)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm creating a map that's centered around holding capture control points scattered around the map, ala Dawn of War. However, I want to make it so that these control points gain "experience" as units from all sides die around them, which causes them to generate more resources.
The way I was thinking about doing this was to give the control point an ability that generated an amount of resources and have this ability have several levels, essentially making the control point act like a hero. I could make the control point a "hero unit," but is there a way to generate resources using the data editor or only through triggers?
Also, how do you make a unit capture-able, but retain it's allegiance if the capturing team moves away?
EDIT: figured out how to generate resources using effects. It's under modify player.
This seems like a perfect and easy job for Regions and triggers to me, but then again I am horrible with the data editor :-P
Retaining allegiance should be the default for certain setups, Neural Parasite maintains control as long as the buff exists for instance. If anything reverting ownership to a non-hardcoded previous owner is the hard bit. The Interact ability (which iirc only shares control, not ownership) automatically cancels when you move out of range.
A conceptually easy version of the "corpse harvest" would be to give every unit a buff with a damage response (tick the "Fatal" flag!), which then applies a stacking buff to a nearby capture point. Each stack could then generate resources on its own timer, or you use validators to have fixed "tiers". Buffs stacks are limited to 65536 or so, that's the maximum number of deaths each point could handle without compounding stacks through multiple buff types.
If your map is early in development and doesn't have many different units yet, you can give each of them the damage response buff in the editor, and set its "damage handled" effect to a Search. This would then look for a nearby capture point and apply the buff to it. Buff ownership could be a problem in this case (the dying unit is the "caster", and its owning player also owns the buff), and you'd have to give the buff to every unit you introduce.
The other easy setup is a pulsing aura around the capture point to apply the damage response locally, then apply the stacking buff to "Caster" (i.e. the capture point). I don't know how bad the CPU/network load is between fast-pulsing auras vs. "unit dies" triggers though.
If the amount of additional resources should depend on the unit type you definitely need to hardcode that anyway, in this case definitely use Veterancy levels or the first of my suggestions. Depending on the amount of variation that can eat through your buff stack limit rather quickly though (if a BC death is worth 100 SCV deaths, you're already capped at 655 BC deaths)
@Photoloss: Go
I've intended to make it so that enemy units within a certain proximity of the control point will begin converting it to their side, probably taking several seconds to completely do so, while friendly units near the control point block the capture. While I'm certain this is possible, I have a nagging suspicion that it is more the purview of triggers rather than the data editor. Is there any way to do what I'm trying with the data editor or is it time to learn some more complex triggers?
@Shurukin: Go
Stacking buffs, always stacking buffs for counting anything in Data. In this case energy on the cap point could also work if it doesn't have any other energy-driven abilities, and would add a nice automatic progress bar.
If counting isn't necessary you can work with abilities or buffs which allow proper progress bars in the UI, but scaling that dynamically would be very hard (timescale etc.)