• 0

    posted a message on Dialog Pulldown Selection Not Appearing

    odd.

    Have you tried creating one from scratch?

    ie. create a new map and in the initialization trigger create a dialog and pulldown menu. add a few options and test it.

    If that doesn't work then it sounds like a bug and you should report it to blizzard

    Posted in: Triggers
  • 0

    posted a message on Custom UI Panel Button... thingy

    @soulzek:

    What you want to look into are SC2Layout files. They let you hide/customize/use the default UI in the game. But it looks like a PITA from what little I know of it.

    Been avoiding implementing it but I'm going to have to face it eventually for a map I'm currently working on.

    EDIT: I forgot to mention, this forum section on sc2mapster is dedicated to that kind of stuff http://www.sc2mapster.com/forums/development/gui/

    Posted in: Triggers
  • 0

    posted a message on Play sound for owner of dying unit

    @Ownag3666:

    http://i.imgur.com/X7V8q.jpg

    created an example trigger in a map I am working on.

    Posted in: Triggers
  • 0

    posted a message on How to replace a building with a building?

    in the trigger GUI there is a commands that return the X and Y coordinates from a point.

    And also it could very well be due to the footprint of the first building.

    The "create unit" function has some options at the end of it. click on the options and select "ignore placement". Otherwise it will offset the unit created. I'm willing to bet that will solve your problem.

    In future though, if you come across a problem like this you need to isolate WHAT the problem ACTUALLY is.

    for example you were having a problem with the line "if i (Create [building] on (Unit position([another building])))" but that is actually TWO things:
    1) getting the location of an existing building and
    2) creating a new building at a specific location

    The very first thing you should be doing with a problem like this is isolating what the problem actually is like in the suggested post I made above.

    Posted in: Triggers
  • 0

    posted a message on How to replace a building with a building?

    I'm guessing you made a mistake somewhere. If you want help on how to go about debuging this I would try the following:

    variable P <point>;

    set variable P = position of [other building];

    debug(text(X of P));
    debug(text(Y of P));

    create [building] at position P;

    does the debug statement match what it should be? can you check the position of the unit in the map editor?

    Posted in: Triggers
  • 0

    posted a message on Play sound for owner of dying unit

    condition should be "unit (triggering unit) has structure attribute == false"

    "Play sound(sound) for (Triggering Player)"
    triggering player returns a player, but the function expects a player group.

    "Play sound(sound) for (convert player to player group(Triggering Player))"
    ^ this should work

    Posted in: Triggers
  • 0

    posted a message on Play sound for owner of dying unit

    I couldn't be bothered creating the trigger in multiple stages and uploading pictures of it. Sorry, I'm a very lazy person :(

    where do you get stuck? Is it changing the "all players" option? click on "all players", then select "function" and there is the option "convert player to player group"

    EDIT: maybe lazy is not the right word. Just very slooooooowwwwww like my namesake

    Posted in: Triggers
  • 0

    posted a message on Play sound for owner of dying unit

    What you want is the function "convert player to player group" and provide it with the player you want.

    If you don't know which player owns the unit I'm guessing you have a trigger like "unit dies" in which case the function "owner of unit()" should give you the owner of a unit and "triggering unit" should give you the unit that died.

    hope this helps.

    also

    the function "unit type attribute check" can give you that kind of information. Use the function "unit type of unit" on the triggering unit to get the unit type. You will end up with "(unit type of (triggering unit)) has attribute structure == false" as a conditional statement.

    EDIT: also Bronies are awesome!

    Posted in: Triggers
  • 0

    posted a message on List box with checkboxes

    Quote from SouLCarveRR:
    @farban6: Go

    hmmm you might check to see if anybody made a library that could make a more advanced system of a list box

    I know if i really wanted to I could create a dialog that has panels in it that act like list items.

    You would have to code the scrolling and the way it keeps track of all the items but it is doable.

    If i get some motivation I might attempt it myself.
    ----

    AFAIK there are such libraries. However there is no way to detect mouse wheel scrolling and no good way to detect dragging an item around the screen. You could use a scroll bar which is one of the dialog item types however it only scrools horizontally, not vertically so it would be really wierd to use.

    EDIT: the "rotate dialog item" does not work when used on the inbuilt scroll bar either

    Posted in: Triggers
  • 0

    posted a message on List box with checkboxes

    Quote from zeldarules28:
    There's no way to put check boxes inside a list box.

    This is correct. I didn't think you meant that you were using a "list" dialog item. I figured you were doing something like this:

    item 1      [ ]
    item 2      [ ]
    item 3      [ ]
    item 4      [ ]

    where each item is a label and has a checkbox placed beside it.

    I cannot think of any *simple* ways to acheive something similar using a list dialog item.

    One thing you could do would be to detect a player selecting a list item and put an asterisk next to that item. Then when a player clicks the "delete" button the highlighted items in the list are removed.

    or a player clicks the "delete" button and then whenever he selects a list item that item is removed.

    gl

    Posted in: Triggers
  • 0

    posted a message on Random button on dialog

    huh?

    I'm not sure what the question is.

    do you want to create a button with a random icon? Do you want advice about how you should link a unit and a button so that the button affects the unit?

    Posted in: Triggers
  • 0

    posted a message on List box with checkboxes

    @farban6:

    no need to keep track of when players select check boxes.

    Just a trigger for when they click the remove button. Inside this trigger you can see which check boxes are ticked or not. (There is a function something like "dialog item is checked" which will do this for you)

    As for how to link check box with list item have an array of checkboxes and an array of items in your list. check which checkboxes are checked, erase corresponding list items and then recreate the dialog display.

    Posted in: Triggers
  • 0

    posted a message on [New Small Question] Code Elegance Question

    if you have a 3v3 game and run the code:

    PlayerCount = 4
    debug(text(PlayerCount))

    for each player PlayerCount on team 1
    {
        debug(text(PlayerCount))
    }

    debug(text(PlayerCount))

    Then I think the output should be 4, 1, 2, 3, 3

    If you run it on team 2 the output should be 4, 4, 5, 6, 6

    But you should check this for yourself cause I am not 100% on the above. Experiment with having multiple players and teams and give it a shot.
    by "text( )" There is a function for turning an integer into a text which you can then print out using the "debug( )" function.

    Posted in: Triggers
  • 0

    posted a message on [New Small Question] Code Elegance Question

    Quote from FoxyMayhem:
    Thanks man, that helped me understand. So any variable will work for "for each player", right? Is the variable modified by the end of the loop?
    ----

    Yes. You can use any variable of type integer. Each time the loop runs the integer listed as the "player" at the start of the loop will be set to a different player in that group.

    Quote from SouLCarveRR:
    It increments it at the end of the loop.
    ----

    This means the same thing.

    Posted in: Triggers
  • 0

    posted a message on [New Small Question] Code Elegance Question

    Oh, and I read the article you linked.

    Good stuff. Hopefully you get to realize your idea :)

    I too have an awesome idea for a game... But I think to do it justice would require a lot more skill than I am able to bring to the table as well as a much bigger budget lol.

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