facing angle abilities

goldDannsp

New Member
Reaction score
0
well, i am a begineer in map making, and the thing i want to know is how can i make an ability that works in the facing angle of the caster. example: ballista of black pearl in battle ships pro, i only need you to explain me how this works:thup:
 

Shura

New Member
Reaction score
45
Well it would help to know exactly what you're trying to do, but you're going to need to use Unit - Facing Angle.
 

Wratox1

Member
Reaction score
22
Well it would help to know exactly what you're trying to do, but you're going to need to use Unit - Facing Angle.

he wants to do a spell that only works in one direction of a unit, for example in front of the caster
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, so you basically want (For example) a projectile to be sent out in the facing of the caster ? (This is an instant spell, right ? :eek:)

Then, the basic concept is to maybe use a dummy unit, and then use that unit as the projectile...
And simply move it in the direction the caster is facing... ;)

Here's a sample trigger for you to study (The first ones are not MUI, and not even MPI) :D

Frst way:
Trigger:
  • Projectile Facing
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ability 1
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempPoint2 = (TempPoint offset by 500.00 towards TempReal degrees)
      • Set TempReal = (Facing of (Triggering unit))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint facing TempReal degrees
      • Set Dummy = (Last created unit)
      • Trigger - Turn on Projectile Moving <gen>


Trigger:
  • Projectile Moving
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint3 = (TempPoint offset by 10.00 towards TempReal degrees)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Unit - Move Dummy instantly to TempPoint3, facing TempReal degrees
      • Set TempPoint = (Position of Dummy)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between TempPoint2 and TempPoint3) Less than or equal to 5.00
        • Then - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint3)


Second way (MUI):
Trigger:
  • Projectile MUI Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set TempHash = (Last created hashtable)


Trigger:
  • Projectile Facing MUI
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ability 1
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempPoint2 = (TempPoint offset by 500.00 towards (Facing of (Triggering unit)) degrees)
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at TempPoint facing TempReal degrees
      • Hashtable - Save (Facing of (Triggering unit)) as 1 of Key (Last created unit) in TempHash
      • Hashtable - Save Handle OfTempPoint as 2 of Key (Last created unit) in TempHash
      • Hashtable - Save Handle OfTempPoint2 as 3 of Key (Last created unit) in TempHash
      • Unit Group - Add (Last created unit) to Periodic_Group
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Periodic_Group) Equal to 1
        • Then - Actions
          • Trigger - Turn on Projectile Moving MUI <gen>
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)


Trigger:
  • Projectile Moving MUI
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Periodic_Group and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Load 3 of Key (Picked unit) in TempHash)
          • Set TempPoint2 = (Position of (Picked unit))
          • Set TempPoint3 = (TempPoint2 offset by 10.00 towards (Load 1 of Key (Picked unit) from TempHash) degrees)
          • Unit - Move (Picked unit) instantly to TempPoint3, facing (Load 1 of Key (Picked unit) from TempHash) degrees
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TempPoint and TempPoint3) Less than or equal to 5.00
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Periodic_Group
              • Unit - Remove (Picked unit) from the game
              • Hashtable - Clear all child hashtables of child Key (Picked unit) in TempHash
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Periodic_Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Custom script: call RemoveLocation(udg_TempPoint3)


Hope this helps a little bit :p
 

goldDannsp

New Member
Reaction score
0
yes, the first way works properly but in the second when i set the action ´´HandleOftempPoint as 2 of 0 in temphash´´ the world editor shuts down and sends me an error, but thanks for the first way:thup:
 

goldDannsp

New Member
Reaction score
0
yeah, i made that ability and it works well but it does not affects air units, here are my triggers: ( my world editor is in spanish )
Trigger:
  • ability
    • Acontecimientos
      • Unidad - A unit Inicia el efecto de una habilidad
    • Condiciones
      • (Ability being cast) Igual a Dummy_2
    • Acciones
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempPoint3 = (Position of (Triggering unit))
      • Set TempPoint2 = (TempPoint offset by 500.00 towards TempReal degrees)
      • Set TempReal = (Facing of (Triggering unit))
      • Unidad - Create 1 dummy for (Owner of (Triggering unit)) at TempPoint facing TempReal degrees
      • Set Dummy = (Last created unit)
      • Detonador - Turn on missile moving <gen>


Trigger:
  • missile moving
    • Acontecimientos
      • Tiempo - Every 0.04 seconds of game time
    • Condiciones
    • Acciones
      • Set TempPoint3 = (TempPoint3 offset by 10.00 towards TempReal degrees)
      • Unidad - Order Dummy to Mover a (TempPoint offset by 1000.00 towards TempReal degrees)
      • Wait 0.80 seconds
      • Set Explosion_Point = (Position of Dummy)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • (Distance between TempPoint and Explosion_Point) Mayor que o igual a 5.00
          • (Number of units in (Units within 100.00 of (Position of Dummy))) Mayor que o igual a 1
        • Entonces: Acciones
          • Unidad - Cause (Last created unit) to damage circular area after 0.00 seconds of radius 75.00 at Explosion_Point, dealing 100.00 damage of attack type Conjuros and damage type Normal
          • Efecto especial - Create a special effect at (Position of Dummy) using war3mapImported\NewAirEX.mdx
          • Unidad - Remove Dummy from the game
        • Otros: Acciones
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • (Distance between TempPoint2 and TempPoint3) Mayor que o igual a 5.00
        • Entonces: Acciones
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Custom script: call RemoveLocation(udg_TempPoint3)
          • Custom script: call RemoveLocation(udg_Explosion_Point)
          • Detonador - Turn off (This trigger)
        • Otros: Acciones


Trigger:
  • no objectives
    • Acontecimientos
      • Unidad - A unit Finaliza el lanzamiento de una habilidad
    • Condiciones
      • (Ability being cast) Igual a Dummy_2
    • Acciones
      • Wait 2.80 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • (Number of units in (Units within 100.00 of (Position of (Last created unit)))) Igual a 0
        • Entonces: Acciones
        • Otros: Acciones
      • Unidad - Cause (Last created unit) to damage circular area after 0.00 seconds of radius 75.00 at Explosion_Point, dealing 100.00 damage of attack type Conjuros and damage type Normal
      • Efecto especial - Create a special effect at (Position of (Last created unit)) using war3mapImported\NewAirEX.mdx
      • Unidad - Remove (Last created unit) from the game


It damages only ground units, can anyone tell me how i can do to damage both ground and air units??:banghead:
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Sorry, I edited the triggers now, and they should work now :S

Anyways, why would you use a 0.04 event, when you wait 0.8 seconds ? :S

And, this should be simply "Move unit" not "Order unit to move":
Trigger:
  • Unidad - Order (Last created unit) to Mover a (TempPoint offset by 1000.00 towards TempReal degrees)

Trigger:
  • Unit - Move Dummy instantly to TempPoint3, facing TempReal degrees


You should also replace all (Last created unit) with "Dummy" (The variable ;))

Take a look at my last post again :D
 

goldDannsp

New Member
Reaction score
0
i made the changes and the trigger works good,:thup: and i replaced the last trigger with the ´´non objective´´ trigger, but it only damages ground units, i want to know why?:(, ah and i put that ´´wait 0.80´´ because if i remove it, the trigger moves too quick and don´t lets the explosion part work fine, and it damages the caster.:confused:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top