I have a few things that I want to be able to change about a unit mid game via triggers. They are Armor, Unit Speed, Unit Damage, and Cloak. I know how to do Cloak, but I don't know how (or if it's possible) to change the others mid game or for just a single unit (instead of all units).
Also, I have a sound that plays when each one is modified, is there any way to play a sound to the triggering player who typed the chat message? (The Chat message is what modifies the armor etc.)
I'm not entirely sure how you'd do it, or if it's even possible within the confines of the data editor.
It is entirely possible to hack up some triggers to accomplish much the same effect, however. If you wanted I could make something for you.
Im looking for something very similar for my map too, involving mid-game trigger unit stat changing...if you find an answer let me know, im trying to figure it out too
just create behaviors that increase a units damage and/or armor, and then apply them through triggers. Though it gets a bit trickier if you want different amounts to be added each time. Then you would have to create several behaviors with varying amount of bonus, create ones that only add 1 to armor and/or damage and add it several times, or you can try using set catalog value functions.
I never worked with sound in the editor so far, but i assume theres a function somewhere to play a sound.
Well now I've figured out passive behaviors. You just create a new one and change it's modification field to what you want. You can then apply it to a unit X amount of times. So if you made it so that it increased damage by 1, and applied it 45 times, you'd have +45 damage. That should work fine for your purposes.
Also, play sound should be pretty easily findable.
Well now I've figured out passive behaviors. You just create a new one and change it's modification field to what you want. You can then apply it to a unit X amount of times. So if you made it so that it increased damage by 1, and applied it 45 times, you'd have +45 damage. That should work fine for your purposes.
Also, play sound should be pretty easily findable.
That seems a bit excessive and not very elegant? I think if the OP was a bit more clear with his end goal we could help him out better *shrug*
Well... Inknow how to play a sound, just not sure how to play it only to the player who typed the chat message that did the behavior.
Ok what you need to do here is click on your event in your trigger and at the bottom of the trigger editor it will give you some helpful information about how to get information related to who or what triggered the event. I believe in this case it is just (Triggering Player). That will return an Int for you. Then when you use the play sound action you simply need to pass which Int(Player) you want to play the sound for.
Ok what you need to do here is click on your event in your trigger and at the bottom of the trigger editor it will give you some helpful information about how to get information related to who or what triggered the event. I believe in this case it is just (Triggering Player). That will return an Int for you. Then when you use the play sound action you simply need to pass which Int(Player) you want to play the sound for.
That's what I thought I could do, but when I click the "Function" check under the "Play sound" action, "Triggering Player" isn't there.
EDIT: Also, how would I make a behavior that upgrades armor once?
Just make it stackable, by simply changing the "Stats - Maximum stack count" on the behaviors to -1 to make it so you can add it an infinite amount. I also suggest you make the behavior hidden, so it still has an effect on the unit and you can see it, but you wont be able to see in-game that he has like 100 behaviors in the area of the UI that shows what behaviors units have.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a few things that I want to be able to change about a unit mid game via triggers. They are Armor, Unit Speed, Unit Damage, and Cloak. I know how to do Cloak, but I don't know how (or if it's possible) to change the others mid game or for just a single unit (instead of all units).
Bump.
Also, I have a sound that plays when each one is modified, is there any way to play a sound to the triggering player who typed the chat message? (The Chat message is what modifies the armor etc.)
Anyone?
I found how to change unit speed, I just need unit damage and armor. Plus I need to play the sound only to the person typing the message.
I'm not entirely sure how you'd do it, or if it's even possible within the confines of the data editor.
It is entirely possible to hack up some triggers to accomplish much the same effect, however. If you wanted I could make something for you.
Im looking for something very similar for my map too, involving mid-game trigger unit stat changing...if you find an answer let me know, im trying to figure it out too
You could just make a Behavior that adds Armor and Damage and add it using Add Behavior to Unit, or whatever that action is called.
@PiercingGoblin:
just create behaviors that increase a units damage and/or armor, and then apply them through triggers. Though it gets a bit trickier if you want different amounts to be added each time. Then you would have to create several behaviors with varying amount of bonus, create ones that only add 1 to armor and/or damage and add it several times, or you can try using set catalog value functions.
I never worked with sound in the editor so far, but i assume theres a function somewhere to play a sound.
Well now I've figured out passive behaviors. You just create a new one and change it's modification field to what you want. You can then apply it to a unit X amount of times. So if you made it so that it increased damage by 1, and applied it 45 times, you'd have +45 damage. That should work fine for your purposes.
Also, play sound should be pretty easily findable.
Well... Inknow how to play a sound, just not sure how to play it only to the player who typed the chat message that did the behavior.
@Nashadun: Go
That was my original thought, however a modify unit effect might be better because it seems like he just wants it to be a permanent effect.
That seems a bit excessive and not very elegant? I think if the OP was a bit more clear with his end goal we could help him out better *shrug*
Ok what you need to do here is click on your event in your trigger and at the bottom of the trigger editor it will give you some helpful information about how to get information related to who or what triggered the event. I believe in this case it is just (Triggering Player). That will return an Int for you. Then when you use the play sound action you simply need to pass which Int(Player) you want to play the sound for.
That's what I thought I could do, but when I click the "Function" check under the "Play sound" action, "Triggering Player" isn't there.
EDIT: Also, how would I make a behavior that upgrades armor once?
Can anyone help me with my previous post?
@PiercingGoblin:
Just make it stackable, by simply changing the "Stats - Maximum stack count" on the behaviors to -1 to make it so you can add it an infinite amount. I also suggest you make the behavior hidden, so it still has an effect on the unit and you can see it, but you wont be able to see in-game that he has like 100 behaviors in the area of the UI that shows what behaviors units have.