• 0

    posted a message on Any simple trigger changing weapon?

    Mapster isn't letting me attach another image to that post.

    Posted in: Triggers
  • 0

    posted a message on Any simple trigger changing weapon?

    @Yaksmanofage: Go

    @cleanto: Go

    Quote from cleanto: Go

    @Charysmatic: Go

    so i can make a trigger increasing damage by clicking button or must i make 20 triggers for 20 upgrades?

    Not really sure what that monster of a code segment was supposed to do, but there's a simpler solution.

    1. Creating the Behaviors in Data

    • I stay away from data so I'm going to say this briefly: Make the four stackable behaviors in data which modify unit damage by +1, -1, +10, and -10. Call them "Damage +1", "Damage +10", "Damage -1", and "Damage -10".

    Now we can modify any unit's respective bonus damage through triggers by applying and removing behaviors.

    2. Creating a Custom Definition to Accept an Integer Value to Modify Unit Damage

    As the title of this part says, we're going to need a custom definition. I'm assuming you don't know how to work with custom definitions so I'll go through this with you.

    • Very briefly, custom action definitions are like your very own homemade triggers.
    1. Right click on the left in the field containing your triggers. Go to New, click on New Action Definition.
    2. Let's rename it to "Set Unit Bonus Damage".
    3. Right click on "Parameters" and create a new parameter.
    4. Name it "Unit".
    5. Set it to type Unit.
    6. Create another parameter. Name it "Amount". Set it to type Integer.

    So we got our custom action's input slots set up. Time for the actions within our custom action.

    1. Create a new action, Remove Behavior from Unit (this works similar to a normal trigger).
    2. For amount of behaviors, put 10. You'll see why later.
    3. For behavior, put the behavior we made "Damage +10".
    4. Click on where it says "unit" in the action. When it brings up the unit input window, click on Parameter" Then click on the parameter we made, "Unit".
    5. Copy and paste this action three times, for a total of four.
    6. Change the behavior in each so that there's one of each, +1, -1, +10, and -10. (see screen shots attached).

    By doing this, we erase all bonus damage from a unit before the rest of the action runs.

    We're going to go back up the action really quick and create a new local variable in this action.

    • Local variable, type string, let's call it "Absolut Amount". (Vodka reference).
    • Set the value of it to convert integer to string, absolute value, then put in our parameter Amount.

    Now we're going to do the rest of the actions. This is still in our custom action.

    1. Create a new action, type If then Else.
    2. Create a condition for the if, type comparison, set it to our parameter Value < 0.
    3. For the then part, create the action "Add Behavior to Unit from Player."
    4. For the amount value, set it to Convert String to Integer > Substring of String. For the string part, set It to our variable "Absolute Amount". Set both of the other to integer values to 1.
    5. For the behavior, set it to Damage -10.
    6. For the player, set it to 0.
    7. Copy and paste this action. Change the two 1s to 2s. Change the behavior to "-1 Damage" instead of -10.

    Now we have the functionality to reduce a unit's damage using this action. Time to make it so we can add damage as well.

    1. Copy and paste the two actions under Then to Else. Change the behaviors to the opposite one (Damage -10 to Damage + 10 and Damage -1 to Damage +1)

    That functionality has been added and it's time to test this custom action.

    3. Testing Our New Custom Action

    1. Open the terrain module. Slap a unit down, let's say, a marine.
    2. Create a new trigger.
    3. For the event, do Map Initialization.
    4. For the action, create our action that we just made, "Set Unit Damage".
    5. For the integer value input, put in any number -99 to 99. For the unit, put the unit we created.
    6. Test map.
    Posted in: Triggers
  • 0

    posted a message on Dialog based buff bar

    @Matheusx: Go

    Clever fix, glad you got it working.

    Posted in: Triggers
  • 0

    posted a message on Any simple trigger changing weapon?

    @cleanto: Go

    Like they said, you can change weapons of a unit but increasing damage is a bit trickier. If you want to increase the damage done of a unit type then use catalog field set functions. Changing a unit's damage via catalog will change the weapon damage of all units of that type, though. So you can't just increase one unit's damage via catalog.

    However, there is a work around. By making about four stackable behaviors, which increase a unit's damage by +1, +10, -1, and -10 then you can make your own functions in triggers to set a unit's bonus damage to whatever you want. I can provide more information if you're interested.

    Posted in: Triggers
  • 0

    posted a message on Team Genesis Recruitment

    Like Searing said, the team itself doesn't adopt projects. However, it is common for members to be working on the same project.

    It's a suitable team for basically everyone. Project leaders, amateur editors, expert editors, specialist editors, general editors, people that like helping, people that like being helped, etc., etc. My time with them was very pleasant and I do believe they'll accomplish great things!

    Posted in: Team Recruitment
  • 0

    posted a message on Map Night Revived! (EU-NA)

    How are maps chosen, exactly? I think I'd be more likely to show up if I knew.

    Posted in: General Chat
  • 0

    posted a message on Dialog based buff bar

    @Matheusx: Go

    Hi, I see a few people have already helped but I think it would be beneficial to give you a breakdown in a format I like of how this system could work.

    It will require several components. This would be a lot easier if we were to use custom definitions, however I'm not aware if you're familiar with those.

    1. Creating and Displaying the Behaviors

    You'll need these variables:

    • A constant variable, not arrayed. We'll call it "Number of Behaviors".
    • A non-arrayed variable, type Dialog. We'll call it "Behavior Dialog".
    • An arrayed variable, size [Number of Behaviors], type Dialog Item, we'll call it "Behavior Image".

    This is where we create the dialog base for the behavior bar.

    1. Create a new trigger, event map initialization, we'll call it "Create Behavior Dialog".
    2. Create the action "create dialog" for this trigger. Leave the standard settings.
    3. Finish setting up the dialog (size, location, showing it, hiding background, etc.)
    4. Create the action "Set Variable". Set the variable "Behavior Dialog" and set it to the last created dialog. This serves no purpose directly for this as we won't need to be able to retrieve the dialog, however it's a nice habit to get into, saving dialogs.

    Now we have our dialog to contain our many dialog items. Time to create those dialog items. We'll need this additional local variable:

    • Non-arrayed variable, type integer. We'll call it "Behavior Icon Size". Set it to 60 by default.

    Note: This is all still in the same trigger so far.

    1. Create the loop action "Pick Each Integer". Have it pick the integers from 1 to [Number of Behaviors].
    2. Create the action "Create Dialog Item (Image)" for our dialog. Set the image to "white.dds" or whatever, it doesn't matter. Set both the X and Y size to our variable "Behavior Icon Size". Make sure it's of normal type and not tiled, standard stuff.
    3. Position gets a little more tricky. Decide where you want it anchored and set that.
    4. Assuming you want the bar horizontal, give it a straight value for the Y offset. For the X offset, use the Arithmetic (Integer) function and multiply the two values Picked Integer and "Behavior Icon Size".
    5. Create the Set Variable action (this is in the loop, too), and set the variable Behavior Icon [Picked Integer] to last created dialog item.

    We've got our dialog set up for the behavior bar.

    2. Updating the Behavior Dialog to Display Current Behaviors.

    Now we have to make it so that our bar reflects the buffs on a unit. I'm assuming this is going to be multiplayer.

    • An arrayed variable, dimensions 1, size 14 (max amount of players), type unit. We'll call this "Behavior Unit".
    1. Create a new trigger. We'll call this "Update Behavior Dialog". Event, Periodic Event every 1 Second.
    2. Create the action Pick Each Player in Player Group. Set the player group to Active Players.
    3. In this loop, create the action Pick Each Integer. Set it to pick each integer from 1 to "Number of Behaviors".
    4. In this newer loop, create the action If Then Else. Under if, put the condition: "Picked Integer <= Number of Behaviors on Unit "Behavior Unit" [Picked Player].
    5. Under Then, create the action Show/Hide Dialog Item. Show the Dialog item "Behavior Icon" [Picked Integer] for player Picked Player.
    6. Still under Then, create the two actions to set image and tooltip. Due to complexity/time constraints, just copy these from the attached map or from the screen shots. They're just catalog functions to retrieve information from the game data.
    7. Under Else, create the action Show/Hide Dialog Item. Hide the dialog item "Behavior Icon" [Picked Integer] for player Picked Player.

    This covers updating the dialog we made in step one.

    3. Testing the Behavior Bar

    We'll need to test what we just made.

    1. Create a new trigger. We'll call it "Testing". Event, Map Initialization.
    2. Place a unit, any unit, on the map via the terrain module.
    3. Set variable Behavior Unit [1] to the unit just created.
    4. Create the action add behavior to unit. Set the behavior to any behavior (some may not work if they rid themselves automatically). Caster unit/player is not important.
    5. Repeat the last created action several times for testing.

    Feel free to PM me or post to ask further questions about these directions.

    Note: I uploaded the map. I never do that when giving a mini-tutorial about something and I'm only doing it now since this can get confusing and because you'll need the two catalog actions from it. My request is that you don't simply copy/paste the map and actually do it yourself (not because I care about it being stolen, but so that you learn the most, which was my intent when writing this.)

    Posted in: Triggers
  • 0

    posted a message on Is there any way to pause game time?

    @Myteq: Go

    I dislike asking people to provide more information, however if you want to say exactly what you mean (for example, what do you mean by "game time". pausing the game, stopping that timer, etc.?) then perhaps I can help you create a work-around to accomplish this.

    Posted in: Triggers
  • 0

    posted a message on Zombie respawn

    @IcyJay: Go

    That is not accurate. Variables are needed because the unit is being created at the position of a unit after the unit has died. Dead units do not retain their positions.

    His action is giving him an error because it's having trouble placing the unit at the position of a unit which died 30 seconds ago.

    If he sets a point variable to the position of the unit without wait, then the variable will carry the position for the unit which spawns in 30 seconds.

    Posted in: Triggers
  • 0

    posted a message on removing a ping

    @pokenoufl: Go

    I'm very glad that it helped.

    I actually explained the events for the second part in an edit saying that I hadn't realized there was no "Unit Enters Any Region" thing, however it was lost when I changed something else in a different edit. Mapster's fault, not mine.

    But I am really glad that you found it easy to follow and that I was able to help you.

    Posted in: Triggers
  • 0

    posted a message on Number of workers on unit.

    @Dzuke911: Go

    There's likely an easier data related way but what I would do is assign each mineral field an integer ID. I would do this by having a trigger run whenever a mineral field enters region [entire map]. I would give it and assign it the next available consecutive integer.

    I would store that ID as a custom value in the minerals. I would also set up a unit variable array with the mineral field stored as that value in the array. Every time a unit mines from that mineral field, it would raise a worker count associated with the ID of the mineral field by 1. After the time it takes for the worker to return it would be lowered by 1. Retrieve the count by returning the integer variable associated with the ID.

    Posted in: Triggers
  • 0

    posted a message on removing a ping

    @pokenoufl: Go

    Several components of this system are needed.

    1. A way to create and register the pings and zones.

    You'll need three variables:

    • An arrayed variable, dimensions 1, size 100, type region. We'll call it "Zones"
    • An arrayed variable, dimensions 1, size 100, type ping. We'll call it "Pings".
    • A non-arrayed variable, type integer, set to 0. We'll call it "Counter".

    First we need to create a trigger that registers each zone (region) that you've created in the terrain module.

    1. Create a trigger, map initialization.
    2. Create the action Modify Variable. With this, modify the variable Counter to be +1 of it's self.
    3. Create the action called Set Variable. Set the region variable called Zones variable to your first zone. For the integer value in the array, use the variable Counter that we created earlier.
    4. Create the ping at the center of region, Zones [Counter].
    5. Create another action called Set Variable. Set your ping variable we created to the last created ping. Use Counter again for the array.

    Now we've created the actions for your first zone. Copy and paste all that you have so far and only change the variable containing the zone. Modify it to the second zone. Repeat until all 10 zones are assigned.

    By doing this, we've assigned each ping and zone a number, and a way to retrieve the amount of zones. There are more efficient ways to do this but this is a nice place to start.

    2. A way for the ping to be removed.

    This is much simpler. We've taken care of most of the work in step one.

    1. Create a trigger. For the event, use Unit Enters Region. (Any region).
    2. Create the Pick Each Integer action. From 1 to your integer variable Counter.
    3. Create an If-Then action in the Pick Each Integer loop. Set the condition to Triggering Condition = Zone [Picked Integer].
    4. Under the then part, create the action destroy ping. Destroy the ping in our array of pings at the Picked Integer value. "Destroy Ping Pings[Picked Integer]
    5. Now that the ping is gone, we need to keep this region from triggering this trigger again. Move it off map or something.
    Posted in: Triggers
  • 0

    posted a message on Zombie respawn

    @redbean87: Go

    The problem is in where the unit is spawning. The triggering unit is dead and therefore has no position. To fix this, create a new point variable and set it to position of triggering unit and spawn the unit at that point.

    Posted in: Triggers
  • 0

    posted a message on [BarCraft] Has been removed from StarCraft II

    @sc2modders: Go

    Well, you can always make another map.

    I hear Sorry! is pretty fun.

    Too soon?

    Posted in: General Chat
  • 0

    posted a message on Wanted: Abilities-Creator for a Competitive Multiplayer Map

    @Elmaex: Go

    Not interested, just saying I liked the post. Most people are all like "this is my map, work on it exactly how I want it" and you're all like "this is the type of thing I'd like to make, looking for partner."

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