• 0

    posted a message on Trigger works in custom map but not as a mod

    In reply to Forge_User_77061351:

     

    I believed that the mineral fields and vespene geyser units are preplaced in your map, and any preplaced units/resources do not work in mods.

     

    To get the resources units in your mod, you might need to change the trigger to the following:-

     

    Event: Unit Enters Region (Any Unit Enters Entire Map)

    Condition: Unit Type Of (Triggering Unit) == Minerals (Resources)

    Actions: Add Unit to Unit Group -> Add (Triggering Unit) to grpMinerals

                 : Pick Each Unit In grpMinerals

                   Set (Picked Unit) Resources to "whatever amount you desire".

     

    Do the same for the vespene geyser resources:-

     

    Event: Unit Enters Region (Any Unit Enters Entire Map)

    Condition: Unit Type Of (Triggering Unit) == Vespene Geyser (Resources)

    Actions: Add Unit to Unit Group -> Add (Triggering Unit) to grpVespene

                 : Pick Each Unit In grpVespene

                   Set (Picked Unit) Resources to "whatever amount you desire".

     

    I hope that explains. Either that or you have hit a maximum as described by Imposter.

     

    Also, did you enable triggers for your mod?

     

     

                 

    Posted in: Triggers
  • 0

    posted a message on [Solved] Stunned units triggers Unit dies event in trigger [Help]

    In reply to kmsk9:

     

    Let's see the other trigger of your stun ability. I'am assuming that when the unit uses the ability, you have a text displayed showing the said message.

     

    Either that, or it has to do with your enemy being player 2, where you set the condition for triggering player.

    Posted in: Triggers
  • 0

    posted a message on [Solved] Unit from Unit Group Create Function Issue When The Specific Unit Dies

    Edit : [Solved]. Don't actually require special functions to modify count each time the Strike Fighter Platform or Bomber Unit dies.

     

    I solved it by using a pseudo-code. The following:-

     

    1. Create a dummy effect when the Platform (Specific Unit) dies. Then under Unit:Effect-Death of the Platform, link this dummy effect to it. So, the function Triggering Effect Unit (Caster) will refer to the unit caster (hereby the Platform).

     

    2. Create a condition if-then-else for the dummy effect. Here, you put in a pseudo-condition, that is Distance between points (The point for position of (Triggering Effect Unit(Caster)) and position of Closest Unit at Point (Closest Unit for position of (Triggering Effect Unit(Caster)) in Bomber Unit group) < 1.0  Why distance between position of units <1.0 is because the offset point for X = +0.26 and the offset point for Y = -0.26 (X of Point and Y of Point for the created Bomber Unit on top of the Platform Unit). Therefore, the distance measured by the square root of 0.26^2 + 0.26^2 = 0.3677 (Which is less than 1.0). Also, note that the Z of point is not taken into account for the measured distance.

     

    3. Hence, create a local/global variable and set the variable to Closest Unit at Point (Closest Unit for position of (Triggering Effect Unit(Caster)) in Bomber Unit group). This will then reference the closest unit in the Bomber Unit Group to the specific Platform Unit with distance in between them of less than 1.0.

     

    4. Continue with the trigger actions whether you want to kill the Bomber Unit (Unit Variable set in Point 3) when the specific Platform Unit dies. You can also order the Bomber Unit to Precision-Strike a target by creating a dummy effect for the said ability and creating an Issue Order action for the said Bomber Unit.

     

    Thanks. Cheers.

     

     

     

     

    Posted in: Triggers
  • 0

    posted a message on [Solved] Unit from Unit Group Create Function Issue When The Specific Unit Dies

    In reply to DrSuperEvil:

    This ability create the units directly, but however, I want to integrate them with triggers to create Strike Fighters on top of the Strike Platforms. Hence, I need to mark each Strike Platforms by firstly adding them to a unit group, then using variable arrays to mark each units from the group.

     

    I have been thinking about some Unit Indexing library as well but I think it might not be required as there are only 10 units limit to the arrays. Thanks.

    Posted in: Triggers
  • 0

    posted a message on [Solved] Unit from Unit Group Create Function Issue When The Specific Unit Dies
    Quote from DrSuperEvil >>

    I would just use a Unit variable array. Have on unit creation a Set Variable action to set the array for the integer to the last crated unit and than add +1 to the local integer variable used for the index of the unit variable. 

    Thanks for the feedback. However, the function - last created unit can only mark units created through triggers. The units mentioned - HH-Strike Fighter Platform are created through ability data - HH-SCV Build. I figured out that either I mark the sequence of units created through setting up a variable array which marks the Effect History count of the Unit Effect or a variable array which marks the units from unit group. Either way.
    At the same time, are you aware of any tutorials that will guide us on how to use the Effect - History Entry/Count via triggers? Thanks again.
    Posted in: Triggers
  • 0

    posted a message on [Solved] Unit from Unit Group Create Function Issue When The Specific Unit Dies
    Quote from MaskedImposter >>

    Yea, I'm not sure what you're using this for either...

     

    a Function where when a Unit from Unit Group dies

     

    You can use the condition "Unit in unit group" for this. If using the unit dies event, the condition will look like this

     

            ((Triggering unit) is in Strike platform group) == True
    

     

     Thanks for the reply. Just wondering if there is an Event - Unit From Unit Group Dies. Then I might just state a condition - Unit 1 from Unit Group == (Triggering Unit). This will then eliminate the need for a function or action definition. 
    EDIT : Never mind then, I can still use the Event - Any Unit dies, and state the condition - (Triggering Unit) == Unit 1 from Unit Group.
    Posted in: Triggers
  • 0

    posted a message on [Solved] Unit from Unit Group Create Function Issue When The Specific Unit Dies
    Quote from DrSuperEvil >>

    What are you trying to use this function for? If you want a unit to have a specific value then would not using an unit variable array be better?

    Thanks for the reply. I'am trying to mark the first unit created, second unit created, and so on for HH-Strike Fighter Platform. Is there any other way to mark the unit in order/sequence it was created (first unit, second unit, etc.) other than the function - Unit from Unit Group?
    The Unit from Unit Group function perform exactly the sequence/order when the unit was created in a group in the form of Index. However, when a unit from the unit group dies, the Unit - Index will be replaced by subsequent Index, say - Unit 4 from Unit Group dies, Unit 4 will then be replaced by Unit 5, Unit 5 from Unit Group will be replaced by Unit 6, and so on in a subsequent order. In other words, I need to reset the Units in the group back to sequence/order they were created when a unit in the said group dies.
     
    Posted in: Triggers
  • 0

    posted a message on [Solved] Unit from Unit Group Create Function Issue When The Specific Unit Dies

    Hi guys,

     

    Just want to check out on creating a Function where when a Unit from Unit Group dies, the said Function will reset Units in the said Unit Group. Just to paint the picture:-

     

    Say for example,

    Set Variable - Strike Platform(1) == Unit 1 from Unit Group (Strike Platform Group)

                          - Strike Platform(2) == Unit 2 from Strike Platform Group

                          - Strike Platform(3) == Unit 3 from Strike Platform Group, and so on.

     

    The Issue here being when Unit dies or being removed, say, Unit 1 from Strike Platform Group. Unit 2 from Strike Platform Group will then be indexed as Unit 1 from Unit Group, Unit 3 will then become Unit 2 from Unit Group, and so on. The Unit Indexing is such a way that the first unit created in unit group will be Unit 1 from Unit Group, the second unit as Unit 2 from Unit Group and so on. 

     

    The Logic here being if Unit 1 from Unit Group dies,

    Then, Strike Platform(2) == Unit (2 - 1) from Strike Platform Group

               Strike Platform(3) == Unit (3 - 1) from Strike Platform Group

               Strike Platform(10) == Unit (10-1) from Strike Platform Group

    Say that a Variable - (Index) represents each Integer for Strike Platform,

    Hence,

               For Each Integer (Index) from 1 to 10 with Increment 1,

                     Set Strike Platform(Index) == Unit (Index-1) from Strike Platform Group

     

    The issue/problem arises when say, Unit 4 from Unit Group dies,

    Then, Strike Platform(1) == Unit 1 from Strike Platform Group,  not Unit (1 - 1) from Strike Platform Group

               Strike Platform(2) == Unit 2 from Strike Platform Group,  not Unit (2 - 1) from Strike Platform Group

               Strike Platform(3) == Unit 3 from Strike Platform Group,  not Unit (3 - 1) from Strike Platform Group

     

    How do I then create the function then?

     

    Or do I state a condition which states Unit Is Alive != Unit 1 from Unit Group,

     

    Then, it will be a very long list of Function till -> Unit Is Alive != Unit 10 from Unit Group.

     

    I probably need someone who is well-versed with Functions to clarify this. Thanks.

     

     

     

    Posted in: Triggers
  • 0.955092221331195

    posted a message on A number of questions about Trigger related issues

    In reply to sc2ggamer:

    Unit Is Created can also be used for when you specify the action - Create Units in your trigger. This means any action - Create Units that you have created in separate triggers or actions, you can specify that unit using the Trigger event - Unit Is Created, by adding a condition - Created Unit == The Unit that is created through the action - Create Units.

     

    Say for example, 

     

    Trigger A

    Event - Map Initialization

    Action - Create Units With Default Facing - Hero A at Point...

     

    Trigger B

    Event - Unit Is Created

    Condition - Created Unit == Hero A

    Action - Here, you specify the actions for Hero A. Eg. Execute Effect A to Target Unit (Hero A) from Caster Unit (Hero A).

     

    If, for example, your unit is created through data and not through Triggers, e.g. through a train ability.

     

    Then, you will need to create a dummy effect which you can use via triggers. 

    Put the dummy effect under the Unit : Effect (Birth).

     

    Next, create a trigger with Effect Used Event specifying the dummy effect.

    Create a global variable which serves to mark the Unit.

    Under the Effect Used Event Trigger, set the global variable == Triggering Effect Unit (Caster).

     

    This means that during the Unit : Effect (Birth) event when the unit is created through the train ability, the following actions runs and so on.

     

    Lastly, another alternative is to use Data Tables where you can save a Unit into a string and later use it in your trigger.

     

    I hope that explains.

     

     

     

    Posted in: Triggers
  • 0

    posted a message on How to prevent data from being overwritten by updates in the Allied Commanders Dependency Mod?

    In reply to DrSuperEvil:

     Thanks, I think it makes sense now. So, whenever I make a new unit, actor, effect or upgrade, it will overwrite the Blizzard dependency mod. Am I right?
    Posted in: Data
  • 0

    posted a message on How to prevent data from being overwritten by updates in the Allied Commanders Dependency Mod?

    Hi, a quick question here,

     

    As the title suggests, if Blizzard updates or implements a new commander, this will break/overwrite certain data such as abilities or upgrades on certain units or structures. 

     

    I'am thinking is there any possibility to prevent this from happening so that I will not have to constantly update or reset the said units' or structures' abilities?

    Posted in: Data
  • 0

    posted a message on [Solved] Dead Unit Group Function Bugged And Addressing Units Issue.

    In reply to DrSuperEvil:

    Issue solved. The following steps:-

     

    1. Create a dummy death effect for the Creator unit (Strike Fighter Platform).

    2. Create a global integer variable (which serves to mark the Creator death count).

    3. Create an Effect Used trigger -> Using the dummy death effect in step 1. Then under Actions -> modify variable (integer variable created in step 2) to +1 (which marks the death count).

    4. Under Unit Being Removed / Unit Dies event for the Created unit (HH-Strike Fighter), create an IF-Then-Else condition.

    IF -> Integer Variable > 0.

    Then -> Stop Trigger (Current Trigger).

    Else -> Create a HH-Strike Fighter Action.....

    Which means if any Strike Fighter Platform (Creator) dies, then stop the current trigger, or else, create a Strike Fighter (Created unit).....

     

    Thanks for your help.

    Posted in: Triggers
  • 0

    posted a message on [Solved] Dead Unit Group Function Bugged And Addressing Units Issue.
    Quote from DrSuperEvil >>

    Dead units are removed from the game unless you modify the Stats: Death Time field under the Units data type.

     

    You could always store those units to global variables for later use. Try the Original Caster Of Unit function.

    The Original Caster Of Unit function does not work probably because the unit is created through a trigger event. I tried setting up the created unit's custom value (X of Point & Y of Point) to the position of the creator, then when the created unit dies or is removed, made the created unit respawn at the position of the creator by creating a variable with function (Point from XY - whereby X reflects the custom value X of Point of the creator's position and Y reflects the custom value Y of Point of the said creator's position).
    Everything works, but there is a slight problem, which is when the creator dies, the created unit will still spawn regardless of whether the creator lives or dies. I tried the condition Unit is Alive == False (hereby the Creator) but I run into a trouble of referencing the Creator since the Unit Dies or Unit Is Being Removed event function triggering unit references the created unit and not the creator. Moreover, I used a dummy effect "HHBomberPlatformCreateDummy" at HH-Strike Platform's Unit Birth effect to create the created unit -> HH-Strike Fighter.
    So, any advice? It is only when the Creator dies that the created unit still spawns which is an issue. Note that this project is a mod and not a map because otherwise, pre-placed units value in a map can always be referenced/ referred to.
     
     
    Posted in: Triggers
  • 0

    posted a message on [Solved] Dead Unit Group Function Bugged And Addressing Units Issue.

    In reply to DrSuperEvil:

    Thanks for the response. Will try out as suggested.

    Posted in: Triggers
  • 0

    posted a message on [Solved] Dead Unit Group Function Bugged And Addressing Units Issue.

    Hi, there,

     

    The function Number of living units in unit group works as intended but not with number of dead units in unit group. Apart from this, is there any other means to reference other units (apart from triggering unit) if say, I want to refer to the creator of unit and unit created (2 different units) at different events (say an Effect Used event and a Unit Dies event). Gladly appreciate any advice.

     

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