• 0

    posted a message on [Library] STARCODE v1.4

    The only thing I still do not understand about Starcode: how do you merge more values (say Played Games and Won Games) into one single encypted string, and even more important, how can you extract that exact value from the string being sure it's the thing you want, say Won Games? And, if for example I later add a third value into the string creating a new code, would that mess the old one, so that I am no more able to find the value of Won Games using the method used until that time?

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on Issue Order not working on changed ownership (SOLVED)

    Finally solved, basically recreating the order via Triggers; I'll put here the Trigger as public resource:

    Unit Train Change Owner
        Events
            Unit - Any Unit creates a unit with ability Barracks - Train or behavior No Game Link
            Unit - Any Unit creates a unit with ability Factory - Train (Factory) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Robotics Facility - Train (Robotics Facility) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Larva - Morph Unit (Larva -> Basic) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Nexus - Train Mothership or behavior No Game Link
            Unit - Any Unit creates a unit with ability NexusTrainMothershipCore (Unnamed) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Gateway - Train (Gateway) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Warp Gate - Train (WarpGate) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Stargate - Train (Stargate) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Starport - Train or behavior No Game Link
        Local Variables
            Order Count = 0 <Integer>
            Order = No Order <Order[31]>
        Conditions
            (Behavior that created unit) == None
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    ((Unit type of (Created unit)) is Worker) == False
                Then
                    Variable - Set Order Count = ((Count of orders on (Created unit)) - 1)
                    General - Pick each integer from 0 to Order Count, and do (Actions)
                        Actions
                            General - Switch (Actions) depending on (Target type for ((Created unit) order at index (Picked integer)))
                                Cases
                                    General - If (None)
                                        Actions
                                            Variable - Set Order[(Picked integer)] = ((Ability command for ((Created unit) order at index (Picked integer))))
                                    General - If (Item)
                                        Actions
                                            Variable - Set Order[(Picked integer)] = ((Ability command for ((Created unit) order at index (Picked integer))) targeting (Target item for ((Created unit) order at index (Picked integer))))
                                    General - If (Point)
                                        Actions
                                            Variable - Set Order[(Picked integer)] = ((Ability command for ((Created unit) order at index (Picked integer))) targeting (Target point for ((Created unit) order at index (Picked integer))))
                                    General - If (Unit)
                                        Actions
                                            Variable - Set Order[(Picked integer)] = ((Ability command for ((Created unit) order at index (Picked integer))) targeting (Target unit for ((Created unit) order at index (Picked integer))))
                                Default
                    Unit - Change ownership of (Created unit) to player 2 and Change Color
                    General - Pick each integer from 0 to Order Count, and do (Actions)
                        Actions
                            Unit - Order (Created unit) to Order[(Picked integer)] (After Existing Orders)
                Else
    
    Posted in: Triggers
  • 0

    posted a message on Issue Order not working on changed ownership (SOLVED)
    Quote from Forge_User_45840264: Go

    @alfx01: Go

    Are you sure that int he data editor "Abort on alliance change" is unchecked, because if it isn't, thats why it's not working.

    Yes but not every ability has that flag, Rally and Move don't have it, and that's fundamental.

    Posted in: Triggers
  • 0

    posted a message on Issue Order not working on changed ownership (SOLVED)

    Also, it can help specifying the ability in the Event, rather on a Triggering Ability Condition to stress CPU less, or it's the same?

    Posted in: Triggers
  • 0

    posted a message on Issue Order not working on changed ownership (SOLVED)

    I store my unit order in a variable with array size 31 (32 orders). So I then change the ownership of the unit to the player's ally. And I recall the variable to issue orders to the unit, so the order queue is not forgotten while changing owner. But this seems to be not enough, since units still not execute their order. I'm quite sure that the order variable store also the player who ordered, and if the player has no control on the new unit, the unit will not execute the stored orders. I can say this because the order list works when changing to an ally on which I have unit control, while are forgotten when I switch to an ally on which I have no control, or enemy, or neutral.

    I basically use this system to remember the rally point, but also on unit morphing order queue.

    How can I make the unit to properly execute their orders when ownership is changed?

    CODE:

    Unit Train Change Owner
        Events
            Unit - Any Unit creates a unit with ability Barracks - Train or behavior No Game Link
            Unit - Any Unit creates a unit with ability Factory - Train (Factory) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Robotics Facility - Train (Robotics Facility) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Larva - Morph Unit (Larva -> Basic) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Nexus - Train Mothership or behavior No Game Link
            Unit - Any Unit creates a unit with ability Gateway - Train (Gateway) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Warp Gate - Train (WarpGate) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Stargate - Train (Stargate) or behavior No Game Link
            Unit - Any Unit creates a unit with ability Starport - Train or behavior No Game Link
        Local Variables
            Order Count = 0 <Integer>
            Order = No Order <Order[31]>
        Conditions
            (Behavior that created unit) == None
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    ((Unit type of (Created unit)) is Worker) == False
                Then
                    Variable - Set Order Count = ((Count of orders on (Created unit)) - 1)
                    General - Pick each integer from 0 to Order Count, and do (Actions)
                        Actions
                            Variable - Set Order[(Picked integer)] = ((Created unit) order at index (Picked integer))
                    Unit - Change ownership of (Created unit) to player 2 and Change Color
                    General - Pick each integer from 0 to Order Count, and do (Actions)
                        Actions
                            Unit - Order (Created unit) to Order[(Picked integer)] (After Existing Orders)
                Else
    
    Posted in: Triggers
  • 0

    posted a message on Shared Nuke Ammunitions
    Quote from MaskedImposter: Go

    I'll throw out a guess.

    Perhaps you could use a remove charge from ability action.

    Yes but to use Nuke I still need the Ghost Academy to be owned by the owner of the caster unit. So it can't even be used before that. Anyway, I'll use the dynamic owner change. No worries.

    Posted in: Triggers
  • 0

    posted a message on Bank keeps resetting from test to test
    Quote from Elmaex: Go

    Banks cannot be loaded from extension mods.

    Really?? This is definitely the problem, then. My project is a mod.

    Posted in: Triggers
  • 0

    posted a message on Bank keeps resetting from test to test

    @Apollys: Go Of course I save my bank, right after saving a value in the bank, look at these lines from the second trigger of the code above:

       ------ Show tip for new players
            PickEachPlayerInGroup((PlayerGroupAll()))
                actions
                    IfThenElse()
                        if
                            Comparison(ruologiocatore[(PlayerGroupLoopCurrent())], ==, 0)
                            Comparison((BankValueGetAsFlag(banca[(PlayerGroupLoopCurrent())], "tips", "macro")), ==, false)
                        then
                            HelpPanelAddTip((PlayerGroupSingle((PlayerGroupLoopCurrent()))), (FormatTipTitle(consiglioMacroTitolo, 4)), consiglioMacroDescrizione, consiglioMacroTestoavviso, consiglioMacroIcona)
                            BankValueSetFromFlag(banca[(PlayerGroupLoopCurrent())], "tips", "macro", true)
                            BankSave(banca[(PlayerGroupLoopCurrent())])
    

    And yes, I checked my Documents/StarCraft II/Banks/MacroMicroExtension.SC2Bank for 20-30 times with different actions/orders, and I can assume that the bank resets every time I check any value or save it in the bank after a new loading. Tested on Battle.net too, same issue.

    Posted in: Triggers
  • 0

    posted a message on Bank keeps resetting from test to test
    Preparabanca
        Eventi
        Variabili locali
        Condizioni
        Azioni
            ------ Load
            BankLoad("MacroMicroExtension", 0)
            SetVariable(banca[0], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 1)
            SetVariable(banca[1], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 2)
            SetVariable(banca[2], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 3)
            SetVariable(banca[3], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 4)
            SetVariable(banca[4], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 5)
            SetVariable(banca[5], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 6)
            SetVariable(banca[6], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 7)
            SetVariable(banca[7], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 8)
            SetVariable(banca[8], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 9)
            SetVariable(banca[9], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 10)
            SetVariable(banca[10], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 11)
            SetVariable(banca[11], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 12)
            SetVariable(banca[12], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 13)
            SetVariable(banca[13], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 14)
            SetVariable(banca[14], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            BankLoad("MacroMicroExtension", 15)
            SetVariable(banca[15], (BankLastCreated()))
            BankOptionSet((BankLastCreated()), c_bankOptionSignature, true)
            ------ Reset corrupted banks keys
            PickEachPlayerInGroup((PlayerGroupAll()))
                actions
                    IfThenElse()
                        if
                            Comparison((BankVerify(banca[(PlayerGroupLoopCurrent())])), ==, false)
                        then
                            IfThenElse()
                                if
                                    Comparison((BankKeyExists(banca[(PlayerGroupLoopCurrent())], "games", "played")), ==, true)
                                then
                                    BankKeyRemove(banca[(PlayerGroupLoopCurrent())], "games", "played")
                                    BankSave(banca[(PlayerGroupLoopCurrent())])
                                else
                            IfThenElse()
                                if
                                    Comparison((BankKeyExists(banca[(PlayerGroupLoopCurrent())], "games", "won")), ==, true)
                                then
                                    BankKeyRemove(banca[(PlayerGroupLoopCurrent())], "games", "won")
                                    BankSave(banca[(PlayerGroupLoopCurrent())])
                                else
                        else
    
    MostraconsiglioComegiocare
        Eventi
        Variabili locali
        Condizioni
        Azioni
            ------ Show tip for new players
            PickEachPlayerInGroup((PlayerGroupAll()))
                actions
                    IfThenElse()
                        if
                            Comparison(ruologiocatore[(PlayerGroupLoopCurrent())], ==, 0)
                            Comparison((BankValueGetAsFlag(banca[(PlayerGroupLoopCurrent())], "tips", "macro")), ==, false)
                        then
                            HelpPanelAddTip((PlayerGroupSingle((PlayerGroupLoopCurrent()))), (FormatTipTitle(consiglioMacroTitolo, 4)), consiglioMacroDescrizione, consiglioMacroTestoavviso, consiglioMacroIcona)
                            BankValueSetFromFlag(banca[(PlayerGroupLoopCurrent())], "tips", "macro", true)
                            BankSave(banca[(PlayerGroupLoopCurrent())])
                        else
                    IfThenElse()
                        if
                            Comparison(ruologiocatore[(PlayerGroupLoopCurrent())], ==, 1)
                            Comparison((BankValueGetAsFlag(banca[(PlayerGroupLoopCurrent())], "tips", "micro")), ==, false)
                        then
                            HelpPanelAddTip((PlayerGroupSingle((PlayerGroupLoopCurrent()))), (FormatTipTitle(consiglioMicroTitolo, 4)), consiglioMicroDescrizione, consiglioMicroTestoavviso, consiglioMicroIcona)
                            BankValueSetFromFlag(banca[(PlayerGroupLoopCurrent())], "tips", "micro", true)
                            BankSave(banca[(PlayerGroupLoopCurrent())])
                        else
    
    Posted in: Triggers
  • 0

    posted a message on Shared Nuke Ammunitions

    Making two players with a Ghost each to share Nuke ammos armed by one single player. The only way I figured out how to do this is changing Ghost Academies owner on-demand, but it's a bit clunky. There are better solutions?

    Posted in: Triggers
  • 0

    posted a message on Bank keeps resetting from test to test

    If I press the test button, my map is normally loaded, the values are saved and so on. But if i repress the test button at the beginning of the map all keys and sections are removed from my bank - resetted. My bank name does not use spaces, _, or special characters. Here is what i do:

    • Map
      • Preload Data dialog
      • Banks
      • Preload bank "<BankName>" for each player
    • Triggers
      • Open bank "<BankName>" for player 1
      • Set Bank[1] (last opened bank)
      • Open bank "<BankName>" for player 2
      • Set Bank[2]...

    To save my key:

    • Pick each player in all players
      • If (key <X> section <Y> from bank Bank[Picked player] == FALSE
        • Save TRUE boolean as key <X> section <Y> in Bank[Picked player]
        • Save bank Bank[Picked player]

    Sorry for bad syntax not using enUS editor.

    Posted in: Triggers
  • 0

    posted a message on Blasterbots

    Damn that's too bad, anyway some tileset like primal jungle are really nice :S

    Hoping on future updates ^^

    Posted in: Project Workplace
  • 0

    posted a message on How do I get rid of this thing?
    Quote from Forge_User_45840264: Go

    @alfx01: Go

    are you serious? why don't you just try it?

    Thank you, I do not know how I would have done without your help.

    I'm asking this because I have to hook different default UI elements, so I'd like to know if Panel is the default type for all, or at least most of them.

    Posted in: Triggers
  • 0

    posted a message on Blasterbots

    @DuckyTheDuck: Go

    Ah, sorry, that must be the problem! Also if I'm not sure to have understood how Auto-adjust works.

    Anyway, you have more plans for this masterpiece arcade? Like new tile sets, bomber models, upgrades, some doodads like -say- water, lava , maybe in combination with different terran heights (that would be crazy xD). This is definitely the BEST arcade I never played, maybe after Star Party :D

    Posted in: Project Workplace
  • 0

    posted a message on Generic stackable behaviors for 40 units upgrades

    Learn to use Triggers, I can't even figure how to do it with Data module, while is relatively easy with Actions.

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