• 0

    posted a message on Observer UI as a Dialog Item

    @grenegg: Go

    Okay here's an actual question. How do I get minerals and vespene to appear under the "Resources" and "Income" tabs?

    Posted in: Tutorials
  • 0

    posted a message on pick all units in region?

    @gosperglider: Go

    Do what you said, in almost exactly those words.

    Posted in: Triggers
  • 0

    posted a message on Am magazine adressing

    @PsychoMC: Go

    This should do it, just update it periodically after a carrier becomes active. It will definitely work, but I'm not sure if there's a better way to do this because I haven't really looked.

            Unit Group - Pick each unit in (Carrier units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
                Actions
                    Variable - Set interceptor count = (Number of rounds in Carrier - Hangar magazine for (Picked unit))
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            interceptor count == 0
                        Then
                            Unit - Kill (Picked unit)
                        Else
    
    Posted in: Triggers
  • 0

    posted a message on Fire trigger when no unit nearby

    @Anarcy: Go

    Edit: what he said

    Create a region around the unit. Update that region if your unit moves. Make trigger with periodic event. Check number of units in region, and if it's greater than 1, fire your actions.

    Posted in: Triggers
  • 0

    posted a message on Can't get Leaderboard header to appear!

    @dgilbert418: Go

    Fixed

    Posted in: Triggers
  • 0

    posted a message on Can't get Leaderboard header to appear!

    Can you attach your map to your post? It's useful for any kind of debug.

    Posted in: Triggers
  • 0

    posted a message on [Library] Bank - Load String long

    You cannot load a string from the bank that's longer than 781 characters. It will not crash, but the string will be truncated. This very simple function will enable you to store and load such a string. It has no compression or encryption capabilities.

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on Enable/disable computer control

    Map => Player Properties => Control   (Types: Computer, Hostile, Neutral, None, User)

    What I want: a neutral player whose units are controllable by multiple other players through triggers.

    What I've tried:
    computer - works, but messes up my active player counter
    hostile - works, but refuses to relinquish control (like sieging after I tell it to unsiege)
    neutral - works, but shared vision doesn't work correctly (can attack neutral units on high ground without vision)
    none - doesn't work
    user - works, but has no computer control ability

    I would prefer it if a computer takes over control when no other player claims control.  Preferably the computer would know how to micro as well.  Which option am I supposed to use?  What triggers should I use to fix its problems?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Dialogs and Buttons

    @Scbroodsc2: Go

    You pretty much can't go wrong using just variables. Global data tables are more powerful, similar to using variable arrays.

    Global data table
    pros: unlimited length, can recall values based on strings, strings could be made in-game, destroyable
    cons: only one data table available for any given variable type

    Variable array
    pros: extremely versatile, can recall values based on integers, integers could be variables themselves
    cons: must define its size beforehand

    Posted in: Triggers
  • 0

    posted a message on [solved] Show upgrade cost

    @Alphadrant: Go

    Damn, that was perfect. Thanks man.

    Posted in: Triggers
  • 0

    posted a message on Convert Unittype to Image (for dialog)

    [reply=312971]

    Get Unit Data Auto
        Options: Action
        Return Type: (None)
        Parameters
            InputUnitLink = No Game Link <Game Link - Unit>
        Grammar Text: Get Unit Data Auto(InputUnitLink)
        Hint Text: (None)
        Custom Script Code
        Local Variables
            UnitType String Words = "" <String>
            UnitType StringWord = "" <String>
            UnitType stringword = "" <String>
            RaceString = "" <String>
            NameText = No Text <Text>
            TooltipText = No Text <Text>
            Minerals = 0 <Integer>
            Vespene = 0 <Integer>
            Image = No File <File - Image>
            Supply = 0.0 <Real>
        Actions
            Variable - Set UnitLink[i unit] = InputUnitLink
            Variable - Set UnitType String Words = (String(InputUnitLink))
            Variable - Set UnitType StringWord = (UnitType String Words with up to All " " replaced by "" (Sensitive to case))
            Variable - Set UnitType stringword = (String(UnitType StringWord) as Lower Case)
            Variable - Set NameText = (Game text for ("Unit/Name/" + UnitType StringWord))
            Variable - Set UnitName[i unit] = NameText
            Variable - Set TooltipText = (Game text for ("Button/Tooltip/" + UnitType StringWord))
            Variable - Set Minerals = (Minerals cost of UnitLink[i unit])
            Variable - Set Vespene = (Vespene cost of UnitLink[i unit])
            Variable - Set Supply = (-1.0 * (Real((Value of Units UnitType String Words "Food" for player Any Player))))
            Variable - Set ButtonUnitTooltip[i unit] = (Combine ("<s val="StandardButton">", NameText, " ", "Assets\Textures\icon-mineral.dds", " ", (Text(Minerals)), "   ", "Assets\Textures\icon-gas.dds", " ", (Text(Vespene)), "   ", "Assets\Textures\icon-supply.dds", " ", (Text(Supply) with Normal decimal p
            Variable - Set RaceString = (Value of Units UnitType String Words "Race" for player Any Player)
            General - Switch (Actions) depending on RaceString
                Cases
                    General - If ("Prot")
                        Actions
                            Variable - Set RaceString = "protoss"
                    General - If ("Terr")
                        Actions
                            Variable - Set RaceString = "terran"
                    General - If ("Zerg")
                        Actions
                            Variable - Set RaceString = "zerg"
                Default
            Variable - Set ButtonUnitFile[i unit] = "Assets\\Textures\\btn-unit-" + lv_raceString + "-" + lv_unitTypestringword + ".dds"
            Variable - Modify i unit: + 1
    

    Note: the function retrieves a lot more than just the unit's icon. The only line of importance for you is that second to last line. The function was only used for units available in melee. Even then the image didn't work for the Void Ray (Warp Ray).

    You could also link to the unit's button game link and retrieve its file that way. With only 30 units, especially if you're using things like the Automaton, I would either do that or select the images manually.

    Posted in: Triggers
  • 0

    posted a message on Dialogs and Buttons

    @Telthalion: Go

    Your problem is that you need to specify condition "used dialog item == "Petit" from Global Data Table". The "dialog item used" event fires when ANY button is pressed. See here:

    Posted in: Triggers
  • 0

    posted a message on Baneball Trigger help needed

    @DragOnGamer626: Go

    Your "key pressed == space" will always return true once the trigger starts. Here I fixed it for you:

    Posted in: Triggers
  • 0

    posted a message on Prevent sharing ressources after leaving

    @nThrX: Go

    I think you could change the leaver's properties just fine, the problem is that the built-in trigger to divide resources is activating before yours. You could verify this with some debug messages; if it is the case, the best solution might be to give the resources back. If you can get a trigger to activate before, I would just change the leaver's alliance settings.

    Posted in: Triggers
  • 0

    posted a message on Make 2 buttons highlight when mouse over 1 button?

    @Syncourt: Go

    I'm thinking something along the lines of this:
    1) Create two new image assets, one highlighted and one normal.
    2) Set both buttons' images to the normal
    3) Set a trigger to activate when mouse is over either button
    4) Trigger changes both images to the highlighted

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