• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

need help with bounce off boundary

Status
Not open for further replies.
Level 2
Joined
Aug 13, 2011
Messages
10
Hi!. I'm a newbie and I need help.
I want to make a missile which could be bounce off when it reaches the boundary , I try to do that but I cant because I don't know what exactly to write into the condition trigger. Pls check this and help me.

Plus, Here the trigger

when the missile reaches the horizontal boundary , it could bounce off but when it reaches the vertical boundary , It was trapped and can't move anymore.
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Visibility - Disable black mask
      • Visibility - Disable fog of war
      • Unit - Create 1 Peasant for Player 1 (Red) at (Center of (Playable map area)) facing 260.00 degrees
      • Set u = (Last created unit)
      • Set angle = (Facing of u)
      • Set p1 = (Position of u)
      • Set p2 = (p1 offset by 25.00 towards angle degrees)
  • Untitled Trigger 002
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set p1 = (Position of u)
      • Set p2 = (p1 offset by 5.00 towards angle degrees)
      • Set angle = (Angle from p1 to p2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Terrain pathing at p2 of type Flyability is off) Equal to True
              • (Terrain pathing at p2 of type Walkability is off) Equal to True
        • Then - Actions
          • -------- I don't know how to put condition exactly --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Set angle = (0.00 - angle)
              • Unit - Remove u from the game
              • Unit - Create 1 Peasant for Player 1 (Red) at p1 facing angle degrees
              • Set u = (Last created unit)
              • Game - Display to (All players) the text: (String(angle))
            • Else - Actions
              • Set angle = (180.00 - angle)
              • Unit - Remove u from the game
              • Unit - Create 1 Peasant for Player 1 (Red) at p1 facing angle degrees
              • Set u = (Last created unit)
              • Game - Display to (All players) the text: (String(angle))
        • Else - Actions
          • Unit - Make u face p2 over 0.00 seconds
          • Unit - Move u instantly to p2
      • Custom script: call RemoveLocation(udg_p1)
      • Custom script: call RemoveLocation(udg_p2)
 

Attachments

  • Hoi.w3x
    17.3 KB · Views: 65
Level 2
Joined
Aug 13, 2011
Messages
10
By boundary, do you mean the edges of the map or any unpassable terrain in the map?

If you mean the edges of the map, just compare the x coordinate of the unit to the min and max x of the map.

thank you... could you please give me a demo?
one more thing, I don't know what exactly is min and max x of the map.
Like:

  • (X of p2) Less than or equal to (Min X of (Initial camera bounds))
  • (X of p2) Greater than or equal to (Min Y of (Initial camera bounds))
  • ________
  • (X of p2) Less than or equal to (Min X of (Playable map area))
  • ditto [Y]
  • ________
  • (X of p2) Less than or equal to (Min X of (Entire map))
  • ditto [Y]
I've tried all of them but it not work exactly
 
Last edited:
Level 2
Joined
Aug 13, 2011
Messages
10
Actually, i've met this situation before. It's because you expanded the "Scenario/Size and Camera Bounds" to it's maximum. You could smaller the camera bounds to fix this. Hope it was helpful

you had met this situation before,so how you did it?
I resized it smaller but its not working. It's still trapped when reaches the vertical edges.
 
Level 9
Joined
Aug 7, 2009
Messages
380
resize but it must have a little bigger "shadow path" (this shadow path is the key point, it'll not allow units to blink here (which the very black path behind the shadow path doesn't). or also some spell like Shockwave etc... could also help you avoid some bug in blink spells). With just a little of shadow path, it doesn't work also.
What i got the last time was... get stuck the hero unit with my custom blink spell...
If it's still not clear yet, i'll upload a screenshot
 
Level 2
Joined
Aug 13, 2011
Messages
10
resize but it must have a little bigger "shadow path" (this shadow path is the key point, it'll not allow units to blink here (which the very black path behind the shadow path doesn't). or also some spell like Shockwave etc... could also help you avoid some bug in blink spells). With just a little of shadow path, it doesn't work also.
What i got the last time was... get stuck the hero unit with my custom blink spell...
If it's still not clear yet, i'll upload a screenshot

I want to see the screenshot! I've made it as you said but...!!!
Could you please give me a demo map?
 
Level 9
Joined
Aug 7, 2009
Messages
380
Well, it could be another problem, but i'm trying to help so...
I can't upload my screenshot on HW so i use another site...
Hope it'll show up
untitled.jpg

Edit: It seems to not showing up... here's direct link: Link
Edit 2: From the trigger at your 1st post... i think it's not that necessary... Just create a region, when this dummy leave this region (your playable map) you kill it and so the problem is gone
 
Level 2
Joined
Aug 13, 2011
Messages
10
  • If - Conditions
    • ((Playable map area) contains p2) Equal to False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Min X of (Playable map area)) Greater than or equal to (X of p2)
              • (Max X of (Playable map area)) Less than or equal to (X of p2)
        • Then - Actions
          • Set angle = (180.00 - angle)
          • Game - Display to (All players) the text: (String(angle))
        • Else - Actions
          • Set angle = (0.00 - angle)
          • Game - Display to (All players) the text: (String(angle))
      • Else - Actions
I've tried again. And this time, it's worked with the boundary.
 
Status
Not open for further replies.
Top