Many sc2 functions seem to be bugged...

Frozenwind

System maker
Reaction score
99
I see a lot of functions which simply don't work.

How would a "pick every unit in unitgroup" create an infinite loop, whereas a "for each unit in unitgroup" doesn't?

Why a marine, who is attacking me because of aggro,'s owner isn't marked as an enemy of mine? They don't store alliance in "check alliance aspect" function as it seems... (Doing it manually now as I simply need it for triggered spells). This may be caused because I change alliance through triggers (yet it IS a bug).

Dialogs, there are multiple items you can add, but things like a slider or an edit box won't appear on creation - seems like they aren't truly added yet.

Does someone else experience things like this?
 

Arkless

New Member
Reaction score
31
I see a lot of functions which simply don't work.

How would a "pick every unit in unitgroup" create an infinite loop, whereas a "for each unit in unitgroup" doesn't?

Why a marine, who is attacking me because of aggro,'s owner isn't marked as an enemy of mine? They don't store alliance in "check alliance aspect" function as it seems... (Doing it manually now as I simply need it for triggered spells). This may be caused because I change alliance through triggers (yet it IS a bug).

Dialogs, there are multiple items you can add, but things like a slider or an edit box won't appear on creation - seems like they aren't truly added yet.

Does someone else experience things like this?
I've already used "pick every unit in unitgroup" without any problems...

Is the marine neutral and attacks because you attacked it first (or a behaviour or anything like that)? Attacking does not equal being an enemy.

I never used sliders, but i already saw em in use. Edit boxes... I dont know^^
 

Frozenwind

System maker
Reaction score
99
I'm rather sure he's an enemy according to this function:

Code:
testing
    Events
        UI - Player Any Player presses Space key Down with shift Allow, control Allow, alt Allow
    Local Variables
    Conditions
    Actions
        Unit Group - Add HunterBasic [124.45, 177.68] to PotentionalPushingTargets ///test unit target
        Unit Group - Add SurvivorBasic [118.96, 166.62] to PotentionalPushingTargets ///test unit caster
        Player - Make player 1 and player 2 treat each other as Enemy ///hunter = 2, survivor = 1
        Player Group - Add player 1 to EnemiesOfPlayer[(2 - 1)] ///used for my custom system to check alliance
        Player Group - Add player 2 to EnemiesOfPlayer[(1 - 1)] ///same
        Variable - Set PlayerUnit[0] = SurvivorBasic [118.96, 166.62] ///used in some triggers
        UI - Display (Text((Triggering player))) for (All players) to Chat area ///so I know who activates it
        Region - Set the playable map area to (Entire map) ///I change play. map area in some other triggers

And the pick every unit results in an infinite loop for me (iteration found).
 

Frozenwind

System maker
Reaction score
99
Unitgroup not working (iteration detected = endless loop):
http://www.thehelper.net/forums/showthread.php?t=154251

Ally/Enemy check not working:
Code:
Push movement
    Events
        Timer - Every 0.04 seconds of Game Time
    Local Variables
        Speed = 0.0 <Real>
        temp_Unit = No Unit <Unit>
        ------- Speed = Grids / Second
    Conditions
    Actions
        ------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        ------- SurvivorBasic
        ------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        Variable - Set Speed = 14.0
        Unit Group - For each unit TempPBullet in PushingBullets[0] do (Actions)
            Actions
                Unit - Move TempPBullet instantly to ((Position of TempPBullet) offset by (Speed * 0.04) towards (Facing of TempPBullet) degrees) (Blend)
                Unit Group - For each unit temp_Unit in PotentionalPushingTargets do (Actions)
                    Actions
                        UI - Display "unit found" for (All players) to Subtitle area
                        General - If (Conditions) then do (Actions) else do (Actions)
                            If
                                And
                                    Conditions
                                        [COLOR="Red"]((Owner of temp_Unit) is in (Enemies of player (Owner of TempPBullet))) == true[/COLOR]
                                        TempPBullet != temp_Unit
                                        (Distance between (Position of temp_Unit) and (Position of TempPBullet)) <= 0.6
                            Then
                                Unit - Order temp_Unit to ( Stop) (Replace Existing Orders)
                                Unit - Make temp_Unit Uncommandable ///not sure whether this will actually prevent massclicking to escape the pushing bullet - still gotta test
                                UI - Display "unit pushed" for (All players) to Subtitle area
                                Unit - Move temp_Unit instantly to ((Position of temp_Unit) offset by (Speed * 0.04) towards (Facing of TempPBullet) degrees) (Blend)
                                Unit - Make temp_Unit Commandable
                            Else
                UI - Display "-----" for (All players) to Subtitle area
Works if red function is removed (yet it affects allies too in that situation)


Please note:
I solved both problems by using different functions (or in the alliance system, a custom function written by myself).
 

Severon

New Member
Reaction score
7
Code:
testing
    Events
        UI - Player Any Player presses Space key Down with shift Allow, control Allow, alt Allow
    Local Variables
    Conditions
    Actions
        Unit Group - Add HunterBasic [124.45, 177.68] to PotentionalPushingTargets ///test unit target
        Unit Group - Add SurvivorBasic [118.96, 166.62] to PotentionalPushingTargets ///test unit caster
        Player - Make player 1 and player 2 treat each other as Enemy ///hunter = 2, survivor = 1
        Player Group - Add player 1 to EnemiesOfPlayer[(2 - 1)] ///used for my custom system to check alliance
        Player Group - Add player 2 to EnemiesOfPlayer[(1 - 1)] ///same
        Variable - Set PlayerUnit[0] = SurvivorBasic [118.96, 166.62] ///used in some triggers
        UI - Display (Text((Triggering player))) for (All players) to Chat area ///so I know who activates it
        Region – Set the playable map area to (Entire map) ///I change play. Map area in some other triggers

Where does the marine come into play? Is he a fellow survivor, your survivor, the hunter? This function tells me that your making player 1 enemies with player 2. So if player 2 is the marine then he should attack you. If the marine is another survivor then his alliance isn’t set here. One more question EnemiesOfPlayer[(2-1)] why not just put EnemiesOfPlayer[(1)]? Unless this is a dual array in which case shouldn’t it be EnemiesOfPlayer[(2)][(1)]?( I haven’t used these yet in SC2 so I’m not real sure about this.

Code:
Push movement
    Events
        Timer - Every 0.04 seconds of Game Time
    Local Variables
        Speed = 0.0 <Real>
        temp_Unit = No Unit <Unit>
        ------- Speed = Grids / Second
    Conditions
    Actions
        ------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        ------- SurvivorBasic
        ------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        Variable - Set Speed = 14.0
        Unit Group - For each unit TempPBullet in PushingBullets[0] do (Actions)
            Actions
                Unit - Move TempPBullet instantly to ((Position of TempPBullet) offset by (Speed * 0.04) towards (Facing of TempPBullet) degrees) (Blend)
                Unit Group - For each unit temp_Unit in PotentionalPushingTargets do (Actions)
                    Actions
                        UI - Display "unit found" for (All players) to Subtitle area
                        General - If (Conditions) then do (Actions) else do (Actions)
                            If
                                And
                                    Conditions
                                        ((Owner of temp_Unit) is in (Enemies of player (Owner of TempPBullet))) == true
                                        TempPBullet != temp_Unit
                                        (Distance between (Position of temp_Unit) and (Position of TempPBullet)) <= 0.6
                            Then
                                Unit - Order temp_Unit to ( Stop) (Replace Existing Orders)
                                Unit - Make temp_Unit Uncommandable
                                UI - Display "unit pushed" for (All players) to Subtitle area
                                Unit - Add 1 Reaper - Reaper Jump to temp_Unit from TempPBullet
                                Unit - Move temp_Unit instantly to ((Position of temp_Unit) offset by (Speed * 0.04) towards (Facing of TempPBullet) degrees) (Blend)
                                Unit - Make temp_Unit Commandable
                            Else
                UI - Display “-----“ for (All players) to Subtitle area
As for your iteration error, once again I’m not for sure, but I have an idea. In

Code:
    Conditions
                                        ((Owner of temp_Unit) is in (Enemies of player (Owner of TempPBullet))) == true
                                        TempPBullet != temp_Unit
“TempPBullet” is a unit type according to “TempPBullet != temp_Unit”
So in the alliance check condition it at some point is getting Owner of temp_unit(TempPBullet)” is in (Enemies of player (Owner of TempPBullet)))== true

In other words its getting Owner of TempPBullet is Enemy of Owner of TempPBullet. A player cannot be an enemy of themselves, so this might be where the error is coming from.

Hope this helps.

EDIT: Oops didn't see your edit, glad you fixed it, though kinda wonder if I'm right with the iteration part
 

Frozenwind

System maker
Reaction score
99
Code:
testing

Where does the marine come into play? It is the hunter which is a preset unit for my test (owned by player 2)
Is he a fellow survivor, your survivor, the hunter? This function tells me that your making player 1 enemies with player 2. So if player 2 is the marine then he should attack you. If the marine is another survivor then his alliance isn’t set here. I can ensure you the alliance changes by this function One more question EnemiesOfPlayer[(2-1)] why not just put EnemiesOfPlayer[(1)]? Unless this is a dual array in which case shouldn’t it be EnemiesOfPlayer[(2)][(1)]?( I haven’t used these yet in SC2 so I’m not real sure about this. I copied it from a different trigger which was like "owner of unit -1 (array 0~9, instead of 1~10, as the player numbers are). So basically I was too lazy to remove the arithematic xD Dual arrays work perfectly btw, I use them a lot.

Code:
Push movement
Code:
Conditions
                                        ((Owner of temp_Unit) is in (Enemies of player (Owner of TempPBullet))) == true
                                        TempPBullet != temp_Unit
“TempPBullet” is a unit type according to “TempPBullet != temp_Unit”
So in the alliance check condition it at some point is getting Owner of temp_unit(TempPBullet)” is in (Enemies of player (Owner of TempPBullet)))== true

In other words its getting Owner of TempPBullet is Enemy of Owner of TempPBullet. A player cannot be an enemy of themselves, so this might be where the error is coming from. Gonna test whether you are right.

Hope this helps.

EDIT: Oops didn't see your edit, glad you fixed it, though kinda wonder if I'm right with the iteration part

Read inside quote (green)


EDIT:
As promised, checked it for you.
This causes an iteration too (without the condition you though it was caused by:)
Code:
                Unit Group - Pick each unit in PotentionalPushingTargets and do (Actions)
                    Actions
                        UI - Display "unit found" for (All players) to Subtitle area
                        General - If (Conditions) then do (Actions) else do (Actions)
                            If
                                And
                                    Conditions
                                        TempPBullet != (Picked unit)
                                        (Distance between (Position of (Picked unit)) and (Position of TempPBullet)) <= 0.6
                            Then
                                UI - Display "unit pushed" for (All players) to Subtitle area
                                Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by (Speed * 0.04) towards (Facing of TempPBullet) degrees) (Blend)
                            Else
NOTE: This is the same loop as before, and thus only a part of the trigger.

So as you most-likely will agree with me now... Logically, an iteration can't be there o.o
 

Severon

New Member
Reaction score
7
Lol I supose I have to...logically:p Wish I knew the problem though, that kinda bugs me. Atleast you have a working "work-around". Well good luck with your map wish ya well
 
General chit-chat
Help Users

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top