• 0

    posted a message on [Data] Tint Colo Beam

    @wowacesucksmassivekok: Go

    In "Events +" of the beam create a new event "Actor Creation" with action "Set Tint Color", setting the colour to what you want. Be aware however that this won't look very good, since it just puts a blanket tint over the beam to your chosen colour, I suspect you'd have to mess around with textures to get it to look good, or they may be some option I'm missing.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger + General] Ringwars

    @Peetahh: Go

    "Stats - Supplies" is a property in the "Units" section of the data editor. It will be something negative to start with, since the units are removing supply.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Data] Adjust Flying Height in Actor Event?

    @Zackreaver: Go

    What about

    Height Change
        Events
            Unit - Any Unit uses SCV - Build Supply Depot at Generic1 - Any stage (Ignore shared abilities)
            ...<Same for all build commands>
        Local Variables
        Conditions
        Actions
            Unit - Add 1 <Height Change Behavior> to (Triggering unit) from (Triggering unit)
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger + General] Ringwars

    @Peetahh: Go

    1) I'm assuming your super monster is placed at Point 001 when the map starts? If so you can simply set your kill trigger to kill a value from the list in the action. If not, create a global variable of type unit and save the super monster to it when it spawns, then kill the unit of the value in the variable after 1 minute.

    2) I'd suggest using the data editor over triggers for this. Create two effects, 'Healing Aura (Heal)' of type "Modify Unit" with "Effect - Vitals +" set to "(0|0|0):(0.05|0|0)" (this will heal 5% of the units health), and 'Healing Aura (Search)' of type "Search Area". Set the area to have the desired radius and the effect to 'Healing Aura (Heal)'. Then create a behaviour 'Healing Aura (Behavior)' of type "Buff" with "Effect - Effect - Periodic" set to 'Healing Aura (Search)', "Stats - Duration" set to "-1.0000" and "Stats - Period" set to "1" (or whatever you want to tick frequency to be). Then give this behaviour to your healing fountain/main base in the "Behavior - Behaviors +" section of the unit. For clarities sake the attached map has this behaviour on a medivac.

    3) Set the "Stats - Supplies" of all units to "0".

    4) Use an event which will fire when the building is built, e.g. "Unit Is Created" event with ability set to whatever the build ability of you map is. Use a condition to check if it's of one of the types that should spawn a hero and if it is spawn a hero next to it with a "Create Units With Default Facing" action, setting the player to "Owner of (Created Unit))".

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Data] Adjust Flying Height in Actor Event?
    Quote from Zackreaver: Go

    I had thought of this, but I could not find a quick way to make the behavior apply for when I use it, see I'm having the animation play when the "Colony Ship" builds a "City" to make it seem like the colony ship is landing in order to construct a new city, so as of now I have the event playing when the build ability is doing it's .workerstart.

    You could make an apply behaviour effect which is run in a set together with the 'build a city' effect, giving it a duration equal to the build time.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger] Limit on arrays?

    Whilst you can't have actual dynamic arrays, you can simulate them using the data tables functions/actions. I also had this problem in one of my maps (declaring a large number of static arrays to compensate for the lack of actual dynamic arrays), which caused me to investigate them in the first place. See this post for how to simulate a dynamic array using the data tables, which should relieve the problem unless it's caused by something else entirely, or you are using more than the 440000ish variable limit.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger]How to call a function / action definition ?

    @TheLynxy: Go

    Functions and actions are different objects. A function takes some input parameters and returns a value, set in the "Return Type: <type>" field. An action takes some parameters and does something, but doesn't return any value. Looking at the above screen shot you have defined a function and are attempting to call it as an action, which doesn't work.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Solved][Data]Creating a permenent beam

    @SBeier: Go

    Having looked at it a bit closer I've found a workaround. Create two validators, one of the type "Unit Filters" with "Validator - Filters" set to "Excluded: Dead" and "Validator - Unit +" set to "Target", the other of the type "Combine", "Validator - Type" set to "And" and "Validator - Combines" set to "(Caster Not Dead|<The first validator>)".

    Set the period of the persistent effect to be something short (0.5s seemed to work for me) and set the periodic validator to the combine validator you just created.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Solved][Data]Creating a permenent beam

    @SBeier: Go

    To create a permanent beam, use a persistent linking the caster and target units. Create a "Beam (Simple)" actor which runs the "Attack" animation, "Variation 02" (others may work) continuously whilst it exists and have its creations and destruction tied to the persistent's starting/stopping. Then have your ability fire the persistent effect at the target unit to create a beam between the two. Have a look at the "Beam" ability in the attached map if this isn't clear.

    It's on the "Research Blink" button if you want to see it.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Data] Adjust Flying Height in Actor Event?

    @Zackreaver: Go

    You could also use a buff to change the units height. It's under "Behaviour - Modification +", "Unit".

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Triggers] Using data tables in triggers

    @gizmachu: Go

    You can only associate one value with any given string at a time. The code you suggested would simply overwrite the value 5.0 <real> with 3 <int> and attempting to recall the real value would return 0.0.

    Posted in: Tutorials
  • 0

    posted a message on [Trigger] Trigger is causing the game to freeze.

    @Skittles17: Go

    Three thoughts:

    1) Is the "/" character allowed in a variable name? It's possible, though unlikely that this is causing it to fall over.

    2) Line 32.

    Unit - Change (Last created unit) height to (Init Height - (Ground height at (Position of (Triggering unit)))) over 0.0 seconds
    

    Are you sure you can pass "Triggering unit" into a custom action?

    3)

    Variable - Set Point3 = (Point1 offset by Spacing towards (Angle from Point1 to Point2) degrees)
                    Variable - Set DistanceBetweenPoints = (Pathing cost from point Point3 to point Point2)
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            DistanceBetweenPoints > 0.0
                        Then
                            Unit - Create 1 Zergling for player 1 at Point3 facing 270.0 degrees (No Options)
                            Unit - Change (Last created unit) height to (Init Height - (Ground height at (Position of (Triggering unit)))) over 0.0 seconds
    

    Is this guaranteed to actually terminate? Unless I'm missing something about what one of these actions does I don't see anything that would exit the loop after a zergling has been spawned, rather than just spawning them endlessly.

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Triggers] Using data tables in triggers

    [This possibly belongs in the wiki, but there does not seem to be a relevant page for it.]

    Data tables are a list of values associated with a string used to access the given value. As with standard variables there are two kinds of data table; the global data table, which is accessible from any trigger, and the local data table, which can only be accessed from within the trigger in which the values in it were stored.

    In terms of basic functionality the data tables behave in much the same way as variables. The action

    Save Data Table Value (Real)
        Value: 5.0
        Name: "x"
        Scope: Global
    

    is almost exactly the same as

    Set Variable
        Variable: x
        Value: 5.0
    

    however there are some important differences, which allow the data table to be used with much greater flexibility.

    First, when we store a value in the data table we simply assign it a string as we are saving it. There is no need to first create a blank entry, as an equivalent action to initialising a variable.

    Secondly, we can perform any string manipulation we wish at the time of saving, recalling or otherwise acting on a data table entry. This allows us to simulate a number of features galaxy otherwise lacks, most notable dynamic arrays. For example consider the following trigger:

    Unit Store
        Events
            Unit - Any Unit Enters (Entire map)
        Local Variables
            i = 0 <Integer>
            Player = (Owner of (Triggering unit)) <Integer>
        Conditions
        Actions
            General - While (Conditions) are true, do (Actions)
                Conditions
                    (("UnitStoreP" + IntToString(lv_player) + "I" + IntToString(lv_i)) value exists in the Global data table) == true
                Actions
                    Variable - Set i = (i + 1)
            Data Table - Save (Triggering unit) as ("UnitStoreP" + IntToString(lv_player) + "I" + IntToString(lv_i)) in the Global data table
    

    The strings here are produced as a Custom Script. Strings are entered directly within quotation marks. “+” is used to conjoin strings, the same as the “Combine Strings” function. “IntToString(<int>)” returns a string from the given integer, eg IntToString(5) == “5”. lv_<Script Identifier> is used to access a given local variable. The scrip identifier is found in the details of the variable and by default is the name of the variable with no spaces and beginning with a lower case letter, so "My First Variable" would become "myFirstVaraible". gv_<Script Identifier> and lp_<Script Identifier> are used to access global variable and parameters (for custom actions) respectively.

    The condition “Data Table Value Exists” allows us to check whether we have already store a value in the pseudo-array at values of i, incrementing until we reach an unused value through a while loop.

    Whilst the data tables are more flexible than standard variables, they also have to be treated with more care. In order to recall an entry in the data table the string must be exactly the same, including capitals, spaces, punctuation etc. Furthermore the value in the data table has a type associated with it, however it will not return an error if you try to implicitly change this type. For example if we have and integer n then

    Set Variable
        Variable: n
        Value: Value From Data Table (Integer)
            Name: "x"
            Scope: Global
    

    will set n to be 0, the default for an integer, not 5, since 5.0, a real value, is stored in the data table. You can check the type of value stored in the data table with the “Type Of Data Table Value” function.

    To remove a specific data table value use the “Remove Data Table Value” action and to clear a data table use the “Clear Data Table” action.

    Posted in: Tutorials
  • 0

    posted a message on [Help] selecting triggers in increments

    @Chrinux: Go

    You could simply nest all of the if statements, so that instead of

    if {
       level = [level number according to trigger];
       then {
          while (level = [level number according to trigger]{
             make the level;
          }
       }
       else {
          run [trigger of next level];
          }
       }
    

    you have

    if {
       level = [1];
       then {
          while (level = [1]{
             make the level;
          }
       }
    else {if {
           level = [2];
           then {
              while (level = [2]{
                 make the level;
              }
       }
    else {if {...
    

    Thus you would only need 1 trigger, rather than a full set of different ones.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Unit has effect/buff condition?

    @zeredek: Go

    The condition you want is called "Unit Has Behaviour".

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