Making projectiles bounce of walls

Galdiuz

Creator of Photon Command
Reaction score
98
I'm making a projectile system, and now I want projectiles to bounce of walls (Similar to the hook in Pudge Wars). How do I create this?
 

bLu3_eYeS

New Member
Reaction score
31
I think it checks if hook entred there and it stops it then creates a dummy at position of stopped hook and orders the dummy to hook th angle you want . I am not 100% sure
----------
. (\_/) .
. (*.*) .
.(_/\ _).
 

Conal

Member
Reaction score
12
You could create a point at the change in cliff level and from there, create 4 more points surrounding it in a plus sign shape and checking their cliff levels.

Edit: grats
 

Galdiuz

Creator of Photon Command
Reaction score
98
@Conal: I did that first, but it made my projectiles only bounce in 90 degrees turns, so I used another way, which i will explain below.

First, I made regions at all cliffs, and then named them Wall+Direction(N,S,W,E)+Number (Ex. Wall E1). Then in my projectile system I made a trigger that works like this:

First check if the projectile is in a wall region (Atemp_aloc), and if true, check which direction the wall is facing. Then, take this fomula:
[Opposite direction of the wall] + ([Direction of the wall] - [Facing of projectile])
If the wall facing east, this would be (180.00 + (0.00 - (Facing of Atemp_unit))). I hope this explains things to you. :thup:

Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Wall E1 <gen> contains Atemp_aloc) Equal to True
          • (Wall E2 <gen> contains Atemp_aloc) Equal to True
          • (Wall E3 <gen> contains Atemp_aloc) Equal to True
          • (Wall N1 <gen> contains Atemp_aloc) Equal to True
          • (Wall N2 <gen> contains Atemp_aloc) Equal to True
          • (Wall S1 <gen> contains Atemp_aloc) Equal to True
          • (Wall S2 <gen> contains Atemp_aloc) Equal to True
          • (Wall W1 <gen> contains Atemp_aloc) Equal to True
          • (Wall W2 <gen> contains Atemp_aloc) Equal to True
          • (Wall W3 <gen> contains Atemp_aloc) Equal to True
    • Then - Actions
      • Set Atemp_unit = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Wall E1 <gen> contains Atemp_aloc) Equal to True
              • (Wall E2 <gen> contains Atemp_aloc) Equal to True
              • (Wall E3 <gen> contains Atemp_aloc) Equal to True
        • Then - Actions
          • Unit - Create 1 (Unit-type of Atemp_unit) for (Owner of Atemp_unit) at Atemp_aloc facing (180.00 + (0.00 - (Facing of Atemp_unit))) degrees
          • Unit - Set the custom value of (Last created unit) to (Custom value of Atemp_unit)
          • Unit - Set life of (Last created unit) to (Life of Atemp_unit)
          • Unit Group - Add (Last created unit) to Projectile_Group
          • Unit - Remove Atemp_unit from the game
          • Set Atemp_unit = (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Wall N1 <gen> contains Atemp_aloc) Equal to True
              • (Wall N2 <gen> contains Atemp_aloc) Equal to True
        • Then - Actions
          • Unit - Create 1 (Unit-type of Atemp_unit) for (Owner of Atemp_unit) at Atemp_aloc facing (270.00 + (90.00 - (Facing of Atemp_unit))) degrees
          • Unit - Set the custom value of (Last created unit) to (Custom value of Atemp_unit)
          • Unit - Set life of (Last created unit) to (Life of Atemp_unit)
          • Unit Group - Add (Last created unit) to Projectile_Group
          • Unit - Remove Atemp_unit from the game
          • Set Atemp_unit = (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Wall S1 <gen> contains Atemp_aloc) Equal to True
              • (Wall S2 <gen> contains Atemp_aloc) Equal to True
        • Then - Actions
          • Unit - Create 1 (Unit-type of Atemp_unit) for (Owner of Atemp_unit) at Atemp_aloc facing (90.00 + (270.00 - (Facing of Atemp_unit))) degrees
          • Unit - Set the custom value of (Last created unit) to (Custom value of Atemp_unit)
          • Unit - Set life of (Last created unit) to (Life of Atemp_unit)
          • Unit Group - Add (Last created unit) to Projectile_Group
          • Unit - Remove Atemp_unit from the game
          • Set Atemp_unit = (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Wall W1 <gen> contains Atemp_aloc) Equal to True
              • (Wall W2 <gen> contains Atemp_aloc) Equal to True
              • (Wall W3 <gen> contains Atemp_aloc) Equal to True
        • Then - Actions
          • Unit - Create 1 (Unit-type of Atemp_unit) for (Owner of Atemp_unit) at Atemp_aloc facing (0.00 + (180.00 - (Facing of Atemp_unit))) degrees
          • Unit - Set the custom value of (Last created unit) to (Custom value of Atemp_unit)
          • Unit - Set life of (Last created unit) to (Life of Atemp_unit)
          • Unit Group - Add (Last created unit) to Projectile_Group
          • Unit - Remove Atemp_unit from the game
        • Else - Actions
    • Else - Actions
 

xXGauntletXx

New Member
Reaction score
4
Shouldnt the

Unit - Create 1 (Unit-type of Atemp_unit) for (Owner of Atemp_unit) at Atemp_aloc facing (0.00 + (180.00 - (Facing of Atemp_unit))) degrees

line instead read:

Unit - Create 1 (Unit-type of Atemp_unit) for (Owner of Atemp_unit) at Atemp_aloc facing (180.00 - (Facing of Atemp_unit)) degrees

? Why bother having that 0 in there?
 

HydraRancher

Truth begins in lies
Reaction score
197
Shouldnt the

Unit - Create 1 (Unit-type of Atemp_unit) for (Owner of Atemp_unit) at Atemp_aloc facing (0.00 + (180.00 - (Facing of Atemp_unit))) degrees

line instead read:

Unit - Create 1 (Unit-type of Atemp_unit) for (Owner of Atemp_unit) at Atemp_aloc facing (180.00 - (Facing of Atemp_unit)) degrees

? Why bother having that 0 in there?

It is for "Editability"/ easy C n P that kind of stuff.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top