• 0

    posted a message on Add limited unit selection?

    There probably is a field that you can edit to change maximum unit selection in the Data Editor, but I can't find it, so here's a trigger version of it. I also attached a map with all of the triggers so you can easily copy and paste.

    ---

    Action Definition List:
    1. Limit Unit Selection

    Trigger List:
    1. Player Selects Unit

    ---

    Limit Unit Selection

    Limit Unit Selection
        Options: Action
        Return Type: (None)
        Parameters
            Player = 0 <Integer>
            Units = 0 <Integer>
        Grammar Text: Limit Unit Selection for Player (Player) to a maximum of (Unit) possible units selected.
        Hint Text: (None)
        Custom Script Code
        Local Variables
            Selected Units = (Empty unit group) <Unit Group>
        Actions
            Variable - Set Selected Units = (Selected units for player Player)
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Number of Living units in Selected Units) > Units
                Then
                    Unit Selection - Deselect Selected Units for player Player
                    General - Pick each integer from 1 to Units, and do (Actions)
                        Actions
                            Unit Selection - Select (Unit (Picked integer) from Selected Units) for player Player
                Else
    

    Player Selects Unit

    Player Selects Unit
        Events
            Unit Selection - Any Unit is Selected by player Any Player
        Local Variables
        Conditions
        Actions
            Limit Unit Selection for Player (Triggering player) to a maximum of 8 possible units selected.
    

    ---

    Notes: The unit limit isn't a permanent change, but just a work-around, meaning that putting that on Map Initialization for all players does nothing. You have to apply it every time a unit is selected for a player.

    ---

    If you find a problem with my code or have any further questions, don't be afraid to reply back!

    Happy coding :D

    Posted in: Triggers
  • 0

    posted a message on Repeating Hero Selection Timer

    Can you post your trigger please so we can see what's wrong with it?

    I don't have editor open, but it should probably something similar to this

    Event
    Unit is killed
    
    Condition
    Unit is in Player Group Heroes = True
    
    Action 
    Restart TimerArray[Owner of Triggering Unit]
    
    Posted in: Triggers
  • 0

    posted a message on Give resources every minute to player?

    Here is a complete version, adding on to what SnyderGuy described. :D

    Before you can make the income system, you first need a global variable that counts the number of fortresses they control. This can be easily done with an integer array "Number Of Fortress Controlled = 0 <Integer[6]>", where the total number of array is the number of players you have. In the example that I used, there should be a total number of 6 players maximum in the map. We use an array because each player has a separate income.

    ---

    Global Variable List:
    1. Number Of Fortress Controlled = 0 <Integer[6]>

    Trigger List:
    1. Periodic Income
    2. Player Captures Fortress

    ---

    Periodic Income

    Periodic Income
        Events
            Timer - Every 60.0 seconds of Game Time
        Local Variables
        Conditions
        Actions
            Player Group - Pick each player in (Active Players) and do (Actions)
                Actions
                    Player - Modify player (Picked player) Minerals: Add (1 + Number Of Fortress Controlled[(Picked integer)])
    

    Player Captures Fortress

    Player Captures Fortress
        Events
            ------- Player Captures Fortress
        Local Variables
        Conditions
        Actions
            Variable - Modify Number Of Fortress Controlled[(Triggering player)]: + 1
    

    ---

    Notes: Arrays start from 0, meaning it is actually the more optimal to make it "Number Of Fortress Controlled = 0 <Integer[5]" instead of [6] However, making it [6] makes it less confusing for you and also allows you to use Triggering Player as an array index. I also did not include the event for Player Captures Fortress because I do not know what capturing system you are using.

    ---

    If you find a problem with my code or have any further questions, don't be afraid to ask!

    Happy coding :D

    Posted in: Triggers
  • 0

    posted a message on Victory if 2 units are killed

    Event - Unit is Killed
    .
    Condition
    [CC1] Is Alive == False
    [CC2] Is Alive == False
    .
    Action
    End Game in Victory for Player 1
    Pick each Integer between 2 and 7
    End game in Defeat for player Picked Integer

    Posted in: Triggers
  • 0

    posted a message on very easy and simple voting system?

    Here's the simplest one.

    Triggers:
    Select Game Mode
    Select Game Mode 2
    Select Game Mode 3

    Variables:
    Game Mode = No Dialog <Dialog>
    Regular Vote Count = 0 <Integer>
    Limited Vote Count = 0 <Integer>
    Hunt Vote Count = 0 <Integer>
    Regular = No Dialog Item <Dialog Item>
    Limited = No Dialog Item <Dialog Item>
    Hunt = No Dialog Item <Dialog Item>

    Select Game Mode
        Events
            Timer - Elapsed time is 5.0 Game Time seconds
        Local Variables
        Conditions
        Actions
            Dialog - Create a Modal dialog of size (600, 400) at (0, 0) relative to Center of screen
            Variable - Set Game Mode = (Last created dialog)
            Dialog - Set title of (Last created dialog) to "Select Game Mode"
            Dialog - Create a button for dialog (Last created dialog) with the dimensions (500, 85) anchored to Top Left with an offset of (50, 80) setting the tooltip to "" with button text "Regular" and the hover image set to ""
            Variable - Set Regular = (Last created dialog item)
            Dialog - Create a button for dialog (Last created dialog) with the dimensions (500, 85) anchored to Top Left with an offset of (50, 175) setting the tooltip to "" with button text "Limited" and the hover image set to ""
            Variable - Set Limited = (Last created dialog item)
            Dialog - Create a button for dialog (Last created dialog) with the dimensions (500, 85) anchored to Top Left with an offset of (50, 270) setting the tooltip to "" with button text "Hunt" and the hover image set to ""
            Variable - Set Hunt = (Last created dialog item)
            Dialog - Show (Last created dialog) for (All players)
    

    -

    Select Game Mode 2
        Events
            Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
        Local Variables
        Conditions
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Used dialog item) == Regular
                Then
                    Dialog - Hide Game Mode for (Player group((Triggering player)))
                    Variable - Modify Regular Vote Count: + 1
                Else
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Used dialog item) == Limited
                Then
                    Variable - Modify Limited Vote Count: + 1
                    Dialog - Hide Game Mode for (Player group((Triggering player)))
                Else
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Used dialog item) == Hunt
                Then
                    Variable - Modify Hunt Vote Count: + 1
                    Dialog - Hide Game Mode for (Player group((Triggering player)))
                Else
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (+ (Hunt Vote Count, Limited Vote Count, Regular Vote Count)) == (Number of players in (Active Players))
                Then
                    Trigger - Run Select Game Mode 3  (Check Conditions, Don't Wait until it finishes)
                    Trigger - Turn Select Game Mode 3 Off
                    Trigger - Turn (Current trigger) Off
                Else
    

    Select Game Mode 3
        Events
            Timer - Elapsed time is 20.0 Game Time seconds
        Local Variables
        Conditions
        Actions
            Dialog - Hide Game Mode for (Active Players)
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    Regular Vote Count >= Limited Vote Count
                    Regular Vote Count >= Hunt Vote Count
                Then
                   //Your Actions
                Else
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            Limited Vote Count >= Regular Vote Count
                            Limited Vote Count >= Hunt Vote Count
                        Then
                            //Your Actions
                        Else
                            //Your Actions
    

    If Regular Mode Votes == Limited Mode Votes, it gives priority to Regular.

    Posted in: Triggers
  • 0

    posted a message on [FIXED] Basic revival system

    Got it to work! The problem was that "Unit from Unit Group" isn't a constant variable, and I used the workaround that involved moving invisible units instantly described here http://www.sc2mapster.com/forums/development/triggers/10075-help-any-unit-enters-within-x-of-point-unit-not-able/

    Posted in: Triggers
  • 0

    posted a message on [FIXED] Basic revival system

    I'm trying to create a basic revival system. My goal is that when you die, you leave behind a beacon. When one of your allies touches your beacon, you revive, but the trigger I'm using does not work for some reason

    Here's the code

    Trigger 1:

    Spy Dies
        Events
            Unit - Any Unit dies
        Local Variables
        Conditions
            ((Triggering unit) is in Spies) == True
        Actions
            Unit - Create 1 Beacon (Protoss Small) for player (Owner of (Triggering unit)) at (Position of (Triggering unit)) using default facing (No Options)
            Text Tag - Create a text tag with the text (Text (Name of player (Owner of (Triggering unit))) with color (Color((Current player (Owner of (Triggering unit)) color)))) for (All players), using a font size of 24, at (Position of (Triggering unit)) and height offset 1.0, initially Visible, and fog of war enforcement set to False
            Unit Group - Add (Last created unit) to Beacon[(Owner of (Triggering unit))]
            Variable - Set Beacon Text Tag[(Owner of (Triggering unit))] = (Last created text tag)
    

    Here's the revival code for player 1. I have a separate revival code for every player:

    P1 Rescued
        Events
            Unit - Any Unit Enters a distance of 1.25 from (Unit 1 from Beacon[1])
        Local Variables
        Conditions
            ((Triggering unit) is in Spies) == True
        Actions
            Unit - Remove (Unit 1 from Beacon[1]) from the game
            Text Tag - Destroy Beacon Text Tag[1]
            Unit - Create 1 Suit Unit for player 1 at Revive Point[Current Level] using default facing (No Options)
            Unit Group - Add (Last created unit) to Spies
            Camera - Pan the camera for player 1 to (Position of (Last created unit)) over 1.0 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do use smart panning
            Unit Selection - Select (Closest unit to (Center of regLevel3Full) in (Any units in (Entire map) owned by player 1 matching No Unit Filter, with at most Any Amount)) for player 1
            Unit - Set (Last created unit) Movement Speed to (((Last created unit) Movement Speed (Current)) + Speed Add)
            Unit - Set (Last created unit) Maximum Life to (((Last created unit) Maximum Life (Current)) + HP Add)
            Unit - Set (Last created unit) Energy to (((Last created unit) Maximum Energy (Current)) + Energy Add)
            Unit - Set (Last created unit) Life (Percent) to 100.0
            Unit - Set (Last created unit) Energy (Percent) to 100.0
    

    Thanks

    Posted in: Triggers
  • 0

    posted a message on Cutscene Subtitles problem :(

    I know subtitles is used a lot, seriously any workarounds?

    Posted in: Triggers
  • 0

    posted a message on Cutscene Subtitles problem :(

    Bump! Anyone know solution?

    Posted in: Triggers
  • 0

    posted a message on [Data - Actor] Range Indicators (the best way)

    Thank you for the tutorial!

    Posted in: Tutorials
  • 0

    posted a message on Show white dotted radius circle around unit?

    You know in some units, like the Siege Tank (Sieged Mode), Overlords, Ravens, they all have white dotted lines that show their attack/detection radius. Well, I want that white dotted radius circle around one of my Turrets to show attack range. Does anyone know how to do that?

    Posted in: Triggers
  • 0

    posted a message on Cutscene Subtitles problem :(

    For my cutscenes in my map, I heavily use subtitles. However, if players has Option -> Gameplay -> Display Subtitles turned off, they can't see them at all. Is there a way around this?

    Thanks

    Posted in: Triggers
  • 0

    posted a message on [SOLVED] Can't place terrains
    Quote from grenegg: Go

    @xKenneth: Go

    Just go to map -> map textures and reselect your texture set for the second one, it will then work :)

    That worked! Thanks!

    Posted in: Terrain
  • 0

    posted a message on Adventures of Goku Firebat: CH5 - The Temple

    Godric. BEST. NAME. EVAAAAA!

    Posted in: Project Workplace
  • 0

    posted a message on [SOLVED] Can't place terrains

    I used fill terrain thing on my starting terrain =X

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