I've been trying to find out how to make an upgrade available only when a SCV is nearby. I know could use triggers to do it manually, but since I've got 4+ upgrades I want to use it with I'm trying to find a way to use requirements or validators (I can also have a requirement saying "Need a nearby SCV"). I have had little luck trying to figure this out, however. In context, these upgrades equip the SCV with a new weapon and it makes little sense to do it from half way across the map.
I would add a behavior called something along the lines of SCV Nearby and make it a hidden behavior with an Enumerate Area validator that disables the behavior when there is no SCV nearby.
From there, I would add a requirement to each upgrade that checks to see if the behavior is active on the unit under the Use nodes for the requirement.
It worked, thanks. My only issue now is that it takes 4 seconds to research and it doesn't stop should the SCV leave the radius. Any way to get an upgrade to cancel automatically when requirements are no longer met?
Did the 4 second upgrade time arise only after adding the behavior/requirement setup?
As for the auto cancelling, you can have the existing behavior periodically add another short-duration Buff behavior to the upgrading unit which, upon removal, orders the upgrading unit to cancel the upgrade.
The upgrade time was always there; I set it as such. This is pretty much solved; I might also leave the lack of auto-cancel just for the sake of simplicity.
There may be another, if more complicated way to achieve all the effects you are looking for. or if not cancel then pause an upgrade. The Protoss use Power Source and Power User. using customized versions of these two behaviors should get you the result you are looking for. as well the behavior and powered unpowered text can be hidden.
Huh, never thought of that. Sounds like it might be a better alternative, but for now I'm going to leave the system as-is; I'll try it out when I get to polishing.
Saw this thread, had to chime in, since it's quite similar to the problem I was having myself.
I posted about it yesterday but didn't have time to look into finding a solution. Now I'm at work, far away from the galaxy editor. :(
Anyway, what vailreth is talking about is something which I've been wanting to work on. As I am fairly new to the editor, I'm sure that I can find the solution on my own, eventually. Though it would take a lot of time. :P
Basically, what functions do you use in the data editor in order to activate (or deactivate) a behavior depending on a player property.
e.g. in my case, I want my pylons to deactivate the "power source" behavior they haven when I run out of Vespene gas.
In the OP's case, it would be attribute to the SCV the "power source for upgrades" (a modded version of power source) behavior or something. The "power source" behavior is something which can be attached to the SCV with relative ease, the difficulty would be modding that behavior to only affect upgrades.
I've been trying to find out how to make an upgrade available only when a SCV is nearby. I know could use triggers to do it manually, but since I've got 4+ upgrades I want to use it with I'm trying to find a way to use requirements or validators (I can also have a requirement saying "Need a nearby SCV"). I have had little luck trying to figure this out, however. In context, these upgrades equip the SCV with a new weapon and it makes little sense to do it from half way across the map.
I would add a behavior called something along the lines of SCV Nearby and make it a hidden behavior with an Enumerate Area validator that disables the behavior when there is no SCV nearby.
From there, I would add a requirement to each upgrade that checks to see if the behavior is active on the unit under the Use nodes for the requirement.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
@aZergBaneling: Go
It worked, thanks. My only issue now is that it takes 4 seconds to research and it doesn't stop should the SCV leave the radius. Any way to get an upgrade to cancel automatically when requirements are no longer met?
Did the 4 second upgrade time arise only after adding the behavior/requirement setup?
As for the auto cancelling, you can have the existing behavior periodically add another short-duration Buff behavior to the upgrading unit which, upon removal, orders the upgrading unit to cancel the upgrade.
Custom Campaign Initiative | Mapster Community Project: Data Wizards
Starcraft II: Unsung Rebels, a custom campaign for Starcraft II
SC2Saver, a way to create saved games via trigger
Frustrated with the editor and would like answers in real time? Join the SC2Mapster Discord!
The upgrade time was always there; I set it as such. This is pretty much solved; I might also leave the lack of auto-cancel just for the sake of simplicity.
There may be another, if more complicated way to achieve all the effects you are looking for. or if not cancel then pause an upgrade. The Protoss use Power Source and Power User. using customized versions of these two behaviors should get you the result you are looking for. as well the behavior and powered unpowered text can be hidden.
@vailreth: Go
Huh, never thought of that. Sounds like it might be a better alternative, but for now I'm going to leave the system as-is; I'll try it out when I get to polishing.
Saw this thread, had to chime in, since it's quite similar to the problem I was having myself.
I posted about it yesterday but didn't have time to look into finding a solution. Now I'm at work, far away from the galaxy editor. :(
Anyway, what vailreth is talking about is something which I've been wanting to work on. As I am fairly new to the editor, I'm sure that I can find the solution on my own, eventually. Though it would take a lot of time. :P
Basically, what functions do you use in the data editor in order to activate (or deactivate) a behavior depending on a player property.
e.g. in my case, I want my pylons to deactivate the "power source" behavior they haven when I run out of Vespene gas.
In the OP's case, it would be attribute to the SCV the "power source for upgrades" (a modded version of power source) behavior or something. The "power source" behavior is something which can be attached to the SCV with relative ease, the difficulty would be modding that behavior to only affect upgrades.
Though if OP's problem is solved, then np.