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.
[05:21 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: NudeRaider yeh thts straight up cheating
the mutas yes, the wraiths probably not. Have you even watched the video? ;)
[12:56 pm]
Oh_Man -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
yeh thts straight up cheating
[12:24 pm]
Oh_Man -- arty's done another vid. he's also announced he's going to organise showmatches with pro, with NO maphacks, so we can see its actual capabilities
[10:09 am]
NimoStar -- It can by playing the same map thousands of times. It is similar to AI speedrunning games
[02:30 am]
Symmetry -- I dreamed about that as a kid. The idea of a computer capable of analyzing a starcraft map and calculating the fastest possible way to hit the victory condition
[02:29 am]
Symmetry -- But can AI beat my custom maps?
[2026-9-22. : 12:32 pm]
Oh_Man -- yea APM vs eAPM
[2026-9-22. : 8:48 am]
NimoStar -- plus most of the human APM is just spam clicking APM inflation
[2026-9-22. : 8:47 am]
NimoStar -- the thing with the "*12" thing is completely misleading. The AI isn't using two control groups, it can use each of those actions to command a single unit individually and issue different commands to each single unit.
Please log in to shout.


Members Online: Roy