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

Angle damage variation

Status
Not open for further replies.
Level 11
Joined
May 26, 2009
Messages
760
Greetings,

I wonder if it's possible and if then someone could help me create a system where depending on which angle the target unit is attacked from different amount of damage will be dealt.

Basically I was only thinking of having "four angles" - 90 degrees each, plus some extra special effects. The angles are Front, Right side, Left side, Back. The image below shows what ratio the attack would have.

attachment.php


Depending on the unit different effects will take place at different angles. Each type of unit is a 'unique' case. In the Footman's case, his Defend will only work when attacked from the front and right. Also critical strikes and other passive abilities have an increased percentage of success when attacked from the back, we can call it 'backstab'.

Simply the first question is, is this possible in GUI?

Yours Truly,
Chizume
 

Attachments

  • angles.PNG
    angles.PNG
    84.3 KB · Views: 146
Level 14
Joined
Aug 30, 2004
Messages
909
It is possible to determine the angle between attacker and target, and each unit's facing.

Getting critical strike's percentage chance to use that will be impossible unless you trigger critical strike (rather than using the ability). This will take an awful lot of trigger work though.

Someone had a nice trigger that worked better than mine using cosine and sine and all those old math terms... hopefully they can repaste it here. It was posted in the last few days in a thread in which someone had a few simple questions...one of which was about a backstab. I posted in it too, so you can search my name and find it probably.

I wouldn't recommend this if you're new; it'll be very hard.
 
Level 11
Joined
May 26, 2009
Messages
760
Okay, thanks for the information.

What about a simplified version? A simple front and back system with double damage on the back and normal damage on the front, that can't be too many triggers, or? I'm not much of a triggerer, and I'm more looking for a simple solution rather than a challenge, and am willing to compromise. See image below for graphical visualization.
attachment.php
Yours,
Chizume
 

Attachments

  • angles.PNG
    angles.PNG
    297.8 KB · Views: 94
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

  • Untitled Trigger 001
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Real_3 = (Facing of Blood Mage 0001 <gen>)
      • Set Temp_Loc_3 = (Position of Blood Mage 0001 <gen>)
      • Set Temp_Loc_4 = (Position of Paladin 0000 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Cos(((Temp_Real_3 - 45.00) - (Angle from Temp_Loc_3 to Temp_Loc_4)))) Greater than (Cos(45.00))
        • Then - Actions
          • Game - Display to (All players) the text: Front Right
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Cos(((Temp_Real_3 + 45.00) - (Angle from Temp_Loc_3 to Temp_Loc_4)))) Greater than (Cos(45.00))
            • Then - Actions
              • Game - Display to (All players) the text: Front Left
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Cos(((Temp_Real_3 - 135.00) - (Angle from Temp_Loc_3 to Temp_Loc_4)))) Greater than (Cos(45.00))
                • Then - Actions
                  • Game - Display to (All players) the text: Back Right
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Cos(((Temp_Real_3 + 135.00) - (Angle from Temp_Loc_3 to Temp_Loc_4)))) Greater than (Cos(45.00))
                    • Then - Actions
                      • Game - Display to (All players) the text: Back Left
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Cos(((Temp_Real_3 + 90.00) - (Angle from Temp_Loc_3 to Temp_Loc_4)))) Greater than (Cos(45.00))
                        • Then - Actions
                          • Game - Display to (All players) the text: Front
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Cos(((Temp_Real_3 - 90.00) - (Angle from Temp_Loc_3 to Temp_Loc_4)))) Greater than (Cos(45.00))
                            • Then - Actions
                              • Game - Display to (All players) the text: Back
                            • Else - Actions

maybe this will help you too ^^

Greetings
~ The Bomb King > Dr. Boom
 
Level 8
Joined
Jun 26, 2010
Messages
530
you could use a simple trigger "unit is attacked -> make atacking unit damage atacked unit equal to "damage dealt" (freehanded)

You would need a Dmg detection system, but you can find on ready to be used here on hive.
 
Level 9
Joined
Jun 25, 2009
Messages
427
Okay, thanks for the information.

What about a simplified version? A simple front and back system with double damage on the back and normal damage on the front, that can't be too many triggers, or? I'm not much of a triggerer, and I'm more looking for a simple solution rather than a challenge, and am willing to compromise. See image below for graphical visualization.
attachment.php
Yours,
Chizume

I would try to do it tomorrow HOPEFULLY before leaving to meh village and there is no internet :sad:
 
Status
Not open for further replies.
Top