• 0

    posted a message on Help with Victory/Anti-Camping Triggers
    Quote from TwoDie: Go

    Kills Counter Events Unit - Any Unit dies Local Variables Killer = (Killing player) <Integer> Conditions Actions Variable - Modify Kills[Killer]: + 1

    Needed global variable with [array]

    Win condition:

    Events Timer - Every 1.0 seconds of Game Time Local Variables Conditions Actions Player Group - Pick each player in (Active Players) and do (Actions) Actions General - If (Conditions) then do (Actions) else do (Actions) If Kills[(Picked player)] >= 100 Then Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen) Else ...

    Using a periodic event to check the condition is very evil ;) Just check the condition directly:

    Kills = 0 <Integer[12]>
    Kill Limit = 100 <Integer (Constant)>
    
    Increase Kills For Player
        Options: Action
        Return Type: (None)
        Parameters
            Player = 0 <Integer>
        Grammar Text: Increase Kills For Player(Player)
        Hint Text: (None)
        Custom Script Code
        Local Variables
            index = 0 <Integer>
        Actions
            Variable - Set index = (Player - 1)
            Variable - Modify Kills[index]: + 1
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Kills[index] >= Kill Limit
                Then
                    Game - End game in Victory for player Player (Show dialogs, Show score screen)
                Else
    // Here you would also update your dialogs etc.
    
    Player Kills Unit
        Events
            Unit - Any Unit dies
        Local Variables
        Conditions
        Actions
            Increase Kills For Player((Killing player))
    
    Posted in: Triggers
  • 0

    posted a message on [Triggering] How to design a circular bar?

    I am not quiet sure if I understand what you mean and if it makes sense, but the method I use should work in most cases. It actually works like AioncannonzSC2 explained and the graphics I used are very similar to his. It doesn't matter if the bar is divided into 3, 4 or 10 parts. If you want to fill whole parts at once, you'll have to increase the size of the steps. It is just a little more math, but nothing really complicated.

    I don't know why one should use three circles.

    Posted in: Triggers
  • 0

    posted a message on [Triggering] How to design a circular bar?

    It's not a tutorial, but I threw together a small example map.

    Posted in: Triggers
  • 0

    posted a message on Keeping track of kills problem

    Note: you should use modify variable instead of

    Variable - Set PlayerKills[(Triggering player)] = (PlayerKills[(Triggering player)] + 1)
    

    because it is less error-prone.

    I also recommend to use only one trigger and an if-statement instead of a trigger condition.

    Posted in: Triggers
  • 0

    posted a message on Any future IDE for galaxy scripting?
    Quote from progammer: Go

    @dra6o0n: Go

    While a list of function or grammar checking is good, there's no point making test output without actually using sc2 engine, there's no point doing that.

    A UI-Preview would be nice though.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Trigger stuff for ALL variables in array?

    What you are searching for is "for each integer ...".

    Posted in: Triggers
  • 0

    posted a message on Tower Defense Mazing - Stop Blocking Idea
    Quote from scorix1: Go

    @Pfaeff: Go

    I just found a way make it work with cost between 2 points.

    (Pathing cost between (Center of PLAYER01SPAWN) and (Center of PLAYER00END)) == 65536

    Does the trick and its working quite well. I found 65536 by displaying the pathing cost when blocking the path and it always return 65536 when there is no path.

    Yeah, but it doesn't always work. I can give you an example where the path is blocked, an the pathing cost is around 240 (mostly when builing diagonally). It seems to be a bug in the path finding engine itself.

    The interesting thing is, that

                            (Point 001 and Point 002 are connected by pathing)
    

    is true in both cases.

    Posted in: Triggers
  • 0

    posted a message on Tower Defense Mazing - Stop Blocking Idea
    Quote from zakariahliklikleh: Go

    @nevjmac: Go

    you can use built-in pathing cost of units to figure out if the unit is blocked or not. If the pathing cost of a unit returns -1 then this means there is no path to where the unit wants to go hence it's blocked. There are a couple of built in comparisons functions in the editor, cost between 2 points, or cost between a unit and a point, something like that, i used it for my TD map.

    I once tried to do this by using "pathing exists between pointA and poinB" or "pathing cost between points", but these doesn't seem to work in that case.

    Posted in: Triggers
  • 0

    posted a message on Unit construction Completed ?

    Note: That event doesn't fire, if you set the building time to 0.0.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Condition: Point is visible to player

    You could create a temporary unit at that point, check if it is visible and then remove it from the game.

        Local Variables
            is visible = false <Boolean>
        Conditions
        Actions
            Unit - Create 1 Apple for player 12 at Point 001 using default facing (No Options)
            Variable - Set is visible = ((Last created unit) is visible to player 1)
            Unit - Remove (Last created unit) from the game
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    is visible == true
                Then
                    ------- The point is visible
                Else
                    ------- The point is not visible
    
    Posted in: Triggers
  • 0

    posted a message on How can I lower the trigger size?

    You could try do reduce your code size by using the Galaxy language. If you have many loops, there might be a chance to reduce the generated code as well. But its hard to tell without seeing the code. There could be some design flaws causing lots of redundant code/variables which take a lot of space.

    Posted in: Triggers
  • 0

    posted a message on Trouble with a calender system
    day name changer = (total day modulo 7)
    your text = day name [day name changer]
    

    and leave all the counting.

    Posted in: Triggers
  • 0

    posted a message on [Video] Experience Orbs [Updated]

    It would be great if they would accelerate towards you and not just move towards you in a linear motion. I think that can easily be changed in the data editor.

    Posted in: Data
  • 0

    posted a message on For each player and Pick each player

    Pick player is more efficient, because it uses built-in functionality. Unfortunately it does not work when you want to nest player loops. In this case you would have to use at least one for-loop.

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