| 03-10-2005, 05:19 AM | #1 |
Well all i want is to trigger attack. My hero wont auto attack, infact, it doesn't attack at all. instead i want to implement attack with keys. i was wondering how the triggers for that would be. In short, lets say i want to assign the letter "K" to attack everytime i press it. if this is to confusing plz ask and ill clerify. ps. would this attak trigger work with abilities as well. like if i wanted to use a bloodmages flamestrike, but i want it so that it is only usable if i press the button hotkey. thx ![]() |
| 03-10-2005, 06:44 AM | #2 | |
Quote:
Do you want your abilities like flamestrike auto choose target or you want to be able to choose ... You can set the Combat - Aquisition range in your units so he won't go to attack till he are in range, I think you can use trigger for the keyboard letter (Event Player - Keyboard Event, you will have to know if it will be auto target or the player to choose target... tell me more and I'll try to help, the best is probably with JASS, but i'm not enough good to use it ... I hope I helped you a bit. |
| 03-10-2005, 08:02 AM | #3 |
Guest | It is a bit confusing. Do you want your hero to attack just out in the open air? or do you want him to attack a specific unit? Please post your trigger here, and i MIGHT be able to help you. |
| 03-10-2005, 12:22 PM | #4 |
Well all i want is to trigger attack. My hero wont auto attack, infact, it doesn't attack at all. instead i want to implement attack with keys. i was wondering how the triggers for that would be. In short, lets say i want to assign the letter "K" to attack everytime i press it. if this is to confusing plz ask and ill clerify. ps. would this attak trigger work with abilities as well. like if i wanted to use a bloodmages flamestrike, but i want it so that it is only usable if i press the button hotkey. thx Right. Tricky. I don't THINK you can really make it so they can't cast abilities w/o pressing the hotkey, but I may be able to help you with the attacking thing. First, create an ability based on shockwave/carrion swarm called "dummyattack". Give this the damage, mana cost, and graphics that you want. Give it a very short range, say 150. Then, set the hero to have no attack normally. Create a second ability based off War Stomp, and set it to have no damage, mana cost or art, then call that "attack", and give it the tooltip you want. Give it the hotkey that you want to use to attack, and give the "attack" ability to your hero. Next, create a dummy unit of some kind. Call it "DummyAttacker". Make it as small as you can, give it invisibility and the "Locust" ability. This will make it invulnerable and unselectable. Give it the "dummyattack" ability I had you make earlier. Then create a trigger: Event: Unit finishes casting an ability Condition: Ability being cast equal to (attack) Action: Create one (DummyAttacker) at position of (Casting Unit) Order (Last Created Unit) to cast (dummyattack) at (position of casting unit offset by (150) in (facing angle of (casting unit))) Remove (Last Created Unit) This SHOULD deal however much damage you gave to the "dummyattack" ability over a small area directly in front of your hero. I'm not sure that trigger is 100% perfect though, so post here again if there's a problem. (Note that they will still be able to use the "attack" ability by clicking its icon.) |
| 03-11-2005, 06:08 AM | #5 |
im currently working on the trigger. i haven't tested it yet. but sorry its all confusing. here is just part of what i want to do so lets just concentrate on this ^_^ ....my hero moves with the arrow keys and stuff, and it doesn't attack. i want to implement attack but by pressing a key on the keyboard not by clicking. so i just want it to slash into the air if this hotkey is pressed, or if its close enought to something it would deal damage to it. so i want it to be able to attack freely, consider it like making a hack and slash type game. anyway. ill tell u guys how the trigger goes. hopefully it works. thx for the suggestionsps. i know this still sounds confusing :o so plz ask if u need me to elaborate more. |
| 03-11-2005, 09:24 AM | #6 |
Yes, now look at the trigger I posted! That should do it! |
| 03-11-2005, 06:04 PM | #7 | |
Quote:
this action trigger im having trouble with. when i try to find this unit trigger, all the options that i can u (or so i think ) are : unit- issue order targeting a unit unit- issue order targeting a point unit-issue order targeting a destructable unit-issue order targeting an item unit-issue order with no target and the other three are for upgrading and building order. well i just don't understand how to start that trigger ? :( where is it? ...but other than that i did the other stuff u said with the dummy attacks and all. that trigger is the only one i need ^_^ .... ---Bill |
| 03-12-2005, 06:58 PM | #8 |
Unit- Issue order Targeting a Point Then make the order string "shockwave" I think... |
| 03-13-2005, 02:06 PM | #9 |
Guest | how do you make a unit move :( :( :( :( :( :( :( :( :( :( :( :( :( :( |
| 03-13-2005, 02:29 PM | #10 |
I've made what you're talking about about 8+ months ago. I don't know if you want my version or not, but I'll post it up and you can take what you want from it and all that. I'll post up the map if you're really interested(never finished the map, and map also has arrow movement options with double tap, but that isn't working, I actually am going back now to try and get that to work). Anyway, here's the trigger: Code:
Attack
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Attack
Actions
Set DMGAble = False
Set DMGAttacking = True
Set DMGDelt = ((Random real number between DMGMin and DMGMax) + DMGBonus)
Unit - Create 1 Attack Checker for (Owner of PlayerHero) at (((Position of PlayerHero) offset by (0.00, 0.00)) offset by 75.00 towards ((Facing of PlayerHero) + 0.00) degrees) facing Default building facing degrees
Set DMGRange = (Last created unit)
Animation - Change DMGRange's vertex coloring to (0.00%, 0.00%, 0.00%) with 100.00% transparency
Unit Group - Pick every unit in (Units within 100.00 of (Position of DMGRange) matching ((Matching unit) Not equal to PlayerHero)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Picked unit) Not equal to DMGRange
(Owner of (Picked unit)) Not equal to Neutral Passive
Then - Actions
Set CriticalChance = (Random real number between 1.00 and 100.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CriticalChance Less than or equal to CriticalChance_PCT
Then - Actions
Set DMGDelt = (DMGDelt x 2.00)
Unit - Order PlayerHero to damage (Picked unit) for DMGDelt using attack type Hero and damage type Normal.
Else - Actions
Unit - Order PlayerHero to damage (Picked unit) for DMGDelt using attack type Hero and damage type Normal.
Else - Actions
Do nothing
Unit - Remove DMGRange from the game
Set DMGRange = No unit
Wait 0.05 seconds
Unit - Remove Attack from PlayerHero
Countdown Timer - Start ATCKCooldownTimer as a One-shot timer that will expire in (ATCKCooldown - 0.05) seconds
Set DMGAttacking = FalseAnd the cooldown trigger: Code:
Cooldown
Events
Time - ATCKCooldownTimer expires
Conditions
Actions
Set DMGAble = True
Unit - Add Attack to PlayerHeroI should mention if you wan this online, all you have to do is make the variables with arrays. I originally had it online, but moved it over to a campaign, so I took out the variables. I know that that isn't completely lagless, but I don't feel like doing that at the moment, so you're on your own there. But that's how I did it, and it worked out good to. I also had tried it with regions instead of a creating a dummyunit to check for an enemy, but all my testing showed using the dummyunit was a better choice. |
