• 0

    posted a message on Trigger Question: Turn Off for specific player only

    Triggers are either on or they are off. They can't be both.

    There are many ways to accomplish what you are describing though. You could have a player group and just add or remove players from it when the trigger runs, and have a condition that checks whether they are in the group. You could also just used a boolean array with an index for each player, and check the value of the array at the player's index. In either case, you do need to use a global variable.

    Posted in: Triggers
  • 0

    posted a message on How to duplicate and change name with out losing model?

    @ZeroAme: Go

    Some units require a bit of extra work, particularly those that have morphs (if you still use the morphs). A big reason for a lot of the confusion is that morphs send different events than unit births. If you try to clone the infested terran egg for instance, and clone the infested terran, the actor won't work even if you duplicate it because the actor's response to the morph events uses parameters to check the unit type of the original unit and the unit it is morphing to. You have to go in manually and fix these.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Transfer Energy to newly morphed/created Unit

    @koffiegast: Go

    The problem with your trigger is that you are initializing the EnergyNew value to the energy of the triggering unit. However, the triggering unit is part of the "UnitsSelected" group, so his energy gets added AGAIN when you do the "Pick Each Unit" loop. For that matter, "Remove Triggering Unit" is redundant, since he will already have been picked and removed, but that won't really break anything.

    Initialize the variable to 0 instead and it should add up properly.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Make a building buildable anywhere

    @Colt556: Go

    The placement footprint determines what terrain flags are required for the building to be placed. Make a footprint that has no required or invalid flags on it's Placement Check map and you can build it anywhere.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Waypoints with Arrays

    @petrov1: Go

    All you need to do is use the "Set Variable" action to assign a point to each variable in the array.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Click to shoot, damage instead of instant kill

    @DirtyDevious: Go

    Make a Damage effect, and have the trigger create the effect on the unit.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Changing data entries on the fly

    @kevincheese: Go

    Upgrades can modify certain data fields, though there are limitations.

    Posted in: Miscellaneous Development
  • 0

    posted a message on 8 triggers running at 1 sec each

    @Etravex: Go

    It depends on how much work each trigger is doing, but in general 8 triggers a second would not be a problem. Most triggers execute so fast that a human will not notice any delay caused by its execution.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Orders of a Dying Unit

    I figured it out finally. Everything works great, but I still can't figure out how to preserve the damage type for the custom death animation. The only thing is I can't figure out how to credit the kill to certain player, or to set the type of damage that killed the unit (for custom death animations). The only trigger I can find is just "Kill Unit" and all it lets me do is choose the unit.

    This isn't that big of a deal, since the kill credit doesn't matter for my map, but the custom death animations would be nice to have.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Orders of a Dying Unit

    @MasterDinadan: Go

    I'm having some trouble getting this to work. I created a behavior and an effect which applies it. I created a behavior called "AvoidFatal" with damage response chance 1, fatal enabled, modify fraction to 0, and "Handled" response is the apply behavior effect.

    When the unit takes fatal damage, it is reduced to zero, but he never gains the dummy behavior, so the trigger doesn't run! I don't know why the effect isn't going off.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Orders of a Dying Unit

    @zifoon: Go

    Brilliant! I'll give a try.

    Seems like a dummy behavior isn't really necessary. I can just check for the existing behavior (the one that prevented the fatal blow) right?

    Nevermind, I see that the damage doesn't count as fatal for the purposes of the trigger. Dummy it is.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Orders of a Dying Unit

    @Ghrabthaar: Go

    There are many problems with this approach. The number of units this applies to is potentially unlimited. I could make an array with a very large size and give each unit a unique custom value and use the custom value as an index so that i have an array of EVERY unit's orders, but that's not very elegant.

    The other problem is that a units orders can change even if the unit is not issued an order. If a bunch of orders are queued up at once, then the unit's orders will change whenever it finishes a queued order, but this doesn't cause the "Unit Issued Order" event to go off.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Orders of a Dying Unit

    I have a unit that gets replaced by another unit when it dies. I'd really like for the newly spawned unit to have the same orders as the original unit, but I can't find any way to do this. I tried storing the unit's dying orders in a variable, using both the "Unit Dies" and the "Unit takes Damage" events (with the damage set to Fatal). However, in both cases, it just stored "No Order" because the unit lost it's orders upon death. It seems that the only way to know the units orders are to store them before the unit dies, but there is no way to predict that the unit is going to die!

    Anyone have any ideas?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Upgrade help
    Quote from Maul2: Go

    Bumpety bump :)

    I've just followed Dinadan's instructions on setting up a linear upgrade system but can't find a way to hide the button when the max level has been reached. What's happening is the max level finishes and the button remains, you can still click it and it will take your minerals but it will no longer have an upgrade effect on the target. Anyone know how to hide them?

    Just add another node to the requirement that counts the number of upgrades completed and check if it's below a certain number.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Devision %

    @MapCrafter: Go

    I did notice that the value is negative. You are modifying the kills variable with subtraction so if the point value is high enough, you will end up with a negative number. If Kills[1] is 2000 and the point value is 98000 but the two are supposed to be equal, then there must be some problem in how you determined Kills[1].

    If you want them to be equal, then make them equal, but considering the action you just described to me, it is apparent that the two are not equal. After running that action a few times, they will be pretty far off, and a negative value would be reasonable.

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