• 0

    posted a message on Record[SOLVED] vs. Array[UNSOLVED]

    @BigDonRob: Go

    array test
        Events
            Unit - Any Unit dies
        Local Variables
            dead type = (Unit type of (Triggering unit)) <Game Link - Unit>
            Unit Type = 0 <Integer>
            Respawn Point = (Point((Custom value 0 of (Triggering unit)), (Custom value 1 of (Triggering unit)))) <Point>
            Level of Unit = (Custom value 2 of (Triggering unit)) <Real>
            New Unit = No Unit <Unit>
        Conditions
            (Owner of (Triggering unit)) >= 4
        Actions
            General - For each integer Unit Type from 1 to 15 with increment 1, do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            dead type == Enemy Unit[1][Unit Type]
                        Then
                            Variable - Set dead type = Enemy Unit[2][Unit Type]
                            Variable - Modify Kills/Threshold[0][Unit Type]: + 1
                        Else
            General - Wait 20.0 Game Time seconds
            Unit - Create 1 dead type for player 15 at Respawn Point facing (Random angle) degrees (No Options)
            Variable - Set New Unit = (Last created unit)
            Unit - Set New Unit custom value 0 to (X of (Position of New Unit))
            Unit - Set New Unit custom value 1 to (Y of (Position of New Unit))
            Unit - Set New Unit custom value 2 to Level of Unit
            Unit - Set New Unit Bounty (Minerals) to ((Minerals cost of dead type) * (1.1 ^ Level of Unit))
            Unit - Add (Floor(Level of Unit)) STAG Enemy Buff to New Unit from player 15
    

    Ha Ha Mother Lovin Ha!

    Posted in: Triggers
  • 0

    posted a message on UI Request
    Quote from GlornII: Go

    I dont do any UI editing; but I do a lot of dialog work to make my own UI like stuff.Considering you are setting values for this box with triggers anyway, why not just make a dialog box and use the triggers to update said dialog box?

    More specifically, say what you want in the long run, so we can show you other ways of getting there.If what you want is an icon on the screen with a number on it reflecting a variable, yes, use a dialog box.This is 5 minutes worth of work.

    I thought dialog was UI? At least, dialog is what I started experimenting with.

    And when I first brought this to the UI thread, the information I needed to display didn't need to update. I didn't decide to add the kill counter until I realized it would be better to store all of the information in one place. (One Dialog)

    Quote from GlornII: Go

    To update it, you either need to run a loop endlessly (use a repeat - forever, with a wait) or trigger specifically when the data is updated.If it is just a simple display, not like HP or something that needs to be specific to the .1 second, using a 1 second loop isnt bad.Having a lot of little repeat loops isnt good though; if you have multiple repeat loops like that, you should combine them all into 1 trigger and put them on their own thread.

    As long as there is only one loop running at a time, then it's okay? I have a Boolean "Break" set when the trigger fires, so that it can't be triggered repeatedly, and then when the loop is done, it destroys the dialog and sets the break back to allow it to fire again.

    Posted in: UI Development
  • 0

    posted a message on Data error when using revive trigger. [SOLVED]
    Quote from BigDonRob: Go

    @JEGCPR: Go

    Using the above trigger, create local variables for any information you want to save from the dying unit.

    Integer, Unit Type, Unit Property, Unit Property

    Posted in: Data
  • 0

    posted a message on UI Request
    Quote from temhawk: Go

    Don't update the UI if you don't have to. Just set the text together when you actually change the value.

    Well, the idea is for the dialog text to show a kill count. And the way the map works, it will definitely be changing a lot more often than every 8 seconds...

    Posted in: UI Development
  • 0

    posted a message on Random Info of the Day

    As anyone has realized over the past couple of weeks, I'm not great when it comes to data. So here is my trigger workaround to mimic an "itch" effect that causes burrowed attackers to unburrow, leaving them vulnerable. It's upgrade is a variable that changes with upgrades, allowing friendly units to attack more times before they are affected.

    Itch
        Events
            Unit - Any Unit starts attacking with Any Weapon
        Local Variables
        Conditions
            Or
                Conditions
                    (Unit type of (Triggering unit)) == Lurker (Swarm Multi, Burrowed)
                    (Unit type of (Triggering unit)) == Impaler (Burrowed)
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Custom value 5 of (Triggering unit)) < Itch
                    (Owner of (Triggering unit)) == 2
                Then
                    Unit - Set (Triggering unit) custom value 5 to ((Custom value 5 of (Triggering unit)) + 1.0)
                Else
                    Unit - Order (Triggering unit) to ( Unburrow) (Replace Existing Orders)
                    Unit - Order (Triggering unit) to ( Unburrow) (Replace Existing Orders)
    
    Posted in: Triggers
  • 0

    posted a message on Record[SOLVED] vs. Array[UNSOLVED]

    @ZMilla93: Go

    Glad to know it's possible, but I'm just shot on the idea. Maybe one day after I know what I'm doing, I'll write something out just to prove I can.

    Posted in: Triggers
  • 0

    posted a message on UI Request
    Quote from temhawk: Go

    You need to refresh it yourself by setting the dialog item text.

    Is there a specific loop to use, or just copy paste a bunch of waits?

    I attempted my first do while loop that had a Boolean break and was supposed to set a progress bar to an integer. Outside the loop was an 8 second wait and then it set the Boolean. The result was that anytime the trigger fired ingame, it froze for 8 seconds and didn't show anything.

    Posted in: UI Development
  • 0

    posted a message on If Then Else (If) vs Switch

    @Ahli634: Go

    Well, when I saw switch, I thought it was meant to switch Boolean states, but it's basically If Then Else If, only all instances are compared to the initial statement, which calls a function or variable. So I suppose this relates to my Function call vs local variable thread, now that I think about it. I'm assuming that it "saves" the initial function so that it's not called it for every case, making it (possibly) superior to If then else.

    Posted in: Triggers
  • 0

    posted a message on If Then Else (If) vs Switch

    What are the differences between these three functions? Are either If functions "better" than switch?

    I like Switch if I'm checking multiple things against the same variable. But if I'm checking a large number of things, I kind of prefer If else so that it "groups" the coding into tiers, so if I reviewing the trigger, I can find what I'm looking for easier. Is there any reason, be it function or aesthetics, to use one over the other two?

    Posted in: Triggers
  • 0

    posted a message on Record[SOLVED] vs. Array[UNSOLVED]

    @temhawk: Go

    Unfortunately, not with what I had in mind. I understand the application to integer arrays, but what I'm trying to do is create a short hand "list" for comparing a triggering unit type from list a (a record of unit types) and changing a local variable to the matching unit type from list b (an identical record with the same unit types, just burrowed).

    I already have a series of if than else statements to do that now, but I'm just trying to see if it's possible.

    Posted in: Triggers
  • 0

    posted a message on UI Request

    @temhawk: Go

    I've been toying around with dialog a little bit, and I've come up with a solution that I can live with, after a little more experimentation. I've not even got to the text portion yet, but is there a trick I need to know in advance to make a counter display in real time?

    The dialog is supposed to show up for 8 seconds, which it does, but I want one of the text displays to show an actively changing integer value. If I convert the integer into text, will it automatically update as the integer does, or does it need to be "refreshed" every half second or so?

    Posted in: UI Development
  • 0

    posted a message on Record[SOLVED] vs. Array[UNSOLVED]

    @temhawk: Go

    I'm not getting anywhere. Can you show me an example code?

    Posted in: Triggers
  • 0

    posted a message on [Solved] Check if effect kills a unit
    Quote from coffeeclubbr: Go

    @BigDonRob: Go

    That's why I asked here :)

    I figured. I'm bad about thinking trigger first, data never. lol

    Posted in: Data
  • 0

    posted a message on Data error when using revive trigger. [SOLVED]

    @JEGCPR: Go

    Using the above trigger, create local variables for any information you want to save from the dying unit.

    Player= Owner of (Triggering Unit) Hero= Unit Type of (Triggering Unit) Level= Level of (Triggering Unit) EXP= Experience of (Triggering Unit)

    Then, instead of reviving and moving the unit

    Use create unit (Hero) for player (Player) at (North Start Location)

    Set last created unit property(Level) to (Level)

    Set last created unit property(Experience) to (EXP)

    Select last created unit for player (Player)

    Pan the camera for player (Player) to North Start Location over 2.0 seconds with Existing Velocity....

    Posted in: Data
  • 0

    posted a message on [Solved] Check if effect kills a unit

    @coffeeclubbr: Go

    I am not going to offer a trigger solution...

    I am not going to offer a trigger solution...

    I am not going to offer a trigger solution...

    There, it worked. Now feel free to ask again in the triggers thread. Or if you really want a data solution, someone here will help you out.

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