how to activate a units attack

Level 5
Joined
Mar 21, 2007
Messages
155
hi

is there any way possible to activate/deactivate a units attack? (through a trigger or an ability or whatever). you know all units have 2 different attacks? (e.g gyrocopter, 1 for attacking air units, 1 for attacking ground units). is there any way anyone can think of how to twiddle with them in-game?

ty :thumbs_up:
 
Level 5
Joined
Dec 17, 2007
Messages
145
Well, there's an Upgrade Editor under the Object editor. I think it's the last tab.

From there, I'd make a custom upgrade based off of the Gyrocopter Bombs upgrade, or the Moon Glaive upgrade. After that, modify the upgrade and then just trigger the upgrade as learned when you want to turn on the other attack.

Be forewarned, this can't be reversed.

Like I said, using Orbs is a good alternative, and that can be reversed as often as you need.

UreDe4d said:
and add/remove it according to your needs,
Can't be done, you can't un-upgrade.
 
Level 5
Joined
Mar 21, 2007
Messages
155
no but thats the idea i want. i want it to be reversable.

this is what i want. if you have ever played parasite 2, you see theres the energy suits selection. all of them have an attack, that drains mana, its not any form of searing arrow ability. there mana will slowly deplete. when it hits 0, every time you try to attack it will spam you saying "out of ammo (mana) please reload with an energy pac (mana potion)"

i want to try and replicate that the best i can. i fear he used jass to do that (uhh i HATE jass) so i'm trying to make it so that. when the unit is first created, he has no attack, but an ability that says (turn on flame-thrower(its for a flame thrower dude)). when that ability is activated. a trigger sets his mana regen to -1 per second and ENABLES his attack. i think i can do a trigger in GUI to order him to spam stop and a message if he runs out of mana and trys to attack. and then he has an ability that says "turn off flamethrower" and that sets the man regen to 0 and turns off his attack.

it was the best i could think of =(
 
Level 9
Joined
Sep 3, 2007
Messages
375
this is what i want. if you have ever played parasite 2, you see theres the energy suits selection. all of them have an attack, that drains mana, its not any form of searing arrow ability. there mana will slowly deplete. when it hits 0, every time you try to attack it will spam you saying "out of ammo (mana) please reload with an energy pac (mana potion)"

The way it works in Parasite 2, it if you're out of ammo a trigger just tells your unit to stop every time it attacks.
 
Level 9
Joined
Sep 3, 2007
Messages
375
Whenever a unit attacks, just make it so it sets its mana down by an integer, or percent. when it reaches zero (or another number) make it activate another trigger that makes the unit stop every time it tries to attack (until mana is restored).
 
Level 5
Joined
Mar 21, 2007
Messages
155
but in GUI, buggy city?? well if you say, ill try it......

is this ok?
 

Attachments

  • print screen 2.jpg
    print screen 2.jpg
    32.4 KB · Views: 107
Level 5
Joined
Dec 17, 2007
Messages
145
It's a very easy trigger.

I don't use GUI personally, but I'll write it out the best I can.

Events
A unit is attacked

Conditions
Attacking unit [insert stuff here. Such as the unit type, item they're holding, etc.]

Actions
If Attacking Unit's Mana is Less than or equal to 0 then
Issue Attacking unit to Stop
call Display Message to Player [whatever player] "Blaawwghh!!"
Else
Set Attacking Unit's mana to (Attacking Unit's Mana) - 1 [or whatever]
Endif

Hope this helps you!
 
Level 5
Joined
Dec 17, 2007
Messages
145
Yep. Think of it like this.

If I'm a boy then I like warcraft. Else (I'm not a boy) then I like dolls.

If true then blah, else (false) bloo.

Elseif statements, used only in JASS I believe, are really helpful too. Used like this:

If it is wednesday then I'll go dancing
Elseif it is tuesday then I'll die.

Sorry, got ranting =P But there you go anyways.
 
Top