Staredit Network > Forums > SC2 Assistance > Topic: Validating Amount of Resources Being Carried
Validating Amount of Resources Being Carried
Nov 18 2011, 2:50 am
By: Superfield  

Nov 18 2011, 2:50 am Superfield Post #1



So here's the deal: Say I've got all of the base SCII settings, save for an ability that allows players to "infect" enemy mineral fields, turning them red and reducing the minerals per trip from 5 to 1. The problem comes when I want the minerals that the workers carry around to also be red, but I can't find a way to validate whether or not the mineral field the fragment was harvested from has a certain behavior. I had the idea to validate the number of minerals a worker is carrying, but I don't know how to do that. I do realize that a mineral field could have just one mineral left and falsely show up as red, but that is not a concern at the moment.

Note: This is not the actual situation I'm faced with. I'd just rather keep specifics about my project a secret.



None.

Dec 9 2011, 5:02 pm Superfield Post #2



Bumping topic; if what I want isn't possible, can you at least tell me so I'm not left hanging?



None.

Dec 10 2011, 4:09 am Roy Post #3

An artist's depiction of an Extended Unit Death

I'm no Data Editor expert, but since nobody else has stepped up, here's what I would do:

If you notice, a rich mineral field is a different color than a regular mineral field, including the returning cargo. The color of the return cargo is somewhat determined by the behavior attached to the mineral field (to quickly test this, you can change a regular mineral field's behavior to be high yield and watch workers return gold cargo from a blue field). Therefore, to make red cargo return, you need to override the mineral behavior for when a mineral field is infected. You don't need to do validation on the cargo itself, as it will be determined once the worker has successfully harvested from the patch.

(Technically, the high yield return is actually an entirely separate model, and since I assume you don't want to make your own model, we'll deviate a little bit from what Blizzard did from here.)

Go to the Data Editor's behaviors and duplicate the mineral field behavior completely (be sure to duplicate the actor and whatnot as well); you can call this "Minerals (Infected)" if you'd like. Now go to the duplicated actor and create a new event for it on "Actor Creation." For the action to take, select "Set Tint Color" and choose the red infection color you want it to be. Now, when you cast the infection ability on a Mineral field, swap out its regular "Minerals" behavior with your "Minerals (Infected)" behavior.

Also, to make the infected patch only return one mineral, change the "Harvest Amount" in the infected behavior to 1.

Post has been edited 1 time(s), last time on Dec 10 2011, 6:19 pm by Roy.




Dec 12 2011, 7:52 pm Superfield Post #4



Quote from Roy
I'm no Data Editor expert, but since nobody else has stepped up, here's what I would do:

If you notice, a rich mineral field is a different color than a regular mineral field, including the returning cargo. The color of the return cargo is somewhat determined by the behavior attached to the mineral field (to quickly test this, you can change a regular mineral field's behavior to be high yield and watch workers return gold cargo from a blue field). Therefore, to make red cargo return, you need to override the mineral behavior for when a mineral field is infected. You don't need to do validation on the cargo itself, as it will be determined once the worker has successfully harvested from the patch.

(Technically, the high yield return is actually an entirely separate model, and since I assume you don't want to make your own model, we'll deviate a little bit from what Blizzard did from here.)

Go to the Data Editor's behaviors and duplicate the mineral field behavior completely (be sure to duplicate the actor and whatnot as well); you can call this "Minerals (Infected)" if you'd like. Now go to the duplicated actor and create a new event for it on "Actor Creation." For the action to take, select "Set Tint Color" and choose the red infection color you want it to be. Now, when you cast the infection ability on a Mineral field, swap out its regular "Minerals" behavior with your "Minerals (Infected)" behavior.

Also, to make the infected patch only return one mineral, change the "Harvest Amount" in the infected behavior to 1.

Oh, I had the idea for switching out resource behaviors long ago. Tried it and got a big headache for my trouble. It's just so...fiddly, if you will, to be activating and deactivating behaviors that have so very many parts that are hard-coded.

Just know that I consider myself a very adept Data Editor person (at the expense of being ignorant in almost every other area). I wasn't asking about how I could make this particular scenario work; I was asking specifically if there was a way to validate the number of resources a unit was carrying. After an intense amount of time pouring over the subject, I've come to the conclusion that the information is hard-coded, which is a problem for me.

Although here's an idea; is there a way to validate if the mineral field the minerals were taken from has a certain behavior? Then, I could have the same Carry Resources actor validate whether or not that mineral field had the infected behavior, and alter the tint appropriately. The main problem I have is how to specify that it's the mineral field I'm validating if it's the SCV that the actor is applied to. In essence, how do I "connect" worker and resource node in a validator?



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:08 pm]
Oh_Man -- example of wat u mean?
[05:59 am]
NudeRaider -- *is
[05:17 am]
NudeRaider -- despite all its flaws the sound design its fantastic
[10:29 pm]
Oh_Man -- homeworld 3 = massive disappointment
[2024-5-14. : 10:05 am]
Moose -- ya
[2024-5-14. : 5:23 am]
zsnakezz -- yes
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
[2024-5-12. : 8:44 pm]
l)ark_ssj9kevin -- Hi Brusilov
[2024-5-12. : 4:35 pm]
O)FaRTy1billion[MM] -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
my server that was hosting it died
[2024-5-10. : 8:46 pm]
NudeRaider -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
https://armoha.github.io/eud-book/
Please log in to shout.


Members Online: 3taylorc933rh1, 9avac76100fh0