• 0

    posted a message on All vs Active Players

    All includes comp players, while active is user only.

    Posted in: Triggers
  • 0

    posted a message on Mapscript limit revisited

    How "create thread" is relevant here, if the sizes are dependant on the script line amount? refacturing and optimizing the code is the only way to beat the script size. Correct me if I'm mistacken.

    Posted in: Triggers
  • 0

    posted a message on Select from Array with no Repeat Selections

    Add each used random to an array, then every time you get a new random, check if it's in that array, and if it is, then re-roll the random.

    Pseudo code:
    ...
    Repeat
    ..isUnique = true;
    ..Random Picker = (Random integer between 0 and 23);
    ..For i from 0 to 4 Do
    ....If (Random Picker == usedRands[i]) Then isUnique = false;
    Until(isUnique);
    Unit - Create ...

    It's the simplified version. You could use functions to get rid of For loop inside the repeat.

    Update: GOD DAMN IT, I hate this markup, it has removed all my spaces, had to write them with dots.

    Posted in: Triggers
  • 0

    posted a message on Unexplainable error
     Gladiator 1v1 Initiator 
    Options: Action 
    Return Type: (None) 
    Parameters Battle = 0 <Integer> 
    Grammar Text: Gladiator 1v1 Initiator(Battle) 
    Hint Text: (None) 
    Custom Script Code 
    Local Variables a = 0 <Integer> 
    b = 0 <Integer> 
    Initiation Timer = (New timer) <Timer> 
    Initiation Timer Window = No Timer Window <Timer Window> 
    Player = 0 <Integer[2]> Chooser = No Unit <Unit[2]> 
    Map Activate = 0 <Integer> 
    i = 0 <Integer> 
    Actions 
    Variable - Set Player[1] = (Player 1 from BattlePlayerGroup[Battle]) 
    Variable - Set Player[2] = (Player 2 from BattlePlayerGroup[Battle]) 
    ------- BG Occupied Check and Reroll 
    Variable - Set Map Activate = (Random integer between 1 and 4) 
    General - While (Conditions) are true, do (Actions) 
    Conditions 
    BG Occupied?[Map Activate] == True 
    Actions 
    Variable - Set Map Activate = (Random integer between 1 and 4) 
    Variable - Set Battlefield[Battle] = combatRegion[Map Activate] 
    Variable - Set Battle's BG[Battle] = Map Activate 
    Variable - Set BG Occupied?[Map Activate] = True 
    Variable - Set Victory On[Battle] = True 
    Player Group - For each player b in BattlePlayerGroup[Battle] do (Actions) 
    Actions 
    Player - Modify player b Minerals: Set To 3 
    Variable - Set Gladiators Alive[b] = 3 
    Unit Group - Pick each unit in (Beacon (Protoss Large) units in Battlefield[Battle] owned by player 0 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions) 
    Actions Unit - Turn (Picked unit) Targetable state Off 
    Camera - Set the camera bounds for BattlePlayerGroup[Battle] to Battlefield[Battle] (Do adjust the minimap) 
    Dialog - Hide Observer Dialog for BattlePlayerGroup[Battle] UI - Show Command Panel for BattlePlayerGroup[Battle] 
    UI - Show Minimap Panel for BattlePlayerGroup[Battle] 
    UI - Show Control Group Panel for BattlePlayerGroup[Battle] 
    UI - Show Info Panel for BattlePlayerGroup[Battle] 
    ------- Chooser 
    UI - Display "Choose 3 warriors to do battle." for BattlePlayerGroup[Battle] to Subtitle area 
    Unit - Create 1 Gladiator Selector for player Player[1] at BG Pylon Left[Map Activate] facing 270.0 degrees (No Options) 
    Variable - Set Chooser[Player[1]] = (Last created unit) 
    Unit Selection - Select (Last created unit) for player Player[1] 
    Camera - Pan the camera for player Player[1] to (Position of (Last created unit)) over 0.5 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning 
    Unit - Create 1 Gladiator Selector for player Player[2] at BG Pylon Right[Map Activate] facing 270.0 degrees (No Options) 
    Variable - Set Chooser[Player[2]] = (Last created unit) 
    Unit Selection - Select (Last created unit) for player Player[2] 
    Camera - Pan the camera for player Player[2] to (Position of (Last created unit)) over 0.5 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning 
    ------- Timer 
    Timer - Start Initiation Timer as a One Shot timer that will expire in 25.0 Game Time seconds 
    Timer - Create a timer window for (Last started timer), with the title "Initiation Timer", using Remaining time (initially Hidden) 
    Variable - Set Initiation Timer Window = (Last created timer window) 
    Timer - Move Initiation Timer Window to (970, 322) Timer - Show Initiation Timer Window for BattlePlayerGroup[Battle] 
    General - Wait for Initiation Timer to have 0.0 seconds Remaining 
    Player Group - For each player b in BattlePlayerGroup[Battle] do (Actions) 
    Actions 
    Variable - Set Gladiator active?[b] = True 
    Player Group - Add player b to Gladiator Mineral Group 
    Dialog - Create a Modal dialog of size (200, 200) at (0, 0) relative to Center of screen 
    Variable - Set EnemyTargetDialogTest[b] = (Last created dialog) 
    Dialog - Show EnemyTargetDialogTest[b] for (Player group(b))
    Dialog - Hide the background image of EnemyTargetDialogTest[b] 
    Dialog - Create an image for dialog EnemyTargetDialogTest[b] with the dimensions (111, 111) anchored to Top Left with an offset of (11, 11) setting the tooltip to "" using the image Assets\Textures\cursor-target-invalid.dds as a Normal type with tiled set to False tint color Red and blend mode Lighten 
    Dialog - Set (Last created dialog item) size to parent layout True for (All players) 
    Dialog - Show Control Group Switch Dialog for BattlePlayerGroup[Battle] 
    Dialog - Show Forfeit Dialog for BattlePlayerGroup[Battle] 
    Dialog - Set Mineral Bar item current value to 0.0 for BattlePlayerGroup[Battle] 
    Dialog - Show Mineral Bar for BattlePlayerGroup[Battle] 
    Timer - Destroy Initiation Timer Window 
    Dialog - Enable Observer Dialog Game Button[Battle] for (All players) 
    Unit Group - Pick each unit in (Gladiator Selector units in Battlefield[Battle] owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions) 
    Actions 
    Unit - Kill (Picked unit)
    
    Posted in: Triggers
  • 0

    posted a message on Maths - Calculating nearest angle>?

    0 deg - left 90 - up 180 - right 270 - down

    You should compare angles between points. For example, angle between destination1 and your unit is 90 deg (in case the unit is going up), and you want it to go to the right (180 deg). you pick up an angle between destination2 and your unit (which will be 180 deg), calculate the difference between angles, like: angle(dest2,unit)-angle(dest1,unit)=rotation angle You'll get an angle, on which you need to rotate your unit.

    Posted in: Triggers
  • 0

    posted a message on Player reward throw dice

    Okay, let me do this in a second :D

    General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Or
                        Conditions
                            And
                                Conditions
                                    Dice3 < Dice1
                                    Dice1 == Dice2
                            And
                                Conditions
                                    Dice2 < Dice1
                                    Dice1 == Dice3
                            And
                                Conditions
                                    Dice1 < Dice2
                                    Dice3 == Dice2
                Then
    

    Should work :) If atleast 1 AND returns TRUE, then it will execute everything written in THEN, if everything is FALSE, it will execute the else part.

    Posted in: Triggers
  • 0

    posted a message on Player reward throw dice

    Because the And, Or are working in another way. Everything you specify under them is used with this logical comparison.
    For example:

     General - If (Conditions) then do (Actions) else do (Actions)
                If
                    And
                       Conditions
                           Dice3 < Dice1
                           Dice1 == Dice2 
    


    Will return true, only if Dice3 < Dice1 AND Dice1 == Dice2. The same for Or. Restructorize your conditions, then it'll work :)

    Posted in: Triggers
  • 0

    posted a message on Random player? Help please!

    It's either replace, or remove unit x->create new unit y-> set x = last created unit.

    Posted in: Triggers
  • 0

    posted a message on Trigger runs, FPS goes down 50%

    Oh dude... The're so many triggers... You could have used Any player, instead of 1, 2, 3, 4, 5.... and then, put Triggering player everywhere...
    Also, some of your conditions are strange, for example:
    Not(Unit Type of (Triggering Unit) is Worker == True) is the same as Unit Type of (Triggering Unit) is Worker == False
    you need a lot of cleaning. I've run it with debugger, it had a trigger (Anti-Idle) which had a lot of executions. Try disabling it, may help (can't say for sure, because my max fps on empty map is 200, here it was 100).

    Advise - combine your triggers, start using loops (such as, pick every player, for each, etc.). That way you can cut down the number of triggers, and it'll be easier to find the source of the problem. Also, if you have one event for 100 triggers, make it 1 trigger, separate everything with comments.

    Posted in: Triggers
  • 0

    posted a message on Trigger runs, FPS goes down 50%

    What's the event for main trigger?

    Posted in: Triggers
  • 0

    posted a message on Xeno Crisis: Showdown

    I liekd it. Felt like it had something in the video. Waiting for the actual map, always liked survivals/adventures! :D

    Posted in: Project Workplace
  • 0

    posted a message on Simple tag system

    Send it over, I'll look on it tomorrow, if nobody volunteers ;)

    Posted in: Triggers
  • 0

    posted a message on Interesting Loop Question

    Yes. You can check it by debugging the i to the debug window :)

    As was said, you should declare i as a global var. ;)

    Also, to get rid of the loop, as an index of an array you can use Owner of (killing unit), or even Killing player. Just to get rid of the 7 checks.

    Posted in: Triggers
  • 0

    posted a message on Interesting Loop Question

    Edit: No, no, no, something wrong was written here :D
    Since i is a local var, it's always equals to 1. When the event fires, 1 is assigned to every member of i. So, even if you inc the i[picked int], next time a unit dies, i[picked int]=1.
    Make i global :)

    Posted in: Triggers
  • 0

    posted a message on Interesting Loop Question

    Value of units killed seems to not work. Was something similar about the value of units killed here on trigger forums.

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