• 0

    posted a message on [TIL]Player Groups are Wonky

    I just learned this the hard way, and I think this knowledge may benefit other mapmakers.

    Normally, when you assign a variable to another variable, you're just making the assigned-to variable equal to the assigned-from variable. But when your variables are player groups, assigning one to the other actually links them both together.

    If you want to mess with a copy of a player group without modifying the original, you have to assign using the function "Copy of Player Group" or whatever it is.

    Example: I had a (global) player group named Marines that contained all "Marine" players. But I also have some ranks among them, such as Lieutenant, Sergeant, Corporal, and Grunts. I wanted to assign an Objective to every Marine except for the Lieutenant, so I created a local variable, named "Everyone But Lieutenant" and of type Player Group. I assigned the Marines variable to it. I then removed Lieutenant from "Everyone But Lieutenant".

    Later, in a completely different trigger, I started having trouble with setting alliances for the Marines group. Every Marine would be affected by the change except for the Lieutenant.

    I eventually stumbled back upon the above local variable, and I tried assigning it as a copy of the Marines player group instead of assigning it to be equal to the player group.

    This fixed the problem.

    In short, when one variable was assigned to the other, modifying one player group modified the other as well. In order to modify a temporary copy, you have to make a copy of it rather than simply assign it.

    Hope this information helps someone!

    Posted in: Triggers
  • 0

    posted a message on SC2Layout Snippits

    Objective with Sub-Objectives

    Snippet Type: Partial

    These files get rid of the "Main Objectives" and "Bonus Objectives" text. They re-organize the objectives so that secondary objectives are indented, and are beneath the primary objective(s). This is useful if you want your secondary objectives to be prerequisites to completing a primary objective.

    Import all three files, including the dds (needed to remove the arrows). Don't change their names unless you want to do some code editing. If the order makes any difference, add ObjectivePanelIndented to the Custom Layout Files field first, then ObjectivePanelOverride second.

    ObjectivePanelOverride is a traditional GameUI override file. All it does is points to a template in ObjectivePanelIndented, so that the deep changes can be made.

    This is the first time I've ever used the UI editor successfully. It took me several hours using references from OP's tutorials to figure this all out. (I really wanted something like this for my map, but couldn't find anything like it.)

    I've also included a test map. Enjoy!

    Objective with Sub-Objectives

    Posted in: UI Development
  • 0

    posted a message on Viking land while moving?

    You're very welcome! Glad you like it. :)

    Theoretically, it should be possible to make it even more like the Viking landing in the intro video. I haven't tried this yet. But theoretically, if you extend the duration of the ability and the delay of the mover, and you leave the triggers the same, the Viking should slide on the ground for a little bit before it becomes a ground unit. You could then put in something that makes puffs of dirt at its feet to help it appear to be sliding on the ground.

    You could even go a step further and make it rotate towards an enemy and shoot it. But I don't know how that would work. I don't know if the rotation would change its direction. And for shooting, I don't know how you'd get the attack to fire during a morph. Just enabling the ability probably won't be enough. Enabling the move ability didn't work when I tried it. That only allowed me to interrupt the morph while it hadn't started yet.

    EDIT: I used triggers because behaviors can let you change height, but they don't allow for negative heights. ...I suddenly wonder if height in behaviors is relative or absolute? I'd assumed relative...

    EDIT EDIT: Like someone else mentioned, you could have troubles with it depending on where you land the viking. It's considered an air unit until the very end of the animation, so it could bug out if it lands on something a ground unit can't go on.

    Posted in: Data
  • 0

    posted a message on Viking land while moving?

    I decided to take on this challenge for the fun of it. And I've got it working! Unfortunately, it doesn't seem possible without triggers. I'll walk you through the changes I made.

    First, make a Behavior - Buff called "Viking Glide". In it, set Deceleration Multiplier to 0.01.

    (This will make the viking keep moving while it's not actively trying to move. It practically stops it from decelerating.)

    Then, make an Effect - Apply Behavior called "Viking Glide". Make it apply the behavior "Viking Glide" that you made. Also make an Effect - Remove Behavior called "Viking Land". Make it remove the behavior "Viking Glide" that you made.

    Go to Abilities tab. Go to "Viking - Assault Mode". Here's where the most important of the changes take place.

    Under Stats, uncheck "Wait Until Stopped".

    (The morph can now activate while the viking is still moving.)

    Under Ability right-click Ability Info - "Viking (Assault Mode)" and click "Modify..."

    Go to Info - Sections - Durations and make these changes:

    • Change Abilities - Duration from 0 to 2.34
    • Change Mover - Delay from 0.533 to 2.34
    • Change Mover - Duration from 1.2 to 0

    (The viking seems to stop moving when the mover changes from flying to ground. Getting rid of the duration and increasing the delay makes it so this movement-stopping change doesn't happen until the ability is over.)

    (Giving the ability a duration fixes problems with the viking instantly landing. It also provides us with a convenient way to apply and remove the behavior. Which brings us to the next step.)

    Go to Info - Sections - Effects. Make these changes:

    • Put the "Viking Glide" effect in Abilities - Start.
    • Put the "Viking Land" effect in Abilities - Finish.

    (The viking will now glide while it's landing, and move normally again after the landing is complete.

    Now, we only have to put in a couple of triggers to facilitate the correct height change. We need two triggers, as follows:

    Viking Land

    Event: Unit - Any Unit uses Viking - Assault Mode at Morph 13 - Abilities Start stage. (Ignore shared abilities.)

    Action: Unit - Change (Triggering Unit) height to (Viking (Assault Mode)) Height over 2.34 seconds.

    Viking Takeoff

    Event: Unit - Any Unit uses Viking - Fighter Mode at Morph 15 - Mover Start stage. (Ignore shared abilities.)

    Action: Unit - Change (Triggering Unit) height to (Viking (Assault Mode)) Height over 0 seconds.

    (When the Viking is ordered to land, the trigger makes it smoothly lower as it glides. Then the switch in movers takes over and the morph is complete. When the viking is ordered to liftoff again, we wait until the mover begins to transition to flying. Then we instantly set its height to its ground height. The reason we use the ground height instead of the air height is because the Viking will continue to lift-off relative to the height we set. So if, at the beginning of its transition from ground to air, we set it to ground height, it will smoothly transition to air again.)

    Attached is an example map I put this together on. Good luck!

    Posted in: Data
  • 0

    posted a message on Move transmission text

    Heya. I have a map that I'm trying to make an intro sequence for. It involves dialogue being transmitted "from" portraits while cinematic mode is on. I basically just turn cinematic mode on and issue a transmission from a unit portrait with a name and message.

    However, the box at the bottom of the screen that the transmission text appears in (during cinematic mode) is aligned to the left of the screen, while my portrait is aligned to the right of the screen.

    Is there any way to align the text at the bottom to the right side? I've tried everything I could think of, but when I think I've found the right UI thing to override in the UI editor, I just get a message that says that element is marked as "Blizzard Only".

    EDIT: Never mind, not too important. I just moved the portrait to the left side of the screen.

    Posted in: UI Development
  • 0

    posted a message on [TIL]Killed Unit Resources only works on enemy units.

    Good idea. I have no option to edit it, so I'll just leave a comment on the page.

    Posted in: Data
  • 0

    posted a message on [TIL]Killed Unit Resources only works on enemy units.

    This may be helpful for someone in the future. I'm making a map, and part of the gameplay involves killing enemy or neutral units for resources.

    While you can set the amount of resources a unit gives directly in its Data fields, this only works on enemy units. If you kill an enemy unit that gives resources, you gain the resources. If you kill a non-enemy unit that gives resources, you do not get the resources.

    Fortunately, there's a simple way you can fix this: Use a trigger that sets the neutral player to be your enemy. After that, you'll be able to gain resources by killing neutral units that yield resources.

    Unfortunately, that's the best I've got. Other than that, you'd have to make a more involved trigger that gives you the resources when you kill the neutral unit.

    For my purposes, the simpler solution will suffice. The player who will be after the neutral units should be considering them an enemy anyway. Though I'd kind of like them to not automatically aggress against the neutral units. But that's another topic altogether.

    EDIT: After some testing, I found that only the enemy unit has to see you as an enemy in order for you to gain resources. You can set the alliance one-way and this will work. You can see the unit as neutral and it see you as an enemy, and you gain the resources. If you see it as an enemy, but it does not see you as an enemy, you do not gain the resources.

    Posted in: Data
  • 0

    posted a message on [Solved]Give resources to unit

    I have it all worked out. I used the trigger mentioned above. But I had to do some things in addition to make it work right.

    Normally, a behavior gets applied to the mining unit when it finishes mining, so that the unit carries a mineral crystal, etc. The behavior automatically gets removed when the unit drops off the resource. But if you set the resource manually, you also have to set the behavior manually. And if you set the behavior manually, you have to remove it manually as well.

    So what I did is set a stack of behaviors on the resource node (Scrap Heap) called Components. The SCV has an ability that steals one of those Components behaviors. Then I have a trigger that fires if the SCV gains a Component behavior. The trigger removes it and gives the SCV 10 Components and the "Carrying Components" behavior that I created. I also have another trigger that fires if the Components resource the SCV is carrying are reduced to zero. (Drop off.) This trigger removes the "Carrying Components" behavior.

    (The behavior itself doesn't do anything. But there is an actor that has a couple of events that fires based on a unit gaining the behavior. If any unit gains that behavior, the actor creates. If the unit loses the behavior, the actor destroys itself. Duplicate and modify the Carrying Minerals actor to suit your needs, since it already specifies the needed attachment point and such.)

    Posted in: Data
  • 0

    posted a message on [Solved]Give resources to unit

    Thank you. It seems like that's what I'll have to use for now. I wish we had access to that property in data too and not just triggers.

    Posted in: Data
  • 0

    posted a message on [Solved]Give resources to unit

    I don't mean give it to the player. I mean give it to the SCV, as if the SCV had harvested something. Then the SCV can return it to a command center or something.

    The behaviors for holding a resource don't seem to have any stat in them that has to do with the number of resources held. Mining a resource simply gives that behavior to the unit, while the resource that was mined specifies how much of the resource was mined. All that the "holding resource" behavior seems to do is attach a model of the held resource to the SCV's hands. (The actor is triggered by this behavior being activated and its removal is triggered by the behavior being removed.) There's something behind the scenes determining how much minerals the SCV has and something behind the scenes taking those minerals when the SCV returns them to a base.

    So it seems like the only way to give a certain number of resources to a unit, is to have that unit mine a unit that has that number set for amount mined per trip. There's no way to just give minerals to an SCV that I can see unless the SCV mines something manually.

    EDIT: I just realized one hacky way I could do it is use an invisible unit that acts like a mineral patch, but for the other resource. The behavior on the scrap heap could spawn a "component" which is invisible, and then order the SCV to mine it. The mining would be set to happen instantly. That's the only way I can think of right now to do this. I'm wondering if there's a more elegant way than that.

    Posted in: Data
  • 0

    posted a message on [Solved]Give resources to unit

    Heya. I'd like to have a pile of scrap metal that an SCV can harvest either "Scrap Metal" or "Components" out of. (Renamed from Minerals and Vespene, respectively.) The way I'm thinking of doing it is having the scrap metal pile act like a normal mineral patch, which also has behaviors on it that can be used to give the unit Components instead of Scrap Metal. (Say if you toggle or cast an ability, it can mimic mining, channel a certain amount of time, and then give the SCV the "Components" resource instead of "Scrap Metal".)

    The problem is, that doesn't seem to be possible. The only way for a unit to gain resources is to mine them from a unit that has a resource behavior. There seems to be no way to just give the unit the resources via data.

    Is there a way to do this that I'm not aware of?

    Posted in: Data
  • 0

    posted a message on What do resource tooltips do?

    I mean like, in the text editor, there is an entry for UI/ResourceName0, UI/ResourceName1, UI/ResourceName2, and UI/ResourceName3. Those values are what appear when you hover over the resource list in the upper right of the screen.

    But there are also entries for UI/ResourceToolTip0, UI/ResourceToolTip1, UI/ResourceToolTip2, and UI/ResourceToolTip3. These each contain descriptions of the resources that they match up with. But I can't find these descriptions in the game anywhere. Where do they show up in-game?

    Posted in: Miscellaneous Development
  • 0

    posted a message on What do resource tooltips do?

    I figured out in the text editor how to change the names of the resources (in the upper-right of the screen). But each resource also has an entry for its tooltip. What does that entry do?

    The only thing that shows up as a tooltip when I hover over the resource is its name. The tooltip value doesn't show up anywhere that I can find in-game.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Solved]Text Editor: Remove Text?

    Whew, I'm relieved. I tested it out and that's what happened. It goes back to the value of Core.SC2Mod.

    Thank you!

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Solved]Text Editor: Remove Text?

    Heya. I needed to change the text entries for the minerals, vespine, etc, to get custom names/tooltips. But I'm making both a mod and a map, and I accidentally made this change in the map and not the mod. (The mod is a dependency for the map, and I want to keep things logically organized.)

    If I right-click and do "remove text" while in my map, will it revert back to the value in Core.SC2Mod? Or will it override what's prior and show as having no text entry for that thing?

    I basically just want to revert back to the default value without my map showing up as the dependency for the original value. Then I want to re-enter the new value in the mod rather than the map.

    Posted in: Miscellaneous Development
  • To post a comment, please or register a new account.