• 🏆 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!

[Trigger] Attack Once

Status
Not open for further replies.
Level 2
Joined
Aug 23, 2008
Messages
6
Could try creating an invisible creature at the towers position offset by 700 towards 90 degrees, give the tower splash damage (or which ever effect you are trying to create here) and order the tower to attack the created creature. Wait until the creatures health is below 100%, order the tower to stop.

To handle multiple players walking into the region either create a counter for how many times to fire, or create a boolean preventing it from firing again until the previous shot has been fired.
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Here is the trigger:

  • Cannon
    • Events
      • Unit - A unit enters (YourRegion)
    • Conditions
    • Actions
      • Set TempPoint = ((Position of (Cannon)) offset by 700.00 towards 90.00 degrees)
      • Unit - Order (Cannon) to Attack Ground TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
The string for attack ground order is: "attackground"
 
He knows how to attack ground; his problem is how to attack ground once. We already have the "Attack once"; what about the "Attack ground once"? Since it doesn't exist, he needs another solution.
@dimitri, you can make a damage detection system (-as always-), where you get the damage source type; if it is equal to your cannon, then kill damage source.
So, it would go like:

  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Temp_Group - (Units in (Playable Map Area))
    • Unit Group - Pick up every unit in (Temp_Group) and do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger3 <gen> the event (Unit - (Picked unit) takes damage)
    • Custom script: call DestroyGroup (udg_Temp_Group)
  • Trigger2
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
  • Actions
    • Set Unit1 = (Triggering unit)
    • Trigger - Add to Trigger3 <gen> the event (Unit - (Unit1) takes damage)
  • Trigger3
  • Events
  • Conditions
    • ((Unit-type) of (Damage Source)) Equal to Cannon
  • Actions
    • Unit - Kill (Damage source)
 
Level 8
Joined
Aug 4, 2008
Messages
279
Jassnewgen pack doesnt work with me, i use Vista.
Pharaoh@ idont think this is solve the problem..
Child_ofBloom@ the cannon is going to still atacking.
LlamanamedOsama@ i will try it..
F3cority@the problem is the attack ground once
Hetalar@ this solution could solve, but it would be very big since i have 8 towers.
 
Status
Not open for further replies.
Top