I'm trying to create a load ability for a neutral structure that allows it to be "captured" and thus transfer ownership to a player if they manage to get 5 specific units inside of it. Is there a way to do this with two seperate cargos, used for each specific team? I know I can give the structure a generic load ability that allows both allied + enemy + neutral targeting, but I'd like to have to separate cargo bars below the structure's shield and health bars so that the player can easily tell how many of each team's units are inside the structure.
I do have my doubts whether this is actually possible, but if it is, is there also a way to change the color of the bars associated with each cargo bay? Ideally I'd like to have the structure showing a cargo of red units and blue units.
I apologize for asking advice on how to do what is probably impossible in the SC2 editor!
edit: as of post #9, the title of this topic was changed from "Creating a unit that can load both allied and enemied players in seperate cargo holds" to "Creating a structure that can be "captured" by moving a certain amount of units near it"
As far as I know, once you have 1 unit inside the neutral cargo, ownership is transferred to you and thus the enemy cannot enter the building.
I've never tried giving 2 cargo abilities to a unit, though I imagine one will override the other, though I may be wrong.
As for changing the color of the bars associated with the cargo bay, that is very possible.
Actors Tab
Cargo Building
UI: Status Colors+
Cargo: Background Color (colors the "border" of the cargo bar)
Cargo: Selected Value (colors that an "occupied" spot is)
Cargo: Empty Color (self explanatory)
Although this would make ALL of that building have the same cargo colors, but only visible to YOURSELF/allies.
I've got more ideas, but I'm really tired and about to pass out... I came on mapster real quick to pass a minute or 2 before bed and end up trying to answer this fully... and I know what I want to say but cannot get it out, in an understandable way.
I'll see if anyone else cares to throw you an answer whenever to see if I should bother finishing my idea after I wake up(and hopefully uunderstandable).
Nifty, thanks for the tip on the colors! I have a vague idea how I might do it with triggers, but it'd be messy and have unnecessary UI or work like a vendor building or something, and really I prefer doing things in Data when I can. I'd love it if you have any further suggestions, but don't feel bad if it's not possible; I kind of expected this from the start and I've been pondering other ways to get the same functionality.
So I just woke up, and it would be nice to have a few extra details about some specifics, because what I was thinking last night will not be possible.
Here's what might help me out.
# of teams
# of players per team
Only 1 player can own the cargo building, so you could not have player 1 have 3 units in cargo and player 2(his ally) with 2 units in the same building.
Do you need the 5 specified units BEFORE the building becomes owned? Is this important at all?
Can the enemy enter Cargo if you have 5 units in the Cargo building?
I have a hackish-method that could POSSIBLY work, but it seems like alot of work... Just thinking about it gives me a headache right now lol. I'm pretty sure it would be ALL data aswell.
This method would involve
1 cargo building PER player, SMALL sized
1 Dummy building at the location, LARGER sized(big enough to cover all the player Cargo buildings)
Alot of Actor work to "display" to enemy teams how many units the enemy has in Cargo.
ALOT of Validators depending
Probably alot of other work I just haven't thought of yet.
Basically, you place all your Cargo buildings(1 per player) in a circle, then place the dummy building OVER them, with a visible corner sticking out so that the player can see which cargo is theirs. Place some kind of visual on the ground, colored to each individual player(even easier to spot). Or, you make a duplicate of each cargo and just tint each cargo to that player's team color and leave the corner sticking out, removing the necessity for the ground visual. That means, for 4 players, you would have 4 Cargo Buildings, each with a separate tint. This eliminates the need for neutral cargo ownership switching, obviously.
Eh... like I said, it's pretty god damn complicated, and I'm sure you might run into some issues if you try this.
Perhaps ask in Trigger section first before doing it all data?
That definitely looks pretty complicated, but I'll see what I can do.
There are 2 teams. Each team has a single computer player and up to 2 human players. Only the computer player is of concern in this case, as only it controls the units required to capture the building. The players have the ability to issue the command to capture a structure to the computer player's units, but the computer player retains ownership of the units.
The building changes ownership to whichever computer player manages to get 5 units into their respective cargo.
Whenever a unit is loaded into cargo, it removes (and kills) one unit from the enemy's cargo. For example:
Team 2 has 4 units loaded, Team 1 has 0 units loaded -> Team 1 loads 1 unit into the structure -> Team 2 has 3 units loaded, Team 1 has 1 unit loaded
Once the structure has been captured, the capturing units remain in cargo. The structure remains under the capturer's control until the other team manages to get 5 units in cargo, and thus 0 units in the enemy's cargo.
Dropping the units is not a concern, as they never leave cargo short of being killed by the enemy team's units being loaded into cargo. Once a unit is committed to capturing the structure, it is considered lost.
Dropping the units is not a concern, as they never leave cargo short of being killed by the enemy team's units being loaded into cargo. Once a unit is committed to capturing the structure, it is considered lost.
Sounds like the cargo ability isn't really necessary. You just need to achieve a visualization of two opposing behaviors placed on the building from the two teams.
Following your suggestion, I'm trying to do this through behaviors and no cargo. I currently have a persistant Buff placed on the structure that searches for nearby capturing units, then removes each found unit and applies a corresponding "capture stack" Buff to the structure. The problem is I don't know how to design it so it keeps track of different players' buffs; that is to say that the structure can tell the distinction between how many capturing units owned by player 1 have been removed and how many from player 2 have been removed.
I'll probably end up making a visual representation through attaching the capturing unit's actor to a part of the structure, so that the unit appears to be visually "garrisoned" in the structure. I don't know how to do this either but I've found several good examples of attachments that I intend to study further.
It's hellishly linear and not very customisable at all.
Does it need to be entirely data-editor based?
A simpler solution would be to trigger most of it using a search area effect on the unit. Every time a unit is found, it is removed and a custom value index of the cargo unit is increased by 1. Create an ability on the structure (which is usable by all players) which 'removes' a unit from it's pseudo-cargo, by subtracting 1 from custom value [triggering player] of [triggering unit] and creating 1 whatever-unit at position of [triggering unit].
For visuals, you can create a sphere model (actor) above the building for each unit inside the building, tinted by player colour. Not the greatest looking, but retains functionality (as though you had separate cargo UI bars coloured for each player).
I guess I could do it with triggers. I have avoided resorting to them for most of the other things I wanted to do in Data, so I suppose I could afford one mechanic that doesn't activate very frequently.
If I do end up doing it with triggers, is there a way to make a struct-like set of variables for each capturable structure? Is this done with records? If it is, will I have to manually make them for every capturable structure on the map?
I've got it mostly working through a combination of trigger, behaviors, orders, and effects now. I have the structure do a periodic search for the capturing unit, which when found is issued an order to use a dummy instant effect ability Capture. When this order reaches the completion stage, it flags a trigger event, which then proceeds to remove the unit and apply a "capture stack" buff corresponding to the owner of the capturing unit. If, after adding the capture stack, 5 stacks of one of the player capture stacks have been applied in total, the structure changes ownership to that player.
The only thing left to do then is achieve a visualization of this behavior! I'll try doing the sphere model thing you suggested, I guess. Thanks for the help!
I'm stuck again! For the visualization effect, I decided the best way to do it would be to use the floating text actor to show counts for how many of each buff type is on the structure. So, if the structure had 3 capture stacks from red team, there's be a floating red "3" to the left of the structure, and if it had 2 capture stacks from blue team, it'd also show a floating blue "2" to the right. I'm pretty shaky doing anything with actors but I think I can do this if I just make enough of them for each case.
What I'm wondering is whether or not there's a way to reference the number of stacks a buff has in the text field of the floating text actor, which would save me from having to make 2 colored unique floating text actors for each number. If I find out how to do it like this I can probably just have a generic floating text actor for each stack, rather than a mountain of periodic effects applied to the unit checking whether or not it has [x] stacks of a buff and showing the appropriate actor.
As always, advice is greatly appreciated. At this point my project is mostly done and I'm just doing these cosmetic things, but I do think they matter for the player's comprehension.
edit: to be clear, I'm thinking of the Starcraft 2 floating text actor text field equivalent of the kind of something like
I got the floating text to appear as I wanted to through triggers. It's kind of a messy, impractical solution, but it works. It's a shame, as I wanted to do it with data, but I don't really have time to waste on this part of my project anymore.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to create a load ability for a neutral structure that allows it to be "captured" and thus transfer ownership to a player if they manage to get 5 specific units inside of it. Is there a way to do this with two seperate cargos, used for each specific team? I know I can give the structure a generic load ability that allows both allied + enemy + neutral targeting, but I'd like to have to separate cargo bars below the structure's shield and health bars so that the player can easily tell how many of each team's units are inside the structure.
I do have my doubts whether this is actually possible, but if it is, is there also a way to change the color of the bars associated with each cargo bay? Ideally I'd like to have the structure showing a cargo of red units and blue units.
I apologize for asking advice on how to do what is probably impossible in the SC2 editor!
edit: as of post #9, the title of this topic was changed from "Creating a unit that can load both allied and enemied players in seperate cargo holds" to "Creating a structure that can be "captured" by moving a certain amount of units near it"
As far as I know, once you have 1 unit inside the neutral cargo, ownership is transferred to you and thus the enemy cannot enter the building.
I've never tried giving 2 cargo abilities to a unit, though I imagine one will override the other, though I may be wrong.
As for changing the color of the bars associated with the cargo bay, that is very possible.
Although this would make ALL of that building have the same cargo colors, but only visible to YOURSELF/allies.
I've got more ideas, but I'm really tired and about to pass out... I came on mapster real quick to pass a minute or 2 before bed and end up trying to answer this fully... and I know what I want to say but cannot get it out, in an understandable way.
I'll see if anyone else cares to throw you an answer whenever to see if I should bother finishing my idea after I wake up(and hopefully uunderstandable).
Sorry for the (temporary) false hope ;)
Passing out`~
Nifty, thanks for the tip on the colors! I have a vague idea how I might do it with triggers, but it'd be messy and have unnecessary UI or work like a vendor building or something, and really I prefer doing things in Data when I can. I'd love it if you have any further suggestions, but don't feel bad if it's not possible; I kind of expected this from the start and I've been pondering other ways to get the same functionality.
It is possible with items and inventory but there is no automatic way to drop them. Not sure about the transport ability though.
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
So I just woke up, and it would be nice to have a few extra details about some specifics, because what I was thinking last night will not be possible.
Here's what might help me out.
I have a hackish-method that could POSSIBLY work, but it seems like alot of work... Just thinking about it gives me a headache right now lol. I'm pretty sure it would be ALL data aswell.
This method would involve
Basically, you place all your Cargo buildings(1 per player) in a circle, then place the dummy building OVER them, with a visible corner sticking out so that the player can see which cargo is theirs. Place some kind of visual on the ground, colored to each individual player(even easier to spot). Or, you make a duplicate of each cargo and just tint each cargo to that player's team color and leave the corner sticking out, removing the necessity for the ground visual. That means, for 4 players, you would have 4 Cargo Buildings, each with a separate tint. This eliminates the need for neutral cargo ownership switching, obviously.
Eh... like I said, it's pretty god damn complicated, and I'm sure you might run into some issues if you try this.
Perhaps ask in Trigger section first before doing it all data?
That definitely looks pretty complicated, but I'll see what I can do.
There are 2 teams. Each team has a single computer player and up to 2 human players. Only the computer player is of concern in this case, as only it controls the units required to capture the building. The players have the ability to issue the command to capture a structure to the computer player's units, but the computer player retains ownership of the units.
The building changes ownership to whichever computer player manages to get 5 units into their respective cargo.
Whenever a unit is loaded into cargo, it removes (and kills) one unit from the enemy's cargo. For example:
Team 2 has 4 units loaded, Team 1 has 0 units loaded -> Team 1 loads 1 unit into the structure -> Team 2 has 3 units loaded, Team 1 has 1 unit loaded
Once the structure has been captured, the capturing units remain in cargo. The structure remains under the capturer's control until the other team manages to get 5 units in cargo, and thus 0 units in the enemy's cargo.
Dropping the units is not a concern, as they never leave cargo short of being killed by the enemy team's units being loaded into cargo. Once a unit is committed to capturing the structure, it is considered lost.
I'll start working on this segment of my project soon, and will post my methods when (if) I am successful!
Sounds like the cargo ability isn't really necessary. You just need to achieve a visualization of two opposing behaviors placed on the building from the two teams.
@Khalanil1: Go
Following your suggestion, I'm trying to do this through behaviors and no cargo. I currently have a persistant Buff placed on the structure that searches for nearby capturing units, then removes each found unit and applies a corresponding "capture stack" Buff to the structure. The problem is I don't know how to design it so it keeps track of different players' buffs; that is to say that the structure can tell the distinction between how many capturing units owned by player 1 have been removed and how many from player 2 have been removed.
I'll probably end up making a visual representation through attaching the capturing unit's actor to a part of the structure, so that the unit appears to be visually "garrisoned" in the structure. I don't know how to do this either but I've found several good examples of attachments that I intend to study further.
@LaurenI: Go
Don't use cargo.
It's hellishly linear and not very customisable at all.
Does it need to be entirely data-editor based?
A simpler solution would be to trigger most of it using a search area effect on the unit. Every time a unit is found, it is removed and a custom value index of the cargo unit is increased by 1. Create an ability on the structure (which is usable by all players) which 'removes' a unit from it's pseudo-cargo, by subtracting 1 from custom value [triggering player] of [triggering unit] and creating 1 whatever-unit at position of [triggering unit].
For visuals, you can create a sphere model (actor) above the building for each unit inside the building, tinted by player colour. Not the greatest looking, but retains functionality (as though you had separate cargo UI bars coloured for each player).
I guess I could do it with triggers. I have avoided resorting to them for most of the other things I wanted to do in Data, so I suppose I could afford one mechanic that doesn't activate very frequently.
If I do end up doing it with triggers, is there a way to make a struct-like set of variables for each capturable structure? Is this done with records? If it is, will I have to manually make them for every capturable structure on the map?
As always, the help is very much appreciated.
I've got it mostly working through a combination of trigger, behaviors, orders, and effects now. I have the structure do a periodic search for the capturing unit, which when found is issued an order to use a dummy instant effect ability Capture. When this order reaches the completion stage, it flags a trigger event, which then proceeds to remove the unit and apply a "capture stack" buff corresponding to the owner of the capturing unit. If, after adding the capture stack, 5 stacks of one of the player capture stacks have been applied in total, the structure changes ownership to that player.
The only thing left to do then is achieve a visualization of this behavior! I'll try doing the sphere model thing you suggested, I guess. Thanks for the help!
I'm stuck again! For the visualization effect, I decided the best way to do it would be to use the floating text actor to show counts for how many of each buff type is on the structure. So, if the structure had 3 capture stacks from red team, there's be a floating red "3" to the left of the structure, and if it had 2 capture stacks from blue team, it'd also show a floating blue "2" to the right. I'm pretty shaky doing anything with actors but I think I can do this if I just make enough of them for each case.
What I'm wondering is whether or not there's a way to reference the number of stacks a buff has in the text field of the floating text actor, which would save me from having to make 2 colored unique floating text actors for each number. If I find out how to do it like this I can probably just have a generic floating text actor for each stack, rather than a mountain of periodic effects applied to the unit checking whether or not it has [x] stacks of a buff and showing the appropriate actor.
As always, advice is greatly appreciated. At this point my project is mostly done and I'm just doing these cosmetic things, but I do think they matter for the player's comprehension.
edit: to be clear, I'm thinking of the Starcraft 2 floating text actor text field equivalent of the kind of something like
Console.WriteLine(redCaptureStack.count() + " : " + blueCaptureStack.count());
instead of what I have now, which is a bunch of hardcoded things like
Console.WriteLine("3:2"); Console.WriteLine("4:1"); Console.WriteLine("0:2");
I got the floating text to appear as I wanted to through triggers. It's kind of a messy, impractical solution, but it works. It's a shame, as I wanted to do it with data, but I don't really have time to waste on this part of my project anymore.