I'm very new to SC2 mapping so I apologize in advance for any possible ignorance.
I am curious if anyone can put me in the right path to be able to modify unit data dynamically in game.
Things I mean are values like radius, inner radius, unit tint, and just about any other field that are editable when making/modifiying an existing unit in the editor, except modifiable during an actual game. I've looked into Upgrades which allow all of that, except the only issue is is that they are globalonce "researched" they affect all units of that type, rather than just a single one. So naturally I looked into behaviours/attributes but I wasn't able to find any places to modify those fields (they seem mostly concerned with combat related values like damage, health, shield regen, etc.).
The idea behind this is that I'd like to be able to create random variation among similar units, like say some wild zerglings are bigger than others, but also that each variation is accessable at anytime (like each unit would be assigned a factor of 1-10 for radius which would correlate to some value that radius actually can be), especially if there would be a save system.
The idea I had was simply having invisible "abilities" that each had a rank (say 10 "levels" for inner radius) and some trigger down the road would assign a random value to the level of that ability to create the variation (this is a trigger, set ability level I believe). Most importantly, such an implementation would allow for easy reading of saved data to re-construct the saved unit and its particular variation. Of course I couldn't find a way to make such an ability, but perhaps it's just out of my inexperience.
In total:
-a way to modify the values of a unit's data fields in game
-works only on a single instance of the unit (like set property action but includes many more values to set)
-the level of modification is retrievable in some way (for a save/load system)
from what i know you can not do this in the DATA editor, it has to be done with triggers. the only way to save anything from one game to another is in a bank file made by triggers as well.
Unit - Set (Last created unit) scale to (100.0%, 100.0%, 100.0%) of its original size
dont know if you change the Scale of the unit it changes the Radius of the unit as well. if you want it to change for every other unit you can make it to something like this:
Unit - Set (Last created unit) scale to ((Random integer between 0 and 100)%, (Random integer between 0 and 100)%, (Random integer between 0 and 100)%) of its original size
the "0" and "100" can be changed to any number you wish.
You can change any data field you want but if you chane unit stats it will affect all units of that type. Couldn't find out how to do it for a specific unit. For example if you want to change the marine unit's radius you do like this in triggers:
Action - Catalog Field Value Set
Catalog: Preset - Units Entry: Value - Marine Field Path: Value - Field: Radius Then set it to what value you want
Edit: Ok I figured it out. What you want is to give your unit an ability of type Research and make it add different upgrades. But wait, upgrades still affects unit types. If you must have it then you could just dublicate your units many times. Bad idea but I don't think you can do much else
I've fiddled around with set scale but the problem is it retains the original radius, inner radius, and other fields that would make sense for the original size but no longer for the new scale! (a massive zergling can still fit through a tiny opening!!).
That's the problem I ran into with upgrades/researchit gives access to exactly what I need but it affects the entire unit type (for the player) and not just a single unit instance.
All of these units will be heroes but again I'm guessing passive abilities/behaviours just can't affect all those fields. But what if you had an ability like warcraft 3 bloodlust or avatar that does make the unit appear larger (pretty sure though collision size remains the same). Would I need triggers to implement that?
To get a more realistic affect I'll probably need several versions for each unit (small zergling-normal zergling-large zergling).
What I'm confused about though is I'm pretty sure Warcraft 3 allowed editing of all those fields dynamically and in game. Perhaps there is a more powerful version of the sc2 map editor out?
Any visual-only effects can be achieved using actors. Well, except editing the models themselves...
Maybe you could create a dummy unit to fake the larger size, so at least you wouldn't have to make copies of the full unit? I just don't know how to stop the main unit from colliding with the dummy. The Colossus pathing system should work for collisions with enemy units, but not structures, allies and terrain if that is enough. (Sounds like you're making an RPG so it might be enough for enemies. Won't work for player units though because people will abuse the crap out of it)
The problem was that they affect the whole unit type, just like upgrades (right?). He wanted to change stats for specific units, like you can do with movement speed and health etc with the set unit property action. But unit radius for example doesnt show here.
If a behavior/effect can be used to alter the size of a unit, then you could randomly target units in an area and put random buffs on them, right? Make a set of buffs or something that each gives a different size, set them to hidden.
But I'm a newb too so I don't know if that's possible. But if it is, that could be one way of doing it. But you'd still have to figure out what is going to be casting that buff on them. And how to make sure you don't go casting it multiple times on the same zergling.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi everyone,
I'm very new to SC2 mapping so I apologize in advance for any possible ignorance.
I am curious if anyone can put me in the right path to be able to modify unit data dynamically in game.
Things I mean are values like radius, inner radius, unit tint, and just about any other field that are editable when making/modifiying an existing unit in the editor, except modifiable during an actual game. I've looked into Upgrades which allow all of that, except the only issue is is that they are global
once "researched" they affect all units of that type, rather than just a single one. So naturally I looked into behaviours/attributes but I wasn't able to find any places to modify those fields (they seem mostly concerned with combat related values like damage, health, shield regen, etc.).The idea behind this is that I'd like to be able to create random variation among similar units, like say some wild zerglings are bigger than others, but also that each variation is accessable at anytime (like each unit would be assigned a factor of 1-10 for radius which would correlate to some value that radius actually can be), especially if there would be a save system.
The idea I had was simply having invisible "abilities" that each had a rank (say 10 "levels" for inner radius) and some trigger down the road would assign a random value to the level of that ability to create the variation (this is a trigger, set ability level I believe). Most importantly, such an implementation would allow for easy reading of saved data to re-construct the saved unit and its particular variation. Of course I couldn't find a way to make such an ability, but perhaps it's just out of my inexperience.
In total: -a way to modify the values of a unit's data fields in game -works only on a single instance of the unit (like set property action but includes many more values to set) -the level of modification is retrievable in some way (for a save/load system)
I would appreciate any help, thanks!
@sethmachine:
from what i know you can not do this in the DATA editor, it has to be done with triggers. the only way to save anything from one game to another is in a bank file made by triggers as well.
Unit - Set (Last created unit) scale to (100.0%, 100.0%, 100.0%) of its original size
dont know if you change the Scale of the unit it changes the Radius of the unit as well. if you want it to change for every other unit you can make it to something like this:
Unit - Set (Last created unit) scale to ((Random integer between 0 and 100)%, (Random integer between 0 and 100)%, (Random integer between 0 and 100)%) of its original size
the "0" and "100" can be changed to any number you wish.
@sethmachine: Go
You can change any data field you want but if you chane unit stats it will affect all units of that type. Couldn't find out how to do it for a specific unit. For example if you want to change the marine unit's radius you do like this in triggers:
Action - Catalog Field Value Set
Catalog: Preset - Units
Entry: Value - Marine
Field Path: Value - Field: Radius
Then set it to what value you want
Edit: Ok I figured it out. What you want is to give your unit an ability of type Research and make it add different upgrades. But wait, upgrades still affects unit types. If you must have it then you could just dublicate your units many times. Bad idea but I don't think you can do much else
I've fiddled around with set scale but the problem is it retains the original radius, inner radius, and other fields that would make sense for the original size but no longer for the new scale! (a massive zergling can still fit through a tiny opening!!).
That's the problem I ran into with upgrades/research
it gives access to exactly what I need but it affects the entire unit type (for the player) and not just a single unit instance.All of these units will be heroes but again I'm guessing passive abilities/behaviours just can't affect all those fields. But what if you had an ability like warcraft 3 bloodlust or avatar that does make the unit appear larger (pretty sure though collision size remains the same). Would I need triggers to implement that?
To get a more realistic affect I'll probably need several versions for each unit (small zergling-normal zergling-large zergling).
What I'm confused about though is I'm pretty sure Warcraft 3 allowed editing of all those fields dynamically and in game. Perhaps there is a more powerful version of the sc2 map editor out?
Any visual-only effects can be achieved using actors. Well, except editing the models themselves...
Maybe you could create a dummy unit to fake the larger size, so at least you wouldn't have to make copies of the full unit? I just don't know how to stop the main unit from colliding with the dummy. The Colossus pathing system should work for collisions with enemy units, but not structures, allies and terrain if that is enough. (Sounds like you're making an RPG so it might be enough for enemies. Won't work for player units though because people will abuse the crap out of it)
@Photoloss: Go
Cough Model Swap event action?
@sethmachine: Go
Catalog triggers are still your best option to avoid an infinite number of upgrades that reverse the effects of each other.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go
The problem was that they affect the whole unit type, just like upgrades (right?). He wanted to change stats for specific units, like you can do with movement speed and health etc with the set unit property action. But unit radius for example doesnt show here.
Well then you are limited to what fields a Buff behaviour can modify or using a Morph ability to change it into a different unit.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
If a behavior/effect can be used to alter the size of a unit, then you could randomly target units in an area and put random buffs on them, right? Make a set of buffs or something that each gives a different size, set them to hidden.
But I'm a newb too so I don't know if that's possible. But if it is, that could be one way of doing it. But you'd still have to figure out what is going to be casting that buff on them. And how to make sure you don't go casting it multiple times on the same zergling.