• 0

    posted a message on (help) modify unit data.

    @tdhsst: Go

    It's a little tricky, but to work it in triggers first of all you'll need to do some calculations.

    You need to know how much speed is at 100%, 50%, and so on.

    Since you know this, then you need to figure out how much speed should be subtracted for each unit of energy (lets say 1).

    Based on the information, it seems to be a 1:1 ratio. So then you do something along these lines:

    speed and energy
        Events
            Unit - Any Unit Energy changes
        Local Variables
        Conditions
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Value of Units Ghost Speed for player (Owner of (Triggering unit)) as an integer) <= (Integer(0.0))
                Then
                    General - Wait 1.0 Game Time seconds
                    Catalog - Set value of Units Ghost Speed for player (Owner of (Triggering unit)) to (String(((Value of Units Ghost Speed for player (Owner of (Triggering unit)) as an integer) - 1)))
                Else
    

    Though, to be honest, using behaviors is more appropriate here, as you can set times and what have you, but I believe this will solve your problem trigger-wise.

    As the unit gains energy back, just do it backwards.

    Changing catalog values through triggers tends to get buggy, so be ready to look for overly-complicated fixes.

    EDIT: Silly me, I'll leave my post attached but if you use "set unit property" and in the slot with the number use arithmetic it works just as well and probably work smoother.

    Posted in: Triggers
  • 0

    posted a message on [Triggers]: general help making a trigger.

    @LaxSalmon: Go

    You almost have it. What happens is it will run forever until the player has less than the max.

    However, each time you level the amount of EXP it takes increases.

    So, the way I went around that was to only subtract the current max EXP, then increase it, then check again.

    I could only do it one time, but honestly I don't know how to do that and still get enough levels.

    For instance:

    • Player kills a unit with 500 EXP bounty.
    • Player only needs 100 EXP to level currently.
    • Player would only level once in my old system, so player would be left with 400 EXP sitting around.
    • In my new system, they will level to the correct level but it lags and is not a very good way to do triggering in general.

    However, what I am looking for is an alternative to the While loop. I figured out a way without a lag spike (increased the wait) but it will still likely lag if 2+ players level at the same time.

    I don't mind the workaround, just so long as it works better than my current system.

    Posted in: Triggers
  • 0

    posted a message on [Triggers]: general help making a trigger.

    I didn't want to make a gigantic title like I usually do.

    Anyway, I need to make a trigger for my custom EXP trigger but I need it to repeat until the current value is less than the maximum value of EXP that that unit/player can have at one time.

    I am using boss bars and not the normal EXP system, for those curious.

    What I have so far:

    When the unit kills another unit or a unit owned by a player in a specific player group hits a unit in a different group, it will run the trigger.

    After that, the trigger itself is a while trigger, which will check the conditions until they are met (I.E. it will continue to level the unit until it's EXP is less than the max it needs to level).

    But that's where it gets laggy. When it runs, it will check the conditions every .1 seconds or until 2 seconds. So it will generate a huge lag spike while it calculates the EXP and levels.

    By themselves they work, because I was using a different system that only ran once before and worked like a charm. So it must be the while action. I just don't know any alternatives.

    Any help is appreciated, and for those who need more technicals:

            General - While (Conditions) are true, do (Actions)
                Conditions
                    Or
                        Conditions
                            Current EXP Hider 1 >= EXP to level Hider 1
                            Current EXP Hider 2 >= EXP to level Hider 2
                            Current EXP Hider 3 >= EXP to level Hider 3
                            Current EXP Hider 4 >= EXP to level Hider 4
                Actions
                    Player Group - Pick each player in Hiders and do (Actions)
                        Actions
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    (Picked player) == (Player 1 from Hiders)
                                    Current EXP Hider 1 >= EXP to level Hider 1
                                Then
                                    Variable - Modify Current EXP Hider 1: - EXP to level Hider 1
                                    Variable - Set Leveling Hider 1 = True
                                    To Infinity and beyond! H((Picked player))
                                    Determine Extra Bounty((Picked player))
                                Else
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    (Picked player) == (Player 2 from Hiders)
                                    Current EXP Hider 2 >= EXP to level Hider 2
                                Then
                                    Variable - Modify Current EXP Hider 2: - EXP to level Hider 2
                                    Variable - Set Leveling Hider 2 = True
                                    To Infinity and beyond! H((Picked player))
                                    Determine Extra Bounty((Picked player))
                                Else
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    (Picked player) == (Player 3 from Hiders)
                                    Current EXP Hider 3 >= EXP to level Hider 3
                                Then
                                    Variable - Modify Current EXP Hider 3: - EXP to level Hider 3
                                    Variable - Set Leveling Hider 3 = True
                                    To Infinity and beyond! H((Picked player))
                                    Determine Extra Bounty((Picked player))
                                Else
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    (Picked player) == (Player 4 from Hiders)
                                    Current EXP Hider 4 >= EXP to level Hider 4
                                Then
                                    Variable - Modify Current EXP Hider 4: - EXP to level Hider 4
                                    Variable - Set Leveling Hider 4 = True
                                    To Infinity and beyond! H((Picked player))
                                    Determine Extra Bounty((Picked player))
                                Else
                    General - Wait for (Conditions), checking every 0.1 Game Time seconds, for no longer than 2.0 seconds
                        Conditions
                            Leveling 2 == False
    

    This is the main trigger which runs everything else when a unit levels. If you must know more, I can provide it, but it's pretty huge.

    Posted in: Triggers
  • 0

    posted a message on make dialog pick random number of people who clicked a dialog.

    @fishy77: Go

    Max player count would be an integer or real variable (depending on how much accuracy you need.)

    And then to pick a random player:

    General - While (Conditions) are true, do (Actions)
                Conditions
                    builder count > 0
                Actions
                    Variable - Set your variable = (Random integer between 0 and maximum number of players)
                    Player Group - Pick each player in (All players) and do (Actions)
                        Actions
                            General - If (Conditions) then do (Actions) else do (Actions)
                                If
                                    (Picked player) == your variable
                                Then
                                    Unit - Create 1 builder for player (Picked player) at builder spawn point facing 270.0 degrees (No Options)
                                    Variable - Modify builder count: - 1
                                Else
    

    I didn't test it but it should work. Though I've had trouble with using just (greater than, less than) < or > so you may have to mess with the numbers a little to get it to work properly.

    Posted in: Triggers
  • 0

    posted a message on Help Cinematic issue ingame

    @jamison0136: Go

    As hobbidude said, you need a wait trigger between each camera change or else it's going to fidget, bug, or crash. This wait should be as long as it takes (or longer) for the camera to be fully applied.

    Posted in: Triggers
  • 0

    posted a message on Cool Abilities?

    @tdhsst: Go

    Awesome ideas! The map is, again, on hold, but I still appreciate the effort!

    Sorry it took so long by the way, I didn't think anyone would reply, to be honest.

    Posted in: Map Suggestions/Requests
  • 0

    posted a message on Simple unit health bar dialog

    @Sherlia: Go

    Dialog - Destroy (your dialog)
    OR
    Dialog - Destroy (your dialog item)
    

    Then do like you did before.

    It's not a problem. I am glad to help anyone who needs my help when I can. :)

    Posted in: Triggers
  • 0

    posted a message on Simple unit health bar dialog

    @FuzzYD: Go

    A+!

    I was wondering if there were mods for boss bars, then I realized I was too lazy. :(

    @Sherlia: Go

    Like Fuzzy said, but also, the reason I didn't put a while loop or "wait 1.0 game time seconds" is to simulate a boss bar, more or less. Having a wait can get a little confusing especially for units with a health regen of 1.1+ and I could never figure out a way to simulate the actual regeneration better than a wait of 1 seconds.

    Posted in: Triggers
  • 0

    posted a message on Simple unit health bar dialog

    @Sherlia: Go

    If you must have a dialog for health, do something along the lines of:

    Health dialog = No Dialog <Dialog>
    Health dialog item = No Dialog Item <Dialog Item>
    Unit = Marine [67.94, 65.63] <Unit>
    

    These are the variables, now time for the creation trigger:

    create dialog
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            Dialog - Create a Modal dialog of size (200, 200) at (0, 0) relative to Top of screen
            Variable - Set Health dialog = (Last created dialog)
            Dialog - Hide the background image of Health dialog
            Dialog - Create a label for dialog Health dialog with the dimensions (200, 50) anchored to Center with an offset of (50, 50) with the text ("Health: " + ((Text((Unit Life (Current))) with Any Precision decimal places) + ("/" + (Text((Unit Maximum Life (Current))) with Any Precision decimal places)))) color set to White text writeout set to False with a writeout duration of 2.0
            Variable - Set Health dialog item = (Last created dialog item)
            Dialog - Set (Last created dialog item) size to parent layout True for (All players)
            Dialog - Show Health dialog for (All players)
    

    And now the loop trigger:

    Check
        Events
            Unit - Unit Life changes
        Local Variables
        Conditions
        Actions
            Dialog - Set Health dialog item text to ("Health: " + ((Text((Unit Life (Current))) with Any Precision decimal places) + ("/" + (Text((Unit Maximum Life (Current))) with Any Precision decimal places)))) for (All players)
    

    This will lag your game pretty bad though, for health I suggest boss bars. They work the same and take MUCH less effort both for you and your map.

    Posted in: Triggers
  • 0

    posted a message on Problem with my triggering? Or just a blizzard bug to work around?

    So I am making a custom EXP trigger. I'll save you the details and get right to the problem.

    I am new to using the trigger editor to change unit properties. Until now I didn't think it was possible. Which is really the only reason I am asking this question.

    The offending section of triggers are:

    Catalog - Set value of Units InfestedCivilian LifeRegenRate for player (Player 1 from Seekers) to (String(((Value of Units InfestedCivilian LifeRegenRate for player (Player 1 from Seekers) as an integer) + (Integer(0.05)))))
    Catalog - Set value of Units InfestedCivilian EnergyRegenRate for player (Player 1 from Seekers) to (String(((Value of Units InfestedCivilian EnergyRegenRate for player (Player 1 from Seekers) as an integer) + (Integer(0.05)))))
    Catalog - Set value of Units InfestedCivilian KillXP for player (Player 1 from Seekers) to (String(((Value of Units InfestedCivilian KillXP for player (Player 1 from Seekers) as an integer) + 100)))
    

    I have others that change weapon damage, life armor level, etc...no problem with those.

    Here are the errors:

    00:00:00.94 Scri: Trigger Error in 'gt_ToInfinityandbeyondS_Func': Catalog field 'LifeRegenRate' could not be read (Core: invalid object type identification)    Near line 5270 in gt_ToInfinityandbeyondS_Func() in MapScript.galaxy
    00:00:00.94 Scri: Trigger Error in 'gt_ToInfinityandbeyondS_Func': Catalog field 'EnergyRegenRate' could not be read (Core: invalid object type identification)    Near line 5271 in gt_ToInfinityandbeyondS_Func() in MapScript.galaxy
    00:00:00.94 Scri: Trigger Error in 'gt_ToInfinityandbeyondS_Func': Catalog field 'KillXP' could not be written (Core: access denied to required object or service)    Near line 5272 in gt_ToInfinityandbeyondS_Func() in MapScript.galaxy
    

    gt_ToInfinityandbeyondS is the trigger name, in case anyone was wondering.

    So is this a problem with my triggering? If so how do i fix it? Or is it a bug in the editor I have to work around?

    Something I should mention, I will not work in the data editor for the life/energy regeneration unless absolutely necessary.

    Posted in: Triggers
  • 0

    posted a message on [SOLVED]Targetting a unit on mouse click and/or ordering a unit to attack a selected unit.

    I am truly stumped on this one, so hopefully this isn't another easy fix like the last few posts I've made.

    Anyway, how do you go about selecting a unit (in this case the unit that your mouse is on) and then ordering your unit to attack it.

    I am trying to use martinolsson's TPS engine, without the "shooter" aspect, as some of my units are melee.

    I've tried just ordering the unit to attack the camera target, but it starts and then immediately stops.

    When I remove martinolsson's TPS engine library, my unit will attack a position but even if I have the camera over a unit will not attack that unit.

    Any ideas?

    EDIT: also just tried using a separate trigger with "unit selected/highlighted/clicked" and then set a variable to the triggering unit. Didn't work.

    Posted in: Triggers
  • 0

    posted a message on Reference unit at end of effect chain

    @LostMapmaker: Go

    Well, I would use an action definition if I were you. In fact I could make you one if you like.

    Posted in: Triggers
  • 0

    posted a message on Reference unit at end of effect chain

    @LostMapmaker: Go

    I'm not much of an advanced user, but I usually solve this problem by storing the value in a variable.

    E.G.: When the unit is using the ability store the value by changing a variable

    Variable - Set EXP = (Integer(((Triggering unit) Experience (Current))))
    

    or

    Variable - Set EXP = (Integer((Total experience of (Triggering unit))))
    

    You can have the EXP variable as either a real or an integer, I use integers because it's easier but I imagine it should work both ways.

    EDIT: just now realized, you already said my way. Suffice it to say I'm pretty sure it's your only option.

    Posted in: Triggers
  • 0

    posted a message on Arcade Beta: Post the funniest reviews
    Quote from Mozared: Go

    @Yaksmanofage: Go

    Tofu is a type of food made by coagulating soy milk, and is often used to replace meat as the main source of protein by vegetarians. People hate it because they think vegetarians have a holier-than-thou attitude.

    lol'd.

    Thanks for explaining though. :)

    Posted in: Off-Topic
  • 0

    posted a message on Arcade Beta: Post the funniest reviews

    @Mephs: Go

    What is TOFU and why does everyone hate it so much?

    Posted in: Off-Topic
  • To post a comment, please or register a new account.