• 0

    posted a message on Air units and flying in a single direction

    Hello,

     

    If I understand well, your unit is "Turnable" (this is a Unit flag) but something is missing for your custom "bomber".

    I presume your Weapon does some Effects. Maybe even a Behavior is attached.

     

    First thing, make sure you set for your Weapon the value "Moving" to the field "Allowed Movement".

    If that only responds to your expectation, you can stop here.

     

    If not, to make it simple, force the unit to move :

    • Create an Effect of type "Give Order" which executes the Ability "Move".
    • Create an Effect of type "Persistent" with a sufficient offset (tweak it) and make sure to set Target offset to the caster (that will use the current orientation of your unit).
    • You should already have an Effect of type "Set". If not, create one. Add the Effect of your Weapon and then the new "Persistent" Effect.
    • In your Weapon, change the Effect with the new "Set" Effect.

    You will need to play with some values but the idea is here. Make the "bomber" move to your destination.

     

    Advanced tips :

    • You can create a Behavior which executes the "Persistent" Effect. Like this, you can affect your unit with some more changes. Don't forget to set a duration (or a custom removal). For example, you can temporarily disable "Turnable".
    • Create an Effect of type "Add Behavior" and do the changes in your "Set" Effect.

     

    Have a nice day.

    Posted in: Triggers
  • 0

    posted a message on Upgrades using triggers

    Hello,

     

    In Trigger Editor, you can only set the level of an upgrade. And some more things.

    So I don't recommend to use triggers for your goal.

     

    In Data Editor, make sure you selected your "Source" instead of "All data". Select the last option which is the map name.

    Then find your upgrade, it should appear in green.

    In fact, the color has meanings :

    - if the name is green = changes for a built-in data, changes from your manual work.

    - if the name is blue = changes for a built-in data, changes from a specific dependency (see note below). If you change something, it will duplicate it and create a copy for your mod or your map. Only 1 copy per data ID (that means you CANNOT change all dependencies' copies).

    - if the name is grey = no changes for a built-in data.

     

    Okay, that aside.

    Still in the Data Editor, in the "Upgrade" tab, make sure you add your affected units. That's all.

    If necessary, duplicate the upgrade. Don't forget all other data needed to its work (Ability, button, prerequisite ...).

     

    An upgrade is very easy to manipulate.

    All the complex work is on "Prerequisites" but you don't seem to use them here, so let's cut that out.

     

    NOTE :

    That's why "Source" is important because you can filter a dependency. And conversely, you can see multiple times the same data because there are multiple sources = multiple dependencies that import their data.

     

     

    Have a nice day.

    Posted in: Triggers
  • 0

    posted a message on Portrait Lock

    Hello,

     

    2 things, depending on what your portrait is built.

     

    Trigger Editor :

    If your portrait IS NOT the standard unit portrait BUT a hand-made one with triggers, you should not have any issues.

     

    Data Editor :

    If your portrait IS the standard unit portrait, your issue comes from the actor of your unit, that is to say the vehicle (a tank or else).

    So you have to create a specific unit actor for your Hero / Special unit with that portrait.

     

    1. Be sure to look for an Actor of type Unit.
    2. Look for the field "Art : CActorUnit_PortraitModel" (Raw name, CTRL+D) and set the expected portrait model.
    3. Be advise that a Unit cannot have 2 Actors of type Unit. So you have to play with Actor Events to destroy and to create the correct Unit Actor when applied.

    That is the simple method.

     

    Advanced tips :

    • Create an Actor of type Event Macro (or Macro) to prevent yourself a long and repetitive hard work.
    • Do the step 3 above.
    • Add your Event Macro in all your units that your Hero / Special unit can "get in a vehicle".

    Expert tips :

    • In your Actor, you can create an Event with as event Signal (for example, that always easy for testing) and as action "ModelSwap".
    • Set in the "Target" field the value "::PortraitGameSelf" (see note below).
    • To be honest, that needs test and may not work.

    NOTE :

    They are called "System tags" and reference something by the system. For instance, for portrait you can find "::PortraitGame" (Multiple usage), "::PortraitGameSelf" (To set for the current Unit Actor, individually) and "::PortraitGameUnit" (To set for all instances of this Unit Actor). In general, the name is self-explanatory.

     

     

    Have a nice day.

    Posted in: Triggers
  • 0

    posted a message on Any way to hide a mesh on a model ?

    Hello,

     

    I don't think you can change a model data with triggers, I don't remember any function that could do that.

     

    However, in the Data Editor, you might find something that might help you.

    In the Model tab, try to play with the field "Texture : CModel_TextureInfos +" (Raw name, my editor is half in french so I can't write the exact english name).

     

    If that works fine, this implies to create N models with all your expected meshes, then you will need to play with Actor Events in order to swap the actor's model.

     

    AND from this point, during your game, you can trigger actions to, for example, send a signal to your actor which swap your model.

     

    EDIT : ONE MORE THING

    In your actor Events (field), you can find some instructions about model materials.

    You can indeed apply or remove materials.

    And since its actor Events, you can add signal events to catch sent from triggers and do your thing with materials.

     

    Hope you can find your way.

    Have a nice day.

    Posted in: Triggers
  • 0

    posted a message on Make a behavior be activated based on the number of charges available on an ability ?

    Hello.

     

    I don't know why you need to do this. Technically, when charges are at 0, you're not supposed to be able to use that weapon anyway.

    But okay.

     

    Use a validator of type "CValidatorUnitCompareChargeUsed" which checks :

    - When it's equal to 0

    - When it's greater than 0 (optional).

     

    Pay attention :

    > If you set an ability, the value for the field is the link in "Cost" field of your ability WITHOUT the prefix "Abil/".

    > If you don't set an ability neither a behavior, the value is the link WITH the prefix "Abil/".

     

    In addition to this, you need to create a new behavior that controls your weapon.

    Set modifications which deactivate the weapon. It should be temporary.

    And finally, set validator (deactivate) with "CValidatorUnitCompareChargeUsed" when EQ 0. If the validator is false, the behavior is deactivated. That means we deactivate the weapon when the behavior is active, when the validator is true and thus when charges EQ 0.

    Give the behavior to your unit.

     

    And that should wrap your request.

     

     

    Have a nice day.

    Posted in: Data
  • 0

    posted a message on Make gather give experience to veterancy behavior

    Hello.

     

    Hum ... . To be honest, what I'll write below will need some tests.

     

    When you collect resources, the collector does not deal damages.

    However, you can set an effect on an ability of type "Gather".

     

    Here's the idea :

    When a collector finished to gather, it deals damages. Of course, the resource unit is invulnerable with lots of HP. So, you need to use correct filters to deal damages to resource units. You can set HP regeneration to balance.

    It is important that the damages come from the player side, so that the effect owner remains the same.

     

    Tests :

    > When the effect is triggered ? It would be perfect if it's when the gathering is completed.

    > Deal damages increase veterancy ?

     

    It should not be that complex to set your idea.

     

    Have a nice day.

    Posted in: Data
  • 0

    posted a message on How to setup a decent AI to play against

    Hello.

     

    It's a combination of unit placements on the Terrain Editor, some actions in the Trigger Editor and unit waves from the AI Editor.

     

    A/ Terrain Editor :

     

    You need to give simple possibilities to your AI, when you preplace a unit, open properties and see AI tab.

    What you essentially need to know is preplaced units are subjected to initialized AI from trigger actions.

    The more you place, the more the AI can use.

    But this method has limits and was mainly how AI worked in Wings of Liberty.

     

    B/ Trigger Editor :

     

    You have multiple functions / actions in "AI" and "AI Advanced" categories.

    To quickly sum up, they are almost all what you can do in the AI Editor.

    I won't detail but the main purpose is to modify how an AI react according to events in-game. For example, after an objective is completed, you can remove a wave that orders to create an expansion.

     

    C/ AI Editor :

     

    Look at it, it's not that complex as it may seem to be.

    Let me make a bridge with another game, Command & Conquer. C&C used to built general factions and in its extension, you had 3 variations of each faction.

    In this StarCraft II, you have 3 races but Blizzard "innovated" with Commanders as variations of each faction.

    Now, think of AI Editor as a variation of faction editor.

    In this editor, you can create basic waves that imply any unit or building on various preplaced points in the Terrain Editor, configure many options and even make a link to any trigger.

     

    D/ Trigger Editor - The return :

     

    In fact, you will use AI Editor as a base for your waves. And, if you looked carefully, you must specify static elements like points. If you need to change some parameters of a wave, link that wave to a trigger and use actions to move some elements ... like points.

    As mentioned before, you have multiple functions / actions that are almost all what you can do in the AI Editor.

     

    Side note :

    > The string you can set at "custom data" for a wave is still mysterious to me. I know it will set a label to that wave in the Global scope (a shared memory) and that you can retrieve that label from a specific AI actions.

     

    So I don't recommend you to only create an AI from one or other editor but to mix editors.

    Have fun with it, try small waves and build piece after piece your AI of your dream.

     

    Have a nice day.

    Posted in: Data
  • 0

    posted a message on Map Transition Failed

    Hello.

     

    I never did a map transition.

     

    You may try with "Player 3" in 3rd slot.

     

    Choose 2 test maps and see if it's game issue or your player settings (match all columns but that would be absurd).

     

    Have a nice day.

    Posted in: Triggers
  • 0

    posted a message on How to load / save completed upgrades to Bank?

    Hello.

     

    An upgrade is defined by a level represented by an integer.

    You can save this integer in a bank with as key the name of the upgrade and as value this integer.

    At the start of your maps, you load the bank and retrieve the key / value. Then for each upgrade, you set the value.

     

    I recommend you to create an array of all upgrades you want to affect. Like that, you copy/paste that array from a map to another.

    And in a loop, set the upgrade to its correct retrieved value from the bank for the owner of the bank.

     

    Advanced notes :

    > If your upgrades are in a mod, you can create the script in that mod. No need to copy/paste the array.

    > Use "Convert Game Link To String" and "Convert String To Game Link", this should make the job. If not, don't rely on the upgrade name solely.

    > You can do lots with bank. Open in a text editor (like Notepad++) the bank to see how the file is (basically an XML file). Default path is "Documents/Starcraft II/Banks".

     

    Have a nice day.

    Posted in: Triggers
  • 0

    posted a message on How to make score result dialog?

    Hello.

     

    Multiple solutions to achieve this.

    Expert level : Use UI editor.

    Advanced level : Use dialogs and dialog items.

    Intermediate level : Use leaderboard + Screen button / image / label (in Dialog category).

    Novice level : Use leaderboard actions / functions.

     

    Side notes :

    > UI editor is not user-friendly.

    > Display screen button to create a button like in Terran campaign bonus mission.

    > Show/Hide screen button to show or hide a screen button.

    > Same with screen image / label.

    > "Leaderboard" is a kind of prefab dialog for easy usage.

     

    It would be VERY long to detail everything so I recommend you to read "Leaderboard" actions / functions in a first place.

    Posted in: Triggers
  • 0

    posted a message on A bug that causes all triggers to stop working

    Hello.

     

    I won't say "bug" but engine limits. I don't know why you would do that.

    Enable the debugger in editor config and look at it on runtime. You might find precious information like how many times a specific thread is checked and/or executed.

     

    Another thing, if you did an overflow, that means you need reached the maximum number of a thread. Pay attention to wait some time before creating new threads of a kind.

    Posted in: Triggers
  • 0

    posted a message on Empty Triggers Zone (F6)

    Hello.

     

    I got this kind of bug years before where the data editor where blank.

     

    I had to reinstall the game, with a perfect clear of SC2 files (aka windows reinstall). I didn't find a proper way to resolve it.

    Posted in: Triggers
  • 0

    posted a message on Trying to create Randomized Team colors for Players using "Send Actor Message"

    Hello.

     

    If I follow your prerequisites, you don't have to do that.

    You can set player's color with action "Player - Set Player Color" .

    You randomize the color at the start of your game.

     


     

    If you reaaaaally want to use that actor message (It sure is opens some possibilities), you need :

    - Global <Integer> "MAX_PLAYERS" set as a constant the maximum number of players.

    - Global array of <Integer> "Players_ColorId" with as size "MAX_PLAYERS". It will save the color Id for each player.

    - New action definition "Set Color to Players".

    - New action definition "Set Team Color To Player Actors".

    - Trigger "Initialization" where to set actions at the beginning of the game. Or equivalent.

    - Trigger "Unit Creation" with as event "Unit is Created" if you create units from in-game abilities.

    OR Action "Unit Creation" where you create units from the script.

     

    [X] Instructions for action "Set ColorId to Players" :

    > You must want a non repetitive random integer, and for that you need a local array of <Integer> "colors" with as size "MAX_PLAYERS".

     

    > In a "For" loop with local variable "i" from 1 to "MAX_PLAYERS", set "colors" to "i".

    > End "For" loop.

    > In a "For" loop with local variable "p" from 1 to "MAX_PLAYERS".

    > Set a local variable "randInt" from 1 to "MAX_PLAYERS".

    > In a "If Then Else" :

    > If :

    > Comparison like variable "colors[randInt]" is greater than 0.

    > Then :

    > Set "Players_ColorId[p]" to "colors[randInt]".

    > Set value "colors[randInt]" to value "-1" (I recommend to use "0" as a default/neutral value).

    > Else :

    > Modify "p" with value -1.

    > End "If Then Else".

    > End "For" loop.

     

    [X] Instructions for action "Set Team Color To Player Actors" :

    > Parameter of <Integer> "Player".

    > Parameter of <Actor> "SourceActor".

     

    > Switch on variable "Players_Color[Player]" from 1 to "MAX_PLAYERS".

    > Equals to 1 : Call function : "Send Actor Message" with message "SetTeamColorBlend" to "SourceActor".

    > ...

    > Equals to "MAX_PLAYERS" : Call function : "Send Actor Message" with message "SetTeamColorBlend" to "SourceActor".

    > End "Switch".

     

    [X] Instructions for trigger "Initialization" :

    > Call action : "Set ColorId to Players".

     

    [X] Instructions for trigger or action "Unit Creation" :

    > Call action "Set Team Color To Player Actors" with parameters : "Player" = "Owner of (Last created unit)" ; "SourceActor" = "Actor of unit (Last created unit)".

     


     

    Definition of action "Set ColorId to Players" is not optimal but since we don't have dynamic array, we cannot remove "-1" values in "colors".

    Plus, the array is small, it should not go over few seconds in worst cases.

     

    I wrote this from my head and tried to detail instructions.

     

    Hope you can achieve your goal.

     

    Have a nice day.

     

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