What's the easiest way to get this done? I've been having trouble finding a solution that doesn't require an entire UI rework.
- Registered User
Member for 8 years, 2 months, and 14 days
Last active Fri, Nov, 17 2017 00:26:48
- 0 Followers
- 1,180 Total Posts
- 0 Thanks
Feb 25, 2017Posted in: UI DevelopmentI would start by hiding elements in ConsoleUIContainer, FullscreenUpperContainer, etc that you do not need (<Visible val="false"/>).And then you move the InfoPanel around.You can use the ingame UI editor to figure out which elements are remaining visible on screen (right click the area on screen -> chose frame in dropdown) and check their path, so you can hide everything one by one.Please note that there might be a few unusual frames that do not respond to <Visible val="false"/>. If that is the case, I recommend moving them off-screen via editing their anchor offsets.Also, you might want to edit GameUI's properties to remove the black bars. But please note that this also edits where the camera centers in case your map is a melee map. Zerg players do not like that when they do injects in all bases and use that hotkey that cycles through all bases.
Nov 4, 2016Posted in: Trigger Libraries & Scripts
Quote from InsaneMst: Go
I see other errors in what I presume is the example map. But I never got those errors at home. Are you able to run the map at all? Can you try and report me when the error shows up? Also, I like more the editor GUI, for I think is much more cleaner to watch to (mainly because of the horrible id the galaxy put on the variables and functions.
Also, the error is given when you access a_units_detector_abilities or when accessing the Unit Group?
The problem is that n_index can go up to 50 because the loop uses Warrior's index cap while the units detectors abilities goes up to 10. Thus 11 is past the array's end resulting in this error.
The other trigger errors are in the native library caused by cutscene mode trying to disable some hotkey. Maybe the error interferes with the execution of other things, but I doubt that.
Nov 3, 2016_ForgeUser6627554 posted a message on Does a trigger create lag if it doesnt meet conditions?Posted in: Triggers
Quote from GlornII: Go
Eric? Where are you eric? He would know better than me. I know of a few examples. Things I did when first learning definitions.
If you use a definition within a definition, with create flag, and have a parameter used in both, then the two definitions cannot continue in their own threads until the other thread finishes using the object. I'm not sure which one takes priority.
Another thing I personally encountered, is using acreate thread to reference something, and the action fires too frequently. Frequently enough that the next fire starts before the previous thread is complete. Same concept as above, where 2 threads are trying to change the same thing.
An easy way to think of it would be like, uhhh... A boat travelling down a channel. A new thread is a new channel, allowing more boats to travel. A single, specific boat cannot exist in two channels at the same time though.
You have a few misconceptions. Let me try to explain how threads work in SC2:
1. The execution of threads is deterministic. The order can be determined beforehand and thus taken advantage of. Thus, there are no race conditions which you can easily run into in powerful programming languages (Java, ...).
2. There is a thread limit. I believe it currently resides at 2048 threads. Further threads would not be created and the trigger debugger should spit out an error message. If you have a lot of triggers suddenly not working anymore (e.g. unit entering region -> order...), this can be the problem.
3. Creating threads has an overhead, some extra work that has to be done because it is more than just a function call. However, it is rather small, so you need a lot of threads to cause lag. So, instead of having 10 triggers with the identical event, you can just create a single trigger that then calls appropriate functions, for example. Else, you will have 10 threads firing and terminating after the first check.
4. The create thread action does not cause the calling thread to wait. It creates a thread which is added to the end of the thread queue of the current game loop. It will be executed after all other active threads/triggers firing of the current game update. I don't think a thread execution would ever wait on another thread due to a resource being used. Maybe you would need to use critical sections for that, but I don't know if they really serve any purpose atm. I just don't need them due to everything being deterministic.
5. Functions cannot create threads although the editor displays the flag.
Thread's order of execution (incomplete):
- You might be aware that most aspects of the game update 16 times per game second. Triggers update twice as fast: 32 times per game second.
- The order of execution can be seen as two queues: one for the first phase, one for the second phase.
- First, old threads are executed.
- Second, new threads created by trigger events firing are executed in order of appearance of the trigger in the script code. Remember, the editor puts library's code above the map script, so triggers firing in mods should always execute first.
- Waiting 0.0 seconds causes the thread to be pushed at the end of the second phase's queue. Other wait durations cause the thread to be delayed to later trigger updates causing it to be executed as an existing thread. Waiting 0.0 in the second phase just causes the thread to be executed in the next update's first phase again, similar to waiting 0.0625.
- The second phase is executed after the first phase. There might be a tiny delay, but as far as I am aware, it just executes immediately after the first phase. I never noticed a delay.
- I assume that units created by triggers in the first phase might cause triggers to fire in the second phase, e.g. entering region. I did not test this; this is just a thought.
- As you might have noticed, this order is incomplete. It reflects my current state of knowledge and it is sufficient for my style of triggering to take advantage of the order of execution. For example, I don't know how triggers waiting for other triggers to complete is executed, how new threads created by unit spawns during the first phase's triggers are handled, what critical sections do, etc.
Knowing this order is really helpful if you create a WASD movement system. You would want to delay the movement logic by 0.0 game seconds to execute it in the second trigger phase. At that moment, all button input threads fired and were executed. Thus, you properly use all button inputs and cause changes to happen before the next game update starts.
Also, the order of trigger definitions in the script can be important. For example, if a player lags, he/she is able to press a button like A down and up within the same update cycle. If your system does not handle that situation properly, you will easily get stuck in one of the modes, e.g. walking to the left because you defined releasing A before pressing A down. Btw, a proper system might keep track of the keyboard button state and try to adjust accordingly.
I'm using both of these things I mentioned in my FPS shooter engine test.
Quote from egodbout: Go
Triggers do not lag at all. The map size and the numbers of doodas/units into your map is the N1 reason of lag.
Errors in triggers can do that. Trigger can eat up FPS, which might cause a feeling of lag, if the FPS are too low. But the impact of new threads is tiny, thus Blizzard creates new threads left and right in Heroes of the Storm's triggers even when action definition calls would be sufficient.
Oct 6, 2016Posted in: Off-Topic
Quote from DrSuperEvil: Go
Was that post (#16) spam?
It is spam.
The post contains a website and encourages you to visit it. The author talks about post quality while repeating "here" three times in three sentences. It recommends a website about using a complex game editor to all of her friends. How many of "her" friends would be interested in this place and topic? The accounts' first post is a necro in the "Off-Topic" category. The post can be posted in any other community's forum with a topic containing "graduation" without instantly raising every moderator's red flags as it is neutral enough and does not mention this place's name.
To not be off-topic myself, I will graduate in one year with a Masters degree in Information Systems.
Aug 28, 2016Posted in: UI Development
Quote from willuwontu: Go
Raises his hand, I know about em, I just have never got animations working properly, and have never needed more than 2 states.
Edit: How do you get a button to use 3 states anyways?
State groups are a construct for logic. They resemble a series of IF-THEN statements.
For example, here is the one I use to change mana bar colors in Heroes of the Storm's observer UI:
<StateGroup name="ManaBarColorSwitcher"> <DefaultState val="BlueMana"/> <State name="Fury"> <When type="Property" frame="FuryUsers/BarbarianFuryBuffState" visible="true"/> <Action type="ApplyTemplate" frame="ManaBar" template="_ColoredManaBars/FuryBarObserverOverviewTemplate"/> </State> <State name="Brew"> <When type="Property" frame="BrewUsers_NotManaUserDummy/NotManaUserState" visible="true"/> <When type="Property" frame="BrewUsers_HeroGenericIsFat/HeroGenericIsFatState" visible="true"/> <Action type="ApplyTemplate" frame="ManaBar" template="_ColoredManaBars/BrewBarObserverOverviewTemplate"/> </State> <State name="TracerAmmo"> <When type="Property" frame="Tracer/TracerReloadControllerState" visible="true"/> <Action type="ApplyTemplate" frame="ManaBar" template="_ColoredManaBars/TracerAmmoBarObserverOverviewTemplate"/> </State> <State name="AurielStoredMana"> <When type="Property" frame="AurielRayOfHeavenEnergyStored/AurielEnergyStoredState" visible="true"/> <Action type="ApplyTemplate" frame="ManaBar" template="_ColoredManaBars/AurielStoredManaBarObserverOverviewTemplate"/> </State> <State name="BlueMana"> <Action type="ApplyTemplate" frame="ManaBar" template="_ColoredManaBars/ManaBarObserverOverviewTemplate"/> </State> </StateGroup>
As you can imagine, being able to apply templates based on conditions is very powerful. The stategroup above checks the visibility of a couple of other frames to change the state and apply the correct template.
You can set a couple of properties directly with it, too, but which actions and conditions exist is unknown to me. I only know the ones that Blizzard uses in their UIs in SC2 and Heroes.
Animations are for direct responses to events, for example in the following snippet, a frame checks if the unit in the current scope has a special behavior. Its state causes a frame to become visible/hidden. That frame's visibility is used above in the state group.
<Frame type="UnitStatusBehaviorAnim" name="FuryUsers"> <Anchor relative="$parent"/> <Behavior val="BarbarianFuryBuff"/> <Frame type="Frame" name="BarbarianFuryBuffState"> <Anchor relative="$parent"/> <Visible val="false"/> </Frame> <Animation name="BehaviorControlAnim"> <Event event="BehaviorActivate" action="Reset,DirectionForward,Play"/> <Event event="BehaviorDeactivate" action="DirectionReverse,Play"/> <Controller type="Visibility" end="Pause" frame="BarbarianFuryBuffState"> <Key type="Bool" time="0" value="false"/> <Key type="Bool" time="0" value="true"/> </Controller> </Animation> </Frame>
Aug 28, 2016Posted in: UI Development
Quote from temhawk: Go
Yes, there is a problem with that. Changing the positioning is unnecessarily more convoluted than it should be. Right now the icons are anchored to the bottom-right of the container. If I wanted them above the unit portrait, I'd have to change the anchoring of the container and the icon template. Also, it interferes with being able to click on other frames in the UI editor.
You only have to change the anchoring of your container.
Quote from temhawk: Go
And what if I later decide to add/rearrange/remove things? Then I have to find and update every other frame that was anchoring to some arbitrary child instead of the container when that was really the intent.
I don't understand the problem. My organization would be like this:
1. Child elements inside the container are collapsible, their height and width are. The child elements are positioned in a row next to each other in the bottom right of their container frame. Their anchors are bound to another, e.g. bottom anchor of the first child and right anchor bound to predecessor child.
To describe the content of each slot, you can create and apply templates as every slot's label and images are created in the same way.
2. The container is anchored with its left anchor to the last child element slot. The bottom right anchors are bound to wherever you want the child elements to appear. If you want the top border to be set correctly, you can use animations for each frame in UI or a state group in UI or set the height in trigger code. But you would only need to do that if you really require the height to be 0 when there are no slots visible.
3. Other frames anchor to the container and are always closely positioned to the space requirements of that container (except for the height unless you add that in one of the 3 ways described above).
4. Triggers hook up each slot's frame, the label and the icon image and edit visibility, text and the image file.
2013 is when the UI stuff was new and I learned everything. Nowadays I am most likely the person outside Blizzard that knows most about UI editing in SC2/Heroes of the Storm. For example, only a couple of people know about the new UI feature of animations and state groups (but to use these features you need to abandon the SC2 editor for UI editing).
So, trying to make me understand your problems is a good way of getting my input. Currently, I am struggling a bit understanding what exactly the problem is as most likely you come with other UI concepts that I do not know.
Aug 27, 2016Posted in: UI Development
Quote from temhawk: Go
I understand that. The part that I don't understand is how to apply this to frames containing many different frames, especially frames that aren't tooltips. E.g. I want to wrap up those two number icons (each one made up of a background image, an image and a label) in a container that could then be positioned anywhere easily. Right now I have the container stretching up all the way to $parent (FullscreenUpperContainer) except for the bottom, which is anchored to the top of the command card, because I can't make it only as tall and wide as it needs to be (without hard-coding values).
The container is not visible, so its size can be pretty much the entire screen. There is no problem with that.
But, if you really want to, you can set an anchor to a child frame via just using the child frame's name in the anchor's relative="ChildFrame". If you position your last upgrade icon slot properly, you can just use its top border (= "Min").
Aug 25, 2016Posted in: Data
Quote from BigDonRob: Go
And is this done in the Editor(Okay) or outside of the editor(Which is apparently against the User Agreement)?
In the editor. Just open the data editor, open the Sounds tab via the green "+" and search for minerals. Then you will find entries.
There seem to be two entries for the "need more minerals" sound. One of those should be the right entry to edit. Just test it.
Aug 25, 2016Posted in: Data
Quote from DrSuperEvil: Go
The Alerts data type is what you want.
Unfortunately, this cannot be found in Alerts as it does not create an icon on the screen.
Some sound IDs like these are hard-coded into the engine and only use the race as its parameter.
The sound data entry you want to edit has the ID: e_cmdNotEnoughMinerals_Zerg
Its English name is "Alert_ZergNeedMoreMinerals" in the Sounds tab.
Aug 24, 2016Posted in: Data
There are multiple ways to do an AI, but the one that most people would like to do is editing the default AI directly.
The AI uses several script files found in the game's archives. You can access them via Window -> Console -> enter "browse" -> search for ".galaxy" and then just select them, right click and export.
There are several files and I believe it starts with "Computer.galaxy" and then includes other script files.
To override the AI, you would place edited files in your map/mod at the exact same location.
I've only tinkered with the AI a tiny bit a long time ago, but this is a proper way to do it.
Btw, in the data editor, you will find other kinds of AI scripts that alter micro of units as the AI scripts mostly only edit build orders and unit compositions.
Jun 22, 2016Posted in: General Chat
I did not like the story of the outro maps at all. Maybe that's why I like the fan-theory that Raynor was drunk in the bar and hallucinated potentially imagining everything.
The gameplay was good, but the story became quite ridiculous with Kerrigan becoming a Xel'Naga. I think, maybe I am just too old for happy endings or too corrupted by Game of Thrones. I imagine that it was the only ending that could tie up most loose ends in three maps and have a happy ending for James.
- To post a comment, please login or register a new account.