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?
 
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^^
 
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).
 
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).
 
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
 
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
 
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
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top