• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

clicking attack

Status
Not open for further replies.
Level 4
Joined
Dec 12, 2008
Messages
98
Hi all, im making a new map. U walk with A and S and i want it to attack with mouse but i have to problems.

- If you come closer to the unit u will attack automaticly, can you turn that off? i tried with attack target priority in the data editor but that didnt work

- the attack system must be like click, attack, click, attack, click, attack etc. Becouse if i just use this:


<<code Galexy triggers>>
Attack
Events
UI - Player 1 clicks Left mouse button Down.
Local Variables
Conditions
Actions
Unit - Order Zealot [19.03, 163.96] to ( Attack targeting (Closest unit to (Position of Zealot [19.03, 163.96]) in (Any units in (Entire map) owned by player 2 matching No Unit Filter, with at most 1))) (Replace Existing Orders)
<</code>>

You just have to click and u automaticly walk to the closest unit ánd u only have to click once and i want it so you need to click repeatedly.

Hope you understand it. If not i explain more.
Thanks
 
Level 1
Joined
Apr 1, 2009
Messages
7
I'll just point this out
nobody else wants to click repeatedly, it's tedious and annoying.
don't know how to do it either x]
 
For all others who don't know..

1 is getting attacked response
2 is attacking response

1.png


2.png
 
Level 4
Joined
Dec 12, 2008
Messages
98
i did it different, the first part was the same but then if you attack someone you walk away so u also need an trigger,

  • attack stop
    • Events
      • Unit - Any Unit is attacked
    • Local Variables
    • Conditions
      • (Owner of (Attacking Unit)) == 2
    • Actions
      • Unit - Order Zealot [20.38, 165.21] to ( Move targeting (Attacking Unit)) (Replace Existing Orders)
and for the click attack ability this one:


  • Click attack
    • Events
      • UI - Player 1 clicks Left mouse button Down.
    • Local Variables
    • Conditions
      • (Number of Living units in (Any units in (Region(((Position of Zealot [20.38, 165.21]) offset by 1.0 towards 5.0 degrees), 1.0)) owned by player 2 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) > 0
    • Actions
      • Environment - Execute Zealot - Psi Blades (Damage) on (Unit 1 from (Any units in (Region((Position of Zealot [20.38, 165.21]), 5.0)) owned by player 2 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) from Zealot [20.38, 165.21]
      • Animation - Play Attack Walk animation for (Actor for Zealot [20.38, 165.21]) as Default, using No Options options and Default Time blend time
      • General - Wait 0.3 Game Time seconds
      • Trigger - Turn (Current trigger) Off
      • General - Wait 0.3 Game Time seconds
      • Trigger - Turn (Current trigger) On

:goblin_yeah:
 
Status
Not open for further replies.
Top