• 0

    posted a message on How to detect when an Archon is finished merging?

    @Lucavious: Go

    No problem.

    What are you working on, if you don't mind me asking?

    Posted in: Triggers
  • 0

    posted a message on How do I check if it's a player's first time playing

    @kenxftw: Go

    When you open a bank you open it for a specific player, thus you cannot check if a key exists "for a specific player". However, you can check for a key in the opened bank so you just open the bank one player at a time, using the same loop as before.

    See example:

    Melee Initialization
        Events
            Game - Map initialization
        Local Variables
            GOLIATH_NATIONAL_BANK = No Bank <Bank>
            THE_KEY_TO_AWESOMENESS = "THE_KEY_TO_AWESOMENESS" <String (Constant)>
        Conditions
        Actions
            General - Pick each integer from 1 to 5, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            (Status of player (Picked integer)) == Playing
                        Then
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    (Bank "GOLIATH_NATIONAL_BANK" exists for player (Picked integer)) == false
                                Then
                                    ------- Player does NOT have a bank and has NEVER played this map before
                                    -------  - Create a new bank for the player
                                    -------  - Initialize the bank contents for the new player
                                    -------  - Save the bank
                                Else
                                    Bank - Open bank "GOLIATH_NATIONAL_BANK" for player (Picked integer)
                                    Variable - Set GOLIATH_NATIONAL_BANK = (Last opened bank)
                                    ------- The bank is now opened for the SPECIFIC player.
                                    ------- Everything you check for below this point in this bank is tied to this player.
                                    General - If (Conditions) then do (Actions) else do (Actions)
                                        If
                                            (Bank GOLIATH_NATIONAL_BANK has THE_KEY_TO_AWESOMENESS in section "whatever_section_you_want") == false
                                        Then
                                            ------- No key
                                        Else
                                            ------- Key!
                        Else
    
    Posted in: Triggers
  • 0

    posted a message on Fake death

    @Selfcreation: Go

    If you need a template for the Feign Death ability, look up the "Incapacitated" behavior the 4 heroes get if they receive a killing blow in the "kill all Nydus Worms" misison on Char. You have to enable the Liberty Story (Campaign) dependency to see it (File -> Dependencies -> Add Standard [Liberty Story (Campagin] -> OK [Loading dependency]).

    1. Duplicate the Incapacitated behavior and name it something like Feign Death.
    2. Locate "Modification - State Flags" and open the dialog containing the Object Values. Scroll to the bottom and set "Unselectable" and "Untargetable" to Enabled.

    Now whenever the Feign Death behavior is active on a unit it cannot be targeted or selected (drag selection for instance) by anyone.

    Posted in: Triggers
  • 0

    posted a message on How do I check if it's a player's first time playing

    @kenxftw: Go

    If you make a condition (compare) and select "Bank" under Label, you can see the whole list of checks you can perform. In case of the Key check, which you're asking for, there are:

    • Bank Key Name
    • Bank Key Exists
    • Bank Key Count

    and:

    • Bank Section Name
    • Bank Section Exists
    • Bank Section Count
    Posted in: Triggers
  • 0

    posted a message on How to detect when an Archon is finished merging?

    @Lucavious: Go

        Events
            Unit - Any Unit construction progress is Completed
        Local Variables
        Conditions
            (Unit type of (Triggering progress unit)) == Archon
        Actions
            Debug - Display "Archon merge complete" as debug output using Type 1, and Do display it in the game window
    
    Posted in: Triggers
  • 0

    posted a message on Trigger return!
    Quote from grenegg: Go

    @Kafoso: Go

    Okay! FINE BE THAT WAY. What happed was it gave me an error saying that a trigger was returning the wrong type of variable. Triggers always return true, so I thought that a little weird. Also I got "can only pass basic types" errors randomly throughout my code.

    Now we're getting somewhere. But still, it's hard to provide any help as you get the "errors randomly". If you have trouble finding out when or why the errors occur then locate the trigger which causes this to happen. In extreme cases you may have to disable other triggers one by one, and check if the errors still occur or if they changed.

    And please drop the attitude. I do not know how far your skills in programming and trigger editing go, so I bring things to a certain level where we certainly can understand each other. Trust me, I've pulled out much hair from similar problems, but there's always just one to blame: yourself - the programmer. :)

    If you find a flaw in the editor then you should definitely write down every and any problems you encounter, documenting everything with screenshots and the like. However, I still highly doubt this is the case.

    Are you using any tools for revising previous versions of your map? If not I can recommend: http:www.dropbox.com/

    Posted in: Triggers
  • 0

    posted a message on Trigger return!

    @grenegg: Go

    Then lay down the problem, bit for bit, instead of writing some half finished sentences that barely make sense. Use sreenshots, code examples, error messages, etc.

    Saying something like "the compiler is doing something wrong"... That's just dropping the ball.

    Posted in: Triggers
  • 0

    posted a message on How do I check if it's a player's first time playing

    @kenxftw: Go

            General - Pick each integer from 1 to 15, and do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            (Status of player (Picked integer)) == Playing
                        Then
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    (Bank "GOLIATH_NATIONAL_BANK" exists for player (Picked integer)) == false
                                Then
                                    ------- Player does NOT have a bank and has NEVER played this map before
                                    ------- 
                                    -------  - Create a new bank for the player
                                    -------  - Initialize the bank contents for the new player
                                    -------  - Save the bank
                                Else
                                    ------- Player DOES have a bank and HAS played this map before
                                    ------- 
                                    ------- - Open the bank and load its contents
                        Else
    
    Posted in: Triggers
  • 0

    posted a message on Trigger return!
    Quote from grenegg: Go

    @TheAlmaity: Go

    So basically the editor is compiling wrong :P and I'm mad.

    I seriously doubt this is the case. Human error and going blind from looking at the same code over and over is much more likely. We've all been there!

    I bet you accidently selected the "Return Type" and set it to something different from what you're returning in the code.

    Posted in: Triggers
  • 0

    posted a message on Attributes increase Ability Effect

    @admielke: Go

    You create a behavior increasing the stats you want, health (called Life and found under Vitals) for instance, and make it stack infinitely. Each stack will grant 5 health, as you pointed out.

    Then create a trigger that is called when the respective unit is created (Auto Turret). Count the number of attribute points (Strength in this instance) on your hero/caster unit and apply the behavior to the newly created unit. The stack count of the behavior corresponds to the number of attribute points.

    This same trigger can be used for the two Strength and two Dexterity amplifiers.

    The Wisdom is quite different, though. You have to set the duration of the ability Guardian Shield using the Catalog, and this must be done prior to the cast of the ability. If your Wisdom attribute doesn't fluctuate very much, e.g. it only changes when a user puts attribute points in it or equips an item, you may do a trigger that updates the affected abilities upon changing the Wisdom levels. However, if it does fluctuate a lot (e.g. abilities increase and decrease the levels of Wisdom) you should change the levels using the Catalog prior to casting the ability - that is if you are able to predict when this is going to happen.

    Posted in: Triggers
  • 0

    posted a message on SCRIPT LOAD FAILED: trying to access an element past the end of an array

    That post reminds me of Facebook status updates: "I state something random that no one will understand :DDD"

    What's the issue, mate?

    Posted in: Triggers
  • 0

    posted a message on change unit property in trigger

    @kmkkmk: Go

    "Unit properties" are specific things, in regards to the SC2 Map Editor. A unit's properties are the following:

    • Bounty (Custom)
    • Bounty (Minerals)
    • Bounty (Terrazine)
    • Bounty (Vespene)
    • Bounty (XP)
    • Carried Custom Resource
    • Carried Minerals
    • Carried Terrazine
    • Carried Vespene
    • Energy
    • Energy (Percent)
    • Energy Regeneration Rate
    • Experience
    • Height
    • Kills
    • Level
    • Life
    • Life (Percent)
    • Life Regeneration Rate
    • Maximum Energy
    • Maximum Life
    • Maximum Shields
    • Movement Speed
    • Resources
    • Shields
    • Shields (Percent)
    • Shields Regeneration Rate

    As Kueken531 says, you may change these values using the catalog. I used this video tutorial for learning how to work with the Catalog feature: http:www.youtube.com/watch?v=64x8jRL5np0

    Posted in: Triggers
  • 0

    posted a message on Copying code between maps

    @jcraigk: Go

    If you just need a few lines of code it's easier to copy the entire trigger/function/action definition from the map containing the code you need (source map). Hereafter you change the active map to your own map (target map) and insert the code.

    But first you have to:

    1. Find all the global variables used in the code you copy from the source map. You have to copy these to your own map first.
    2. Check if the global variables you just copied are initialized elsewhere in the source map, e.g. a unit variables points to a specific unit. Keep this in mind so that you can initialize the variables you copied correctly.
    3. Select the trigger containing the code you need in the source map and copy the whole thing - not just the code part you need. By doing this you will also copy the local variables, keeping the references.
    4. Go to the target map and insert the trigger.
    5. Delete the trigger code parts don't need, tidy up the code and voilĂ .

    The red lines appear when a reference is broken. This should no longer happen as you've copied all the variables and the references to these are intact. However, if an action points to a unit in the map, for instance, you may need to copy this unit as well or insert a replacement in your map and make the action in your trigger point to this unit.

    Posted in: Triggers
  • 0

    posted a message on Need Assistance with Trigger - Move a Map region to Unit

    @GhostlyMarine: Go

    You can do a "Pick Units Matching Condition" with a condition only selecting the unit type of your Observer. This can be cumbersome, though.

    I suggest you store the Observers (those units that poop out the other units you wanted) in global variables upon map initialization or when the Observers are created (use an array for this). This way you can simply use this variable (array) to refer to your pooping Observer. If you use an array (and you should!!), the index number should be the player's number. "Triggering Player" is an integer, and yes you guessed right, it's the players number. :)

    Good luck!

    Posted in: Triggers
  • 0

    posted a message on Need Assistance with Trigger - Move a Map region to Unit

    @GhostlyMarine: Go

    First of all, you don't need a moving region for this. You may simply do something like this:

            Unit - Create 1 <Unit> for player <1> at (Position of <Unit>) facing 270.0 degrees (No Options)
    

    If you want to just move the region from time to time, you may use:

            Region - Move <Region> to (Position of <Unit>)
    

    And as Tekaichi says, you may also attach a region to a unit, causing it to follow it around.

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