• 0

    posted a message on TWO 16 Slot Inventory, Always Open?

    @ckSynergy: Go

    O wow I tried to do something like that but I missed a few steps that you have generously provided. What I'm trying to do is create a spell bar and also having a working inventory. The reason for creating the always open inventory container was to all a person to pick up items that have abilities so it will feel like a command bar, but the reason I don't to use the command bar is because it has limited slots and I don't want the default commands (attack, move, patrol, ect.) being shown to the user.

    I think I'm just going to see how it goes creating a custom spell bar from dialogues then using the inventory for its original purpose.

    Posted in: UI Development
  • 0

    posted a message on TWO 16 Slot Inventory, Always Open?

    @ckSynergy: Go

    Oh the editor lets you make rows past 8? My editor only lets me create 8 max rows and 8 max columns, which is why I was doing it this way. I see, so even if I were to do this I wouldn't be able to create another container vertically on the right side. So maybe I'll tr creating a custom inventory powered by triggers and dialogue elements.

    Yea I tried:

    <Frame type='InventoryContainer' name='ContainerPanel00'>
    <!-- Stuff -->
    </Frame>
    <Frame type='InventoryContainer' name='ContainerPanel01'>
    <Anchor side="top" relative="$parent/ContainerPanel00" pos="Min" offset="500"/>
    <Anchor side="left" relative="$parent/ContainerPanel00" pos="Max" offset="0"/>
    <Anchor side='Bottom' pos='Max' relative='$this' offset='0'/>
    <Anchor side='Right' pos='Max' relative='$this' offset='0'/>
    </Frame>
    

    With no luck.

    Posted in: UI Development
  • 0

    posted a message on TWO 16 Slot Inventory, Always Open?

    Okay so I've been looking at many tutorials online on positioning inventories so that I could create a Wow-like interface. Right now I'm trying to create a bunch of inventory slots all around the sides of the screen, but I've only been reading tutorials on creating ONE always open inventory. For more slots I need to create an extra container that is always open and place it NEXT TO the other container. Now by default the second container is placed ABOVE the first.

    How would one position the second item container NEXT TO the first one?

    screeny

    The map I am working on... feel free to browse

    I'm using imported SC2layout files to position the inventory. Check them out in the map. Thank you for all your help! Especially the user "JPNyt"

    Posted in: UI Development
  • 0

    posted a message on Condition - region contains any unit

    How would I check in a condition that a region contains a unit.

    I mean a specific region containing ANY UNIT.

    also is there a way to react to the event: UI - Player Any Player clicks Left mouse button Down.

    so that you can do something like this: if player clicked on a unit do (1) else (2)

    Posted in: Triggers
  • 0

    posted a message on arrays in an event doesn't work

    Thank you very much Kueken!

    Problem completely solved now. I was able to remove the string reference and now the game works perfectly.

    Posted in: Galaxy Scripting
  • 0

    posted a message on arrays in an event doesn't work

    @Kueken531: Go

    I'm actually fairly new to SC2 editor so I'm not sure what "UnitRefFromUnit" function does.

    Actually I have new problems in my trigger on the lines of what you just stated. When I change the variable reference to a new unit, the trigger will fire upon the new unit's life changing and the old unit's unit bar will not update. I have no idea how to go about doing this now.

    How would I go about using "UnitRefFromUnit" instead?

    At the moment it seems that I will have to create a new variable for every player's hero, like so:

    UnitCreate(1, "Stalker2", 0, 1, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_player_1_hero = UnitLastCreated();
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_player_1_hero"), c_unitPropLife);
    UnitCreate(1, "Stalker2", 0, 2, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_player_2_hero = UnitLastCreated();
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_player_2_hero"), c_unitPropLife);
    UnitCreate(1, "Stalker2", 0, 3, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_player_3_hero = UnitLastCreated();
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_player_3_hero"), c_unitPropLife);
    UnitCreate(1, "Stalker2", 0, 4, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_player_4_hero = UnitLastCreated();
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_player_4_hero"), c_unitPropLife);
    

    if I use:

    lv_temp_1 = 1;
    while (lv_temp_1 <= 4) {
    UnitCreate(1, "Stalker2", 0, lv_temp_1, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_hero[lv_temp_1] = UnitLastCreated();
    gv_hero_temp = gv_hero[lv_temp_1];
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_hero_temp"), c_unitPropLife);
    lv_temp_1 = lv_temp_1 + 1;
    }
    

    then the trigger "gt_hb3" will only activate when the health of the last stalker created changes. I actually have not solved this at all yet.

    EDIT: Fixed it again!

    lv_temp_1 = 1;
    while (lv_temp_1 <= 4) {
    UnitCreate(1, "Stalker2", 0, lv_temp_1, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_hero[lv_temp_1] = UnitLastCreated();
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_hero[" + IntToString(lv_temp_1) + "]"), c_unitPropLife);
    lv_temp_1 = lv_temp_1 + 1;
    }
    

    It seems one can pass an array value. I just forgot to convert the integer into a string so the wrong key for the array kept getting passed. Yahoo!!

    Posted in: Galaxy Scripting
  • 0

    posted a message on arrays in an event doesn't work

    hello, I am using triggers for the most part but I have a custom script snippet in my code for the "TriggerAddEventUnitProperty" functionality.

    My script looks like this

    UnitCreate(1, "Stalker2", 0, 1, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_test[0] = UnitLastCreated();
    
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_test[0]"), c_unitPropLife);
    

    The "gt_hb3" trigger has only has one event: to say "hello world" in chat.

            UI - Display "hello world" for (All players) to Chat area
    

    The problem is that the trigger will activate when ANY UNIT changes health. Now the reason I come up with the assumption that arrays don't work is because when you use a regular variable in the add event function:

    UnitCreate(1, "Stalker2", 0, 1, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_test = UnitLastCreated();
    
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_test"), c_unitPropLife);
    

    Now the code works... I don't understand how to make arrays work in add even function.

    What I'm trying to do I'm trying to create a custom boss bar. I have a function that when called will create a boss bar user interface component on the screen. The function will also add an event (Unit property changes) to a trigger that updates the custom boss bar. The function creates a boss bar for any unit that contains health, shield, energy, experience, level, name, and portrait information which is why I don't just use the pre-made boss bar. This is more like a unit status bar.

    I would really like to use an array, but if all fails I guess I'll have to make many variables.

    Thank you for your help.

    BTW, the reason I need arrays is to create a unit bar for each player like so:

    lv_temp_1 = 1;
    while (lv_temp_1 <= 4) {
    UnitCreate(1, "Stalker2", 0, lv_temp_1, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_hero[lv_temp_1] = UnitLastCreated();
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_hero[lv_temp_1]"), c_unitPropLife);
    lv_temp_1 = lv_temp_1 + 1;
    }
    

    never-mind I fixed it immediately, I simply put the array value into a temporary variable and used that.

    here is the fix for the code in the very beginning:

    UnitCreate(1, "Stalker2", 0, 1, RegionRandomPoint(RegionFromId(1)), libNtve_gf_RandomAngle());
    gv_test[0] = UnitLastCreated();
    gv_tester = gv_test[0];
    
    TriggerAddEventUnitProperty(gt_hb3, UnitRefFromVariable("gv_tester"), c_unitPropLife);
    

    I hope this helps someone else.

    EDIT: THE SOLUTION I POSTED DOES NOT WORK, READ MY NEXT POST! I STILL NEED HELP.

    Posted in: Galaxy Scripting
  • 0

    posted a message on auto start on maps

    @tdhsst: Go

    You cant remove the countdown, but you can set it to 3 seconds at minimum. Go to Map -> Game Variants -> Add (bottom left) -> Game Attributes (top, middle tab) -> Lobby Delay -> (then adjust value in the dropdown box)

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