• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Switching weapons temporarily

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I would like to make a hero ability that does the following:

When the hero casts the ability, his weapon is replaced with a flamethrower beam weapon that does more and more damage over time (like the Protoss beam attack). This effect lasts for 30 seconds or so, and then his normal weapon comes back.

I am very new to the editor, but i understand this is not that easy to do. I'd be happy if you could just give an outline of the ability, like:

1. What ability should I base it on?

2. How do I make the ability switch weapons? Do I use restrictions?

And finally, if this is very difficult to do perhaps I should skip it and come back later when I'm more familiar with the editor.

Thank you.
 
Go to stimpak (marine) (not the redirect version) and left click and duplicate.

Check 'Effects', 'Behaviors > Marine - Stimpack'

Edit your Behavior.

Make Stats - Flags (visible) to false.
Go to 'Weapon - Modification - Weapons enabled' and set it to your fire beam
Go to 'Weapon - Modification - Weapons disabled' and set it to your old beam.
Change all of the modifications back to normal, so your unit doesn't gain speed from the old stimpack stuff.
set 'Stats - Duration' to 30.0 or whatever time you want.

Go to your effect.
Go to Effect - behaviour and set it to the behavior you just made.

Go back to your ability, set Effect - Effects to your effect. (maybe not required)

You can edit buttons and the like after.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Thanks again. I have a few more questions and some hints for future people who might want to do this.

Questions:

1. Ideally, I'd like the player to be able to cancel the effect and automatically revert back to his usual weapon. I got the sense there was a cancel effect built into the game, but I can't seem to get it to work. I've looked at:
Ability - Cancelable
Ability - Commands, has a cancel effect but I gave it a button, put the button on the unit but the button never shows up.

Is there a good way to cancel a buff without triggers? What is the cancel section of the "ability - commands" tab actually do if it never lets you cancel an ability?

2. When he swaps weapons, the first weapon is still there in his UI but says "disabled" the second weapon never appears. It still works, but it doesn't look right. Is there a simple fix for this?

3. As a general question, I noticed Swann (the hero) has 2 weapons. He fires his gun, but if someone melee's him, he'll just punch him with his Fist weapon. I gave my hero (not swann) a gun and a flamethrower so the ability swaps out his gun for this flamethrower. It works fine, but what determines which gun he will use? Is there a way to disable the flamethrower at the start so that the swap ability enables it?

Thanks.



Hints to future readers:
- the "weapon -enable" feature on behaviors is invisible unless you show advanced fields
- the unit must start with both weapons.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
1. Ideally, I'd like the player to be able to cancel the effect and automatically revert back to his usual weapon. I got the sense there was a cancel effect built into the game, but I can't seem to get it to work. I've looked at:
Ability - Cancelable
Ability - Commands, has a cancel effect but I gave it a button, put the button on the unit but the button never shows up.

Is there a good way to cancel a buff without triggers? What is the cancel section of the "ability - commands" tab actually do if it never lets you cancel an ability?
Look how cloak does it. That gives a behaviour and is cancleable (as well as can be made to time expire).
 
Status
Not open for further replies.
Top