• 0

    posted a message on Listening to Hooked Custom Buttons, failing hard :(

    Update:

    Some hours later, after having saved and restarted the editor, my buttons have finally started working!

    After working with the UI section of the editor, I suspect there might be some delay/glitchyness to it when it comes to applying the changes to the In-game test document.

    Posted in: UI Development
  • 0

    posted a message on Listening to Hooked Custom Buttons, failing hard :(

    Hello Mappers,

    Today, I'm really hoping someone will be able to help me out! While working on the first dialog for my map, I have come across an obstacle which prevents me from being able to listen to my custom buttons (defined in XML Layout).

    The relevant details are as follows:

    • UI > HorizontalButton Layout XML:
        <Frame type="Button" name="Button">
          <AcceptsMouse val="true" />
          <Enabled val="True" />
          <ClickOnDown val="True" />
        </Frame>
        <Frame type="Button" name="HorizontalButton" template="CustomDialogTemplates/Button">
          <Toggleable val="True" />          
          <Width val="#HorizontalButtonSize" />
          <Height val="#MediumButtonSize" />
        </Frame>
        <Frame type="Button" name="ChoiceButton0" template="CustomDialogTemplates/HorizontalButton">
          <Text val="Test Button" />
        </Frame>
      
    • UI > ButtonHolderFrame Layout XML:
        <Frame type="Frame" name="ButtonHolderFrame">
          <Anchor side="Left" relative="$parent" pos="Min" offset="0" />
          <Anchor side="Top" relative="$parent" pos="Min" offset="0" />
          <Anchor side="Right" relative="$parent" pos="Max" offset="0" />
          <Height val="50" />
        </Frame>
      
    • Trigger > Voting Dialog Creation:
    Events:
    > Game - Map initialization
    Actions:
    > Dialog - Create a Modal dialog of size (800,750) at (0, 0) relative to Center of screen
    > Dialog - Hide the background image, and Show (Last created dialog)
    > Variable - Set votingDialog = (Last created dialog)
    > Dialog - Create a Panel for dialog votingDialog using the Template VotingDialog/VotingDialogPanel
    > Variable - Set votingDialogPanel = (Last created dialog item)
    • Trigger > Hooking up Voting Panel and Buttons:
    Actions (continuation):
    > Dialog - Hook up an existing Panel called VoteButtonsPanel in dialog item votingDialogPanel
    > Variable - Set voteButtonsPanel = (Last created dialog item)
    > General - For each integer i from 0 to 2 with increment 1, do (Actions)
    -> Actions
    ->> In Custom Script - Hook up an existing Button called "ChoiceButton" + IntToString(i) in dialog item voteButtonsPanel
    ->> In Custom Script - Set votingDialogOptionButtons[i] = (Last created dialog item)

    So far:

    1. First, the Modal dialog is created and saved in the variable votingDialog.
    2. Secondly, a Panel dialog item is created from template.
    3. This also creates all the dialogs/frames the template contains!
    4. This dialog item is then saved in votingDialogPanel.
    5. Then, the VoteButtonsPanel is hooked up to it's variable voteButtonsPanel, from the main votingDialogPanel.
    6. The voteButtonsPanel basically contains 3 ChoiceButtons (named ChoiceButton0, 1 and 2 respectively).
    7. From there on I can hook up the 3 ChoiceButtons and save them into the votingDialogOptionButtons array for later use.
    • Trigger > Voting Dialog Event Listener:
    Events:
    > Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
    Actions:
    > General - Switch (Actions) depending on (Used dialog item)
    -> Cases
    ->> If (votingDialogOptionButtons[0])
    ->>> etc..
    ->> If (votingDialogOptionButtons[1])
    ->>> etc..
    ->> If (votingDialogOptionButtons[2])
    ->>> etc..

    At last, the trigger which is supposed to handle the Dialog Events, but I'm not sure whether the hook ups went correctly, as execution doesn't seem to reach the Event Listener part.

    Main problem if it isn't clear:

    I can't get a Button created from XML Layout Template to properly Hook up with my Dialog Item variables, Seemingly leaving no option for me to interact much with Buttons created from a Template. No errors shown really.

    If anyone knows, how can you use a Panel with Buttons defined in SC2Layout together with your triggers? (The thing I'm trying to achieve here)

    Thanks (at least) for taking time to read this!

    (G2G fast, be back with more info later if needed)

    Greetz.

    Posted in: UI Development
  • 0

    posted a message on Help with Actor creation, Event Macro and Token references?

    Basically, I want one single Event Macro to handle the UnitBirth:Create of the Unit Actors I have for all my custom units.

    Using UnitBirth.unitName in the Event Macro does not make the Event Macro respond appropriately, when the Unit for an Unit Actor which has the Macro assigned to it spawns.

    I thought maybe it'd be possible to get the Event Macro to respond to UnitBirth Events for different units, but it seems this is not the case.

    Any help/info would be greatly appreciated!

    Thanks again.

    Posted in: Data
  • 0

    posted a message on Footstep Sounds in Water

    Hey, I'm only looking at possible options now, but this might help you a bit:

    You may need to use a Term for your Event, specifically the 'TerrainPhysicsMaterialAtActor' term sounds like it could be used for your purposes.

    EDIT:
    The 'TerrainPhysicsMaterialAtActor' term might not be of use to you after all.
    However, there's also the 'IsUnderwater' term!

    Posted in: Data
  • 0

    posted a message on Help with Actor creation, Event Macro and Token references?

    I have a bunch of Unit Actors which all have their own specific Actor Events each.

    However, these Unit Actors do not contain any of their

    UnitBirth.##unitName## -> Create
    

    messages, so they will not show up for their Units. (I forgot to initially add it)

    Now, since it is possible to make a reference to an Actor's token (using #unitName#, or #id#) I thought it might be a good idea to create an Event Macro containing the aforementioned Actor Creation message (using the #unitName# reference) in the hope that it will be able to get the appropriate 'unitName' value for each of the Actors which the Event Macro would be added to.

    The amount of Actors I have makes it hard for me to consider: copy/pasting & making adjustments in the Events dialog for each single one of them. A lot of repetitive work, and this would be just to get my Actors to show up.

    In this case, it seems as if it's -almost- possible, to just use a single Event Macro which can make sure that any of its Host Actors will be created whenever the Unit is born.

    This also makes me wonder whether there are more references or tags that can be used. So far it seems we can refer to tokens by using the '#tokenId#' 2 hashtags around a Token's ID.

    Note: The references I wrote about are sometimes seen in default values for existing units, they are only insertable in 'View Raw Data' mode.

    Note2: Where there is a single '#' (hashtag), there's supposed to be 2 of them, this forum just won't show all of them.

    Thanks for your time!

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