• 0

    posted a message on Edited data not loading in online play

    @bonzaibill: Go

    Well, I was looking for the entire trigger, because sometimes it's not just in the actions that cause things to go haywire or it may be the ordering of the actions that cause it to go haywire. It also helps us help you to understand what went wrong within your trigger.

    I ran it with:

        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            Melee - Set melee starting resources for all players
            Melee - Create melee starting units for all players
            Melee - Start the melee AI for all computer players
            Melee - Set default melee options for all players
            Player Group - Pick each player in (Active Players) and do (Actions)
                Actions
                    Player - Modify player (Picked player) Minerals: Set To 1000
                    Player - Modify player (Picked player) Vespene: Set To 1000
    

    and it worked perfectly fine. Did you have your resources set in prior to the "Set Melee starting resources?" That may rewrite the custom value. If you have your trigger running as another, different, map initialize trigger, it may run before the Melee initialize trigger and thus, again, be rewritten and cause an unintended error.

    Posted in: Triggers
  • 0

    posted a message on Edited data not loading in online play

    @bonzaibill: Go

    What is your trigger?

    Posted in: Triggers
  • 0

    posted a message on Very basic questions....

    @DrHu: Go

    Functions only provide you with a return value, where as variables store that value.

    A simple way to look at it would like this: Think of people who are in your family. The function would be recalling the people who are in your family, and the variables would be who is in your family. Most (if not all) functions have no use without variables.

    Posted in: Triggers
  • 0

    posted a message on Death of a *special* unit to trigger defeat?
    Quote from Mille25: Go

    the lose trigger will never execute because the triggering unit cant have all 3 unit types.

    try to use "or" under conditions and paste the three conditions in there, like that just ONE of all conditions have to be true to execute the trigger. i think thats what you want to achive :) right now ALL conditions must be true, whats impossible.

    That's the answer you are looking for.

    Posted in: Triggers
  • 0

    posted a message on Death of a *special* unit to trigger defeat?

    Mayhap. The note at the end was essentially that I can't remember if player 1 is 1 as integer form, or 0 or integer form. Try using heroes[1-4] instead of heroes[0-3].

    Posted in: Triggers
  • 0

    posted a message on Very basic questions....

    [My explanation is a little more complex than PhantomInfern, but I'm quite sure they're both still right...]

    An action basically is exactly what it implies: It acts upon data and fields you give it. A function, more often than not, is what most of the actions are based upon.

    A returning value is just the value that a function returns to whatever it is being called for. For example, let's say you have a trigger that says this:

    Events - Unit - Any Unit Dies
    Local Variables
    Conditions
    Actions - If (Triggering Unit) == Marine, then Player - Modify player (Owner of (Killing unit)) Minerals: Set To 50
    

    In that trigger, we have several functions and returning values.

    Our killed unit will be a marine, as shown above (a more logical way to put this would have been to remove the if then else statement and put the "(Triggering unit) == Marine" in the Conditions portion, but I went this route). The unit that killed this marine will be a carrier owned by player 10.

    Triggering unit is a functions, as well as Killing unit, and Owner of x. Each of them return a specific value.

    Triggering unit returns a specific Unit type (this means that it returns the exact unit who caused the trigger. There's another "Unit type value" that relates to any unit of that type (i.e. Marine, Zergling, Zealot), this one returns MarineX or Marine Y or Zergling X or Zergling Y, or Zealot X or Zealot Y, etc.) value, and returns whatever unit caused the event to trigger (in this case, a unit dying caused the trigger to trigger). In the if statement, I was checking to see if that returned value was equal to a Marine, and if so, to continue with the rest of the statement.

    Killing Unit returns a specific Unit type based on the specific unit who killed the triggering unit. I used inside of another function, "Owner of Unit," which will return a integer value based on what player owns the "Killing unit," or unit who killed our triggering unit.

    I hope that wasn't too confusing. :I

    To answer your last question, a constant variable means that whatever you set it to when you create the variable, it can not be changed again unless you edit the variable itself. Trying to change the variable through a trigger will result in errors. These types of variables are useful for variables that will never change, and ones that you want to always stay the same regardless of what you try to do to them.

    Posted in: Triggers
  • 0

    posted a message on Death of a *special* unit to trigger defeat?

    1: This is actually accomplished not via triggers, but by an option in the Map menu. Open the Map menu, select Team Placement (Advanced), and link two allied bases to each other. This should work. (I think, I've not actually tested it, but I'm pretty sure that's what it's for.)

    2: A little more complicated indeed. But this should do it (Note: There is a little extra in here to accommodate for part 3)

    First, create a Unit Array variable. Mine is named "heroes." It needs an index of 3.

    Events
    	Timer - Elapsed time is 0.0 Game Time seconds
    Local Variables
    Conditions
    Actions
    	Player Group - Pick each player in (Active Players) and do (Actions)
    		Actions
    			General - If (Conditions) then do multiple (Actions)
    				If Then Else
    					General - Else if (conditions) then do (Actions)
    						Else if
    							(Race of Player (Picked Player)) == Protoss
    						Then
    							Create 1 Zealot for player (Picked Player) at (Start location of player (Picked player)) facing 270.0 degrees (No Options)
    							heroes[(Picked Player)] == (Last created Unit)
    					General - Else if (conditions) then do (Actions)
    						Else if
    							(Race of Player (Picked Player)) == Terran
    						Then
    							Create 1 Marine for player (Picked Player) at (Start location of player (Picked player)) facing 270.0 degrees (No Options)
    							heroes[(Picked Player)] == (Last created Unit)
    					General - Else if (conditions) then do (Actions)
    						Else if
    							(Race of Player (Picked Player)) == Zerg
    						Then
    							Create 1 Zergling for player (Picked Player) at (Start location of player (Picked player)) facing 270.0 degrees (No Options)
    							heroes[(Picked Player)] == (Last created Unit)
    

    3: If you followed that last bit, this one is really easy:

    Events
    	Unit - Any Unit dies
    Local Variables
    Conditions
    Actions
    	General - If (Conditions) then do multiple (Actions)
    		If Then Else
    			General - Else if (Conditions) then do (Actions)
    				Else If
    					(Triggering unit) == heroes[0]
    				Then
    					Game - End game in Defeat for player 1 (Show dialogs, Show score screen)
    			General - Else if (Conditions) then do (Actions)
    				Else If
    					(Triggering unit) == heroes[1]
    				Then
    					Game - End game in Defeat for player 2 (Show dialogs, Show score screen)
    			General - Else if (Conditions) then do (Actions)
    				Else If
    					(Triggering unit) == heroes[2]
    				Then
    					Game - End game in Defeat for player 3 (Show dialogs, Show score screen)
    			General - Else if (Conditions) then do (Actions)
    				Else If
    					(Triggering unit) == heroes[3]
    				Then
    					Game - End game in Defeat for player 4 (Show dialogs, Show score screen)
    

    I'm pretty sure that should work 100% for you.. The only questionables is that I'm unsure of part 1, and for part 2, it's possible players might actually start at "1" instead of 0, so you'll have to make the index size 4 and then add one to each of the individually referenced "heroes[x]". Other than that, it should work like a charm.

    Posted in: Triggers
  • 0

    posted a message on Simple Heal Zone

    Another way would be to do essentially as OneSoga said, except change 'Unit - Set (Picked unit) Life (Percent) to 20.0' to "Unit - Set (Picked unit) Life (Percent) to pylonDestroyed(real variable, default or initialize value of 20.0)' or something similar, and then in another trigger, have it add a real value of 20.0 for each pylon that the player(s) destroy.

    Posted in: Triggers
  • 0

    posted a message on Random Spawn Locations help
    @mcmelord: When making a variable, there's an option to make an array. The index just refers to the specific part of the array. varriableArray[indexNumber]
    Posted in: Triggers
  • 0

    posted a message on Adding event to trigger through triggers.
    @dudeim: Ask in the Galaxy Scripting section.
    Posted in: Triggers
  • 0

    posted a message on Random Spawn Locations help
    @mcmelord: Not too hard... Except for the possibility of the building itself.... First, you're going to need an 11 index point array variable, and a little initializing with it. In your initialize, you're going to take each point that you're going to have as a starting place and place it in a separate index in your array, starting at 0 for the first point, and ending at 11 for the final point. Then, in another trigger which determines where your going to start, you're going to need 3 local variables: an integer named random, an integer named i, and an integer named players. In your actions, your going to want the following: Variable - Set players = (Number of players in (Active Players) General - For each integer i from 0 to players with increment 1, do (Actions) Actions Variable - Set random = (Random integer between 0 and 11) Unit - Create 1 Command Center for player i at point[random] using default facing (Under Construction) That is essentially it. The Command Center can be replaced with whatever building you're intending it to be. But here is the hitch: if it's a terran building, you'll need to also create an SCV to start work immediately on it, or it won't ever complete, where as the other two races will not need a unit to do it (using standard SC2 rules.) So... to do that, you could just add another unit create and issue a smart command on the building.... so you'd need a fourth local variable that would be a unit.... and your new action list would look like this... Variable - Set players = (Number of players in (Active Players)) General - For each integer i from 0 to players with increment 1, do (Actions) Actions Variable - Set random = (Random integer between 0 and 8) Unit - Create 1 Command Center for player i at point[random] using default facing (Under Construction) Variable - Set building = (Last created unit) Unit - Create 1 SCV for player i at point[random] facing 270.0 degrees (No Options) Unit - Order (Last created unit) to (Smart Command targeting building) (Replace Existing Orders) Anything else that confuses you, or if this isn't what you were looking for, let us know and I'm sure we'll try to help.
    Posted in: Triggers
  • 0

    posted a message on Adding event to trigger through triggers.
    @dudeim: Pretty sure it's not possible. What you could do instead is make two triggers that are essentially the same, just with the added event, but have the added even one turned off until you need it, and then turn on the one with the added event and turn off the other one. Or just have a separate trigger with the added event as the only event but is normally turned off and turned on when needed...
    Posted in: Triggers
  • 0

    posted a message on [Triggers?] Unit Vetrancy

    @FishFuzz99: Go

    There probably is, but I've not experimented with it. As for where this should go, most likely the Data development forum.

    Posted in: Triggers
  • 0

    posted a message on Dont allow selection changes

    @XenTwitch: Go

    Event -> Unit Selection -> Unit is Clicked -> Whatever player

    Action -> Unit Selection -> Deselect Units -> All units for (Player) Action -> Unit Selection -> Select Unit -> (Unit) (Player)

    If your unit isn't a static unit on the map, you'll probably need another trigger to link the unit you're aiming for into a variable and use that as the Unit. You can also add a condition to see if clicked unit =/= player's unit to prevent the trigger from firing whenever they select their own unit. That should fix the problem... I'm unsure if there's a way to simply lock it, though.

    Posted in: Triggers
  • 0

    posted a message on Removing Units and Creating Respawn Timer

    @user_877009: Go

    One way may be to have any unit or building whenever a building is created/unit trained said player creates into a unit group, and then when that player wants to re choose their class, destroy/remove every unit in said unit group.

    As for the timer, I'm confused as to what you are asking for. Like a cooldown on how often they can do this? Or if they get destroyed, x amount of time before units start to respawn again?

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