Studying off of the Weapon_Swap map, I think I have somewhat of an idea how to swap weapons in the way your map implements it (switching between multiple weapons, swapped weapon stays active unless changed), although I am having difficulty using this information to have a weapon temporarily replace the unit's default weapon.
I am currently attempting this by giving the unit a weapon, creating a Buff that disables that weapon, but adds and enables another weapon for 7 seconds, tying this Behavior to an Apply Behavior Effect, which in turn is tied to an Effect - Instant ability. My current issue is that the new weapon isn't added and enabled, and the old weapon isn't disabled.
Hrmm, I'm not seeing the Behavior Modification in the Switch Effect...
As for the Fall Through, I see the box to enable it, but where would I specify the Remove Behavior Fall Through?
(I'm a baby bird when it comes to data editor stuff so you might have to regurgitate this for me - do you think you could tell me what to put in which fields? Thanks for the help!)
Apply Behavior mate then make a Buff , Then in that Buff' Behavior Modification :)
for the Remove Behavior part, In the Switch Effect make sure its "Fall Through" then back in the remove behavior, Set your desired to be removed Behavior through the Remove behavior partition :)
I know this thread is all about swapping weapons without triggers, but I must say that with triggers you have a really EASY way to do this. Simply name your buff the exact same as your weapon. Give each player a string variable to hold current weapon. When items change, if current weapon has a different string than your variable, remove behavior weaponname, add behavior weaponname, set variable to new weaponname. Tada, infinite weapon switching possibilities with 1 condition and 2 actions, that's it. Easier if you use custom script of course to avoid the gamelink nonsense.
For each new weapon, all that is needed is 1 behavior with that weapon on it, can seriously cut down on the amount of work you have to do if you gonna allow lots of weapons. Not as important if you only allowing like 3-5. This of course can be done completely data, just a lot more work in my opinion.
Mugen245 is also quite a novice in the data editor.
Have the unit use a buff to apply the default weapon, one with infinite duration that is in the Behavior: Behaviors - Behavior field of the unit. This means the unit will have the weapon on all the time unless the buff is disabled. The reason you do this is that if you use a buff to disable a weapon it greys out the weapon icon and does not look as good.
Your second weapon buff disables the default weapon buff. Remember this is all done using the Weapon: Modification - Weapons - Weapon field of buffs.
Made sure the Effect - Unit Value field of the Apply Behavior effect is set to caster?
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Whoops, should've responded to this thread a bit earlier!
After sifting through the Behavior: Modification Buff that was supposed to do the weapon-swapping and making sure the right weapons were added, disabled, and enabled, I decided to double-check the ability itself and it turns out that I had forgotten to add the Effect to it!
It seems like a simpler solution than what I've seen so far, although I think it's mostly limited switching between two weapons.
Studying off of the Weapon_Swap map, I think I have somewhat of an idea how to swap weapons in the way your map implements it (switching between multiple weapons, swapped weapon stays active unless changed), although I am having difficulty using this information to have a weapon temporarily replace the unit's default weapon.
I am currently attempting this by giving the unit a weapon, creating a Buff that disables that weapon, but adds and enables another weapon for 7 seconds, tying this Behavior to an Apply Behavior Effect, which in turn is tied to an Effect - Instant ability. My current issue is that the new weapon isn't added and enabled, and the old weapon isn't disabled.
Use a Switch Effect then in the Behavior Modification apply a Weapon of your Choice, While in the Switch Effect.
Create a Remove Behavior Fall Through
@Mugen245: Go
Hrmm, I'm not seeing the Behavior Modification in the Switch Effect...
As for the Fall Through, I see the box to enable it, but where would I specify the Remove Behavior Fall Through?
(I'm a baby bird when it comes to data editor stuff so you might have to regurgitate this for me - do you think you could tell me what to put in which fields? Thanks for the help!)
@ItemsGuy: Go
Apply Behavior mate then make a Buff , Then in that Buff' Behavior Modification :)
for the Remove Behavior part, In the Switch Effect make sure its "Fall Through" then back in the remove behavior, Set your desired to be removed Behavior through the Remove behavior partition :)
I know this thread is all about swapping weapons without triggers, but I must say that with triggers you have a really EASY way to do this. Simply name your buff the exact same as your weapon. Give each player a string variable to hold current weapon. When items change, if current weapon has a different string than your variable, remove behavior weaponname, add behavior weaponname, set variable to new weaponname. Tada, infinite weapon switching possibilities with 1 condition and 2 actions, that's it. Easier if you use custom script of course to avoid the gamelink nonsense.
For each new weapon, all that is needed is 1 behavior with that weapon on it, can seriously cut down on the amount of work you have to do if you gonna allow lots of weapons. Not as important if you only allowing like 3-5. This of course can be done completely data, just a lot more work in my opinion.
@ItemsGuy: Go
Mugen245 is also quite a novice in the data editor.
Have the unit use a buff to apply the default weapon, one with infinite duration that is in the Behavior: Behaviors - Behavior field of the unit. This means the unit will have the weapon on all the time unless the buff is disabled. The reason you do this is that if you use a buff to disable a weapon it greys out the weapon icon and does not look as good.
Your second weapon buff disables the default weapon buff. Remember this is all done using the Weapon: Modification - Weapons - Weapon field of buffs.
Made sure the Effect - Unit Value field of the Apply Behavior effect is set to caster?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go
Whoops, should've responded to this thread a bit earlier!
After sifting through the Behavior: Modification Buff that was supposed to do the weapon-swapping and making sure the right weapons were added, disabled, and enabled, I decided to double-check the ability itself and it turns out that I had forgotten to add the Effect to it!
It seems like a simpler solution than what I've seen so far, although I think it's mostly limited switching between two weapons.
Up to you what best suits your needs.
Since I made that map I discovered tech aliases.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg