I've yet to post here, so I suppose a hello is in order... Hello!
I generally try to answer my own questions, regardless of how long they may take to answer, but as I near completion on the map I am currently working on, two unanswered questions are starting to become gaping maws of wasted time, so I thought I might appeal here in hopes that someone else has the answers readily available, and I've merely missed the obvious.
Question 1: Is there a way to allow Campaign-Style difficulty selection for the player?
(Apologies as this isn't specifically a trigger question, and I suppose it could have/should have gone in the miscellaneous section.) I'm creating a single-player campaign, I realize there appears to be very little support for this sort of thing as far as custom maps go. (The custom game-type does not seem to be set up for this.) Anyways, if I publish the map there is no way on Battle.net (as far as I can tell) to chose between difficulty settings.
Additionally, dragging and dropping the file onto SC2.exe seems to result in the "Normal" difficulty mode regardless of the editor's test document default difficulty setting.
It seems impossible that there would be amazingly helpful built in functionality for supporting the 4 campaign difficulties, (Such as View>Difficulty) and yet no way to use them in a map. And I'd like to avoid building a dialog item into the map to chose difficulties, as I'd have to add and remove a whole lot of units via triggers, which is cumbersome.
If there is no built in support to allow campaign-style difficulty settings for maps, is anyone aware of any triggers that can be used to switch between unit layouts that were set for difficulties, or re-initialize the map at a different difficulty setting?
Question 2: What's up with dialog items?
Okay, so this question is a two parter. Firstly, I've created for example a modal dialog with dimensions 530x115 and then inside of that created dialog image item with the same dimensions with an end-cap style image (I'd love to have simply applied that end-cap style image to the modal dialog, but I couldn't seem to figure out a way to tell the modal dialog that the image I was applying was an end-cap) and the resulting image that appears is of completely different dimensions.
Manually checking it turned out to be something more like 425x88. This is a strange problem and I wish I could provide more information, but I've isolated the triggers and this always happens, so it couldn't be anything but this. If it helps I was using the achievement frame end-caps.
The second part about dialog items is, I'm curious, how do they scale? This question is more like, since dialog items all take set pixel dimensions, does that mean I have to make things small enough to run on the lowest possible resolution, because I can't set them to be a %? For instance, if I wanted to recreate the campaign victory screen, all of the assets are there, and although painful to do, it could be faithfully re-created. But the official campaign end screen scales to your resolution, can I achieve this with a custom created dialog?
You can do this via attributes. For a single player map, add it to game attributes (Or just make it shown if it's already there but hidden). For multiplayer you can add it for player attributes for voting. Then all you do is create a trigger that (If you used the player attribute) decides what difficulty won in the vote, and then setting difficulty to whatever was decided (Although you could use a variable because difficulty is basically a variable). Then all you do is refer to the difficulty every time you need to :).
Could you upload your map? I'm not entirely sure what you are trying to do and what the problem is :/.
Ah, thanks this attributes thing is interesting, I hadn't seen it before, though after exploring it a bit I don't think it really answers the root of my question, though I suppose this is the best way to do it if it turns out what I would like to do is impossible.
I realize that difficulty is in fact a variable, that being said, if you change that variable, it doesn't change unit placement. For instance, if I suddenly change the difficulty to Brutal, units marked as "Brutal only (not word for word)" in their properties, will not suddenly appear. If I use the attributes editor to set the difficulty though, are you saying that because the variable is changed before the map is loaded (or rather, the map is initialized with that variable) that the unit placement will be proper? If so, thanks so much, I will look into implementing this solution immediately!
Regarding the second question, uploading my map would be a totally overkill for answering this question, because it's a full level, so in order to skip unnecessary time and data, I'll just try to paste the evil triggers in question, if that doesn't work though, I'll rip the achievement library I'm trying to create out to an empty map and upload it.
Trigger - Turn (Current trigger) Off
Dialog - Create a Modal dialog of size (530, 115) at (0, 0) relative to Center of screen
Variable - Set Zerg BBQ AcheievementDialog = (Last created dialog)
Dialog - Create an image for dialog Zerg BBQ AcheievementDialog with the dimensions (530, 115) anchored to Center with an offset of (0, 0) setting the tooltip to "" using the image Assets\Textures\ui_achievement_metalframe.dds as a EndCap type with tiled set to false tint color White and blend mode Normal
Dialog - Create an image for dialog Zerg BBQ AcheievementDialog with the dimensions (67, 66) anchored to Left with an offset of (25, 0) setting the tooltip to "" using the image Assets\Textures\btn-unit-zerg-zergling.dds as a Normal type with tiled set to true tint color White and blend mode Normal
Dialog - Create a label for dialog Zerg BBQ AcheievementDialog with the dimensions (200, 15) anchored to Top Left with an offset of (115, 25) with the text "Zerg BBQ" color set to White text writeout set to false with a writeout duration of 2.0
Dialog - Create a label for dialog Zerg BBQ AcheievementDialog with the dimensions (300, 50) anchored to Top Left with an offset of (115, 50) with the text "Kill 10 enemy units in the "Wastela..." color set to White text writeout set to false with a writeout duration of 2.0
Dialog - Show Zerg BBQ AcheievementDialog for (All players)
What this should essentially make is an achievement (more or less) using the dimensions achievements appear to be at least on my screen resolution, what ends up happening instead is this...
As you can see, these are definitely not the dimensions specified.
I had also sort of squeezed a more general question into the end, which had nothing to do with this specific problem, and I'm just curious how scaling of dialogs work. Like, if I wanted to reproduce the campaign mission end screen, is that even possible, considering that screen scales to the player's resolution, do dialog items accept %s and is screen resolution a variable we can access?
Ah, I think i get it now. Blizzard uses some weird resolution so 100x100 may actually be 70x70 or so. Play around with it until you find a good look to it.
Also iirc, blizzard uses triggers in their campaign maps for difficulty. Eg, If difficulty = brutal, create siege breaker at point X, if hard, create siege tank at point X, else do nothing.
Hmm, so their resolutions are converted? Does anyone have the exact conversion, or is there any unofficial documentation on this? I suppose guess and check would work, but I try to avoid that, if I set up the item in photoshop, I'd prefer the fewest number of steps between that and inputting data into the editor.
Triggers are used in conjunction with a map based difficulty setting in their campaign maps. Units that are placed ahead of time (base structures, defenses etc) (or in the case of no-base levels, almost all units) are determined by that difficulty setting. Basically, click properties on a unit, you can alter a check box for whether a unit is present on a difficulty setting or not, and how often the AI rebuilds it, etc.
In the case of attack waves that are created later on, or triggered events where units are created, they use triggers to find the player's difficulty level, then spawn the proper amount. I have no issues with this method, but I can't seem to figure out how to select the difficulty ahead of time so that the map loads with the proper difficulty.
If you go into your editor settings, and under test document select the difficulty setting, (choosing between casual, normal, hard and brutal) that works fine with custom maps, but once it's exported, how to let the end user decide is my issue.
It's disheartening that this person didn't seem to find a good answer. To clarify, I am aware and only attempting to use the 4 default blizzard campaign scenario difficulties (not 6 difficulties) so it looks like it's impossible, despite the functionality being built into the editor? It seems almost impossible that they would build a button two levels deep... View> Show Difficulty (and even default include a hot key for it) AND build it into the test document menu, and yet not have any functionality for it with finished levels.
I'm really hoping someone has the answer to this, and I will be eternally grateful!
About the difficulty: the way blizzard does it for their campaign is that they have a central map (called "TStory01", all the cinematics and hyperion stuff happens in it) that launches the proper missions. It works like this:
Set Next Map
Set Next Mission Difficulty
End Game For Player
*the proper missions map launches with the specified difficulty*
*when the proper mission ends, the launcher map gets loaded again, cutscenes play, etc etc*
We can only do this stuff offline (drag map onto exe file, etc). There's no way to specify the difficulty level for a human player in the battle.net lobby (but you can do it for a computer player... oh joy...).
You can change the difficulty right after map initialization, but that will not work for pre-placed units that have that "spawn at this and that difficulty" option set.
Best thing to do is place points instead of units and then spawn according to difficulty with triggers.
Thanks, though it's bad news, I suppose it's better to know.
A small question about running a map with the SC2.exe (dragging it onto the icon, etc) directly, how do you get this to affect difficulty? My editor difficulty is set to brutal, but maps I run via the .exe run as Normal.
I may just hold out distributing any maps on battle net (if I can somehow manage to use the difficulty option through the .exe), and hope they eventually make due on their promises to provide better custom campaign support.
Addendum would be, does set next map and set mission difficulty work for custom maps? If so, I'm considering creating a hub level, or simply allowing the player when they play a map to change the difficulty at the start, then reload the map, and store that difficulty and pass it on to the next map and so on.
There is a way to specify a human player's difficulty, as I said in my first post. However, you also need a trigger to change the difficulty on map init.
Dragging onto the exe will always set it to normal, that's the default. You can create a shortcut to sc2.exe and run it with these command line parameters:
Nice way of giving people a direct link to the map, instead of telling them to drag it onto the icon.
Change difficulty to what you want (2 is Normal). Place MapYouWantToLoad.SC2Map in the Maps folder in your SC2 install dir (not the My Documents SC2 folder).
Set Next Map and Difficulty only work for offline maps. No custom campaigns (or any kind of transitions to other maps) allowed on battle.net :<
For Set Next Map, place the map file in the Maps folder, like above.
Yes, the method with the attribute and triggers does change the difficulty, but it's still set to the default Normal during the period when the map is loading pre-placed units. Trigger init and the change of difficulty happens after that, so the units with "spawn me only on hard difficulty" property will never show up.
The .exe thing was super helpful, at least now I can get it out amongst friends for difficulty/playability testing. Curious, is there a way to set gamespeed via command line?
About the dialog sizes, the thing there is that dialogs have a different width and height based on the aspect ratios of the resolution specified in game.
The right man on the subject would be desiderius1, as he found out after some research. He also made a "getResolution" library (which is perhaps not the best one, yet the only way at the moment to figrue out so that dialogs are kept at a constant proportion relatively the game window) which proves a tech of how it can be figured out.
setting the image to normal and it being a .dds usually makes it stretch to fit the size you specify. But each image type, endcap and normal and what not has a different formatting for the actual image... an example is for normal .dds, you have two copies of the image one above the other. The top will be used when the mouse hovers over the button and the bottom will be used without mouse hover.
its all about image formating. In an editor like gimp turn on your gride then you can usually see what the format is.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've yet to post here, so I suppose a hello is in order... Hello!
I generally try to answer my own questions, regardless of how long they may take to answer, but as I near completion on the map I am currently working on, two unanswered questions are starting to become gaping maws of wasted time, so I thought I might appeal here in hopes that someone else has the answers readily available, and I've merely missed the obvious.
Question 1: Is there a way to allow Campaign-Style difficulty selection for the player?
(Apologies as this isn't specifically a trigger question, and I suppose it could have/should have gone in the miscellaneous section.) I'm creating a single-player campaign, I realize there appears to be very little support for this sort of thing as far as custom maps go. (The custom game-type does not seem to be set up for this.) Anyways, if I publish the map there is no way on Battle.net (as far as I can tell) to chose between difficulty settings.
Additionally, dragging and dropping the file onto SC2.exe seems to result in the "Normal" difficulty mode regardless of the editor's test document default difficulty setting.
It seems impossible that there would be amazingly helpful built in functionality for supporting the 4 campaign difficulties, (Such as View>Difficulty) and yet no way to use them in a map. And I'd like to avoid building a dialog item into the map to chose difficulties, as I'd have to add and remove a whole lot of units via triggers, which is cumbersome.
If there is no built in support to allow campaign-style difficulty settings for maps, is anyone aware of any triggers that can be used to switch between unit layouts that were set for difficulties, or re-initialize the map at a different difficulty setting?
Question 2: What's up with dialog items?
Okay, so this question is a two parter. Firstly, I've created for example a modal dialog with dimensions 530x115 and then inside of that created dialog image item with the same dimensions with an end-cap style image (I'd love to have simply applied that end-cap style image to the modal dialog, but I couldn't seem to figure out a way to tell the modal dialog that the image I was applying was an end-cap) and the resulting image that appears is of completely different dimensions.
Manually checking it turned out to be something more like 425x88. This is a strange problem and I wish I could provide more information, but I've isolated the triggers and this always happens, so it couldn't be anything but this. If it helps I was using the achievement frame end-caps.
The second part about dialog items is, I'm curious, how do they scale? This question is more like, since dialog items all take set pixel dimensions, does that mean I have to make things small enough to run on the lowest possible resolution, because I can't set them to be a %? For instance, if I wanted to recreate the campaign victory screen, all of the assets are there, and although painful to do, it could be faithfully re-created. But the official campaign end screen scales to your resolution, can I achieve this with a custom created dialog?
Ah, thanks this attributes thing is interesting, I hadn't seen it before, though after exploring it a bit I don't think it really answers the root of my question, though I suppose this is the best way to do it if it turns out what I would like to do is impossible.
I realize that difficulty is in fact a variable, that being said, if you change that variable, it doesn't change unit placement. For instance, if I suddenly change the difficulty to Brutal, units marked as "Brutal only (not word for word)" in their properties, will not suddenly appear. If I use the attributes editor to set the difficulty though, are you saying that because the variable is changed before the map is loaded (or rather, the map is initialized with that variable) that the unit placement will be proper? If so, thanks so much, I will look into implementing this solution immediately!
Regarding the second question, uploading my map would be a totally overkill for answering this question, because it's a full level, so in order to skip unnecessary time and data, I'll just try to paste the evil triggers in question, if that doesn't work though, I'll rip the achievement library I'm trying to create out to an empty map and upload it.
What this should essentially make is an achievement (more or less) using the dimensions achievements appear to be at least on my screen resolution, what ends up happening instead is this...
As you can see, these are definitely not the dimensions specified.
I had also sort of squeezed a more general question into the end, which had nothing to do with this specific problem, and I'm just curious how scaling of dialogs work. Like, if I wanted to reproduce the campaign mission end screen, is that even possible, considering that screen scales to the player's resolution, do dialog items accept %s and is screen resolution a variable we can access?
Ah, I think i get it now. Blizzard uses some weird resolution so 100x100 may actually be 70x70 or so. Play around with it until you find a good look to it.
Also iirc, blizzard uses triggers in their campaign maps for difficulty. Eg, If difficulty = brutal, create siege breaker at point X, if hard, create siege tank at point X, else do nothing.
As for scaling etc, I have no idea :/.
@wOlfLisK: Go
Hmm, so their resolutions are converted? Does anyone have the exact conversion, or is there any unofficial documentation on this? I suppose guess and check would work, but I try to avoid that, if I set up the item in photoshop, I'd prefer the fewest number of steps between that and inputting data into the editor.
Triggers are used in conjunction with a map based difficulty setting in their campaign maps. Units that are placed ahead of time (base structures, defenses etc) (or in the case of no-base levels, almost all units) are determined by that difficulty setting. Basically, click properties on a unit, you can alter a check box for whether a unit is present on a difficulty setting or not, and how often the AI rebuilds it, etc.
In the case of attack waves that are created later on, or triggered events where units are created, they use triggers to find the player's difficulty level, then spawn the proper amount. I have no issues with this method, but I can't seem to figure out how to select the difficulty ahead of time so that the map loads with the proper difficulty.
If you go into your editor settings, and under test document select the difficulty setting, (choosing between casual, normal, hard and brutal) that works fine with custom maps, but once it's exported, how to let the end user decide is my issue.
Edit: I actually seem to have found an old post with my question about difficulty more or less... http://forums.sc2mapster.com/development/map-development/15982-solved-game-difficulty-in-the-lobby/
It's disheartening that this person didn't seem to find a good answer. To clarify, I am aware and only attempting to use the 4 default blizzard campaign scenario difficulties (not 6 difficulties) so it looks like it's impossible, despite the functionality being built into the editor? It seems almost impossible that they would build a button two levels deep... View> Show Difficulty (and even default include a hot key for it) AND build it into the test document menu, and yet not have any functionality for it with finished levels.
I'm really hoping someone has the answer to this, and I will be eternally grateful!
About the difficulty: the way blizzard does it for their campaign is that they have a central map (called "TStory01", all the cinematics and hyperion stuff happens in it) that launches the proper missions. It works like this:
We can only do this stuff offline (drag map onto exe file, etc). There's no way to specify the difficulty level for a human player in the battle.net lobby (but you can do it for a computer player... oh joy...).
You can change the difficulty right after map initialization, but that will not work for pre-placed units that have that "spawn at this and that difficulty" option set. Best thing to do is place points instead of units and then spawn according to difficulty with triggers.
@Tolkfan: Go
Thanks, though it's bad news, I suppose it's better to know.
A small question about running a map with the SC2.exe (dragging it onto the icon, etc) directly, how do you get this to affect difficulty? My editor difficulty is set to brutal, but maps I run via the .exe run as Normal.
I may just hold out distributing any maps on battle net (if I can somehow manage to use the difficulty option through the .exe), and hope they eventually make due on their promises to provide better custom campaign support.
Addendum would be, does set next map and set mission difficulty work for custom maps? If so, I'm considering creating a hub level, or simply allowing the player when they play a map to change the difficulty at the start, then reload the map, and store that difficulty and pass it on to the next map and so on.
@Tolkfan: Go
There is a way to specify a human player's difficulty, as I said in my first post. However, you also need a trigger to change the difficulty on map init.
@designerdougm: Go
Dragging onto the exe will always set it to normal, that's the default. You can create a shortcut to sc2.exe and run it with these command line parameters:
Nice way of giving people a direct link to the map, instead of telling them to drag it onto the icon.
Change difficulty to what you want (2 is Normal). Place MapYouWantToLoad.SC2Map in the Maps folder in your SC2 install dir (not the My Documents SC2 folder).
Set Next Map and Difficulty only work for offline maps. No custom campaigns (or any kind of transitions to other maps) allowed on battle.net :<
For Set Next Map, place the map file in the Maps folder, like above.
@wOlfLisK: Go
Yes, the method with the attribute and triggers does change the difficulty, but it's still set to the default Normal during the period when the map is loading pre-placed units. Trigger init and the change of difficulty happens after that, so the units with "spawn me only on hard difficulty" property will never show up.
@Tolkfan: Go
The .exe thing was super helpful, at least now I can get it out amongst friends for difficulty/playability testing. Curious, is there a way to set gamespeed via command line?
@designerdougm: Go
-speed 4
0 - slower, 4 - faster
All these params are displayed when sc2.exe crashes while being run by the editor:
About the dialog sizes, the thing there is that dialogs have a different width and height based on the aspect ratios of the resolution specified in game.
The right man on the subject would be desiderius1, as he found out after some research. He also made a "getResolution" library (which is perhaps not the best one, yet the only way at the moment to figrue out so that dialogs are kept at a constant proportion relatively the game window) which proves a tech of how it can be figured out.
http://forums.sc2mapster.com/development/triggers/16341-what-is-the-foruma-for-finding-ui-coordinates/#p3 http://forums.sc2mapster.com/resources/trigger-libraries/17101-library-get-resolution/
setting the image to normal and it being a .dds usually makes it stretch to fit the size you specify. But each image type, endcap and normal and what not has a different formatting for the actual image... an example is for normal .dds, you have two copies of the image one above the other. The top will be used when the mouse hovers over the button and the bottom will be used without mouse hover.
its all about image formating. In an editor like gimp turn on your gride then you can usually see what the format is.