need help.. with bounce off boundary

mvcthinh

New Member
Reaction score
0
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.
Trigger:
  • 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)

Trigger:
  • 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.rar
    14.6 KB · Views: 201

inevit4ble

Well-Known Member
Reaction score
38
You have a couple options, either place 4 regions along the boundaries and check if unit is in the region or you can check the terrain tile type which is under the unit so if your map is only one terrain tile type then no problem else you just need to put 1 type along the boundaries.
Lines are:
Trigger:
  • ((Playable map area) contains (Triggering unit)) Equal to True
Trigger:
  • (Terrain type at (Center of (Playable map area))) Equal to Lordaeron Summer - Dirt
 

mvcthinh

New Member
Reaction score
0
You have a couple options, either place 4 regions along the boundaries and check if unit is in the region or you can check the terrain tile type which is under the unit so if your map is only one terrain tile type then no problem else you just need to put 1 type along the boundaries.
Lines are:
Trigger:
  • ((Playable map area) contains (Triggering unit)) Equal to True
Trigger:
  • (Terrain type at (Center of (Playable map area))) Equal to Lordaeron Summer - Dirt
thank you so much.. ^^ It's worked ...
 

mvcthinh

New Member
Reaction score
0
One more thing.. I want to check condition X coordinates of the Unit with min X and min Y of the max without using rect. So how can I do that? I don't know how to call it! I think it could be useful.

Trigger:
  • Untitled Trigger 002 Copy
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set p1 = (Position of u)
      • Set p2 = (p1 offset by 20.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
              • (Terrain pathing at p2 of type Buildability is off) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Region 001 <gen> contains p2) Equal to True
                  • (Region 000 <gen> contains p2) Equal to True
            • Then - 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
              • 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
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at p2) Equal to Lordaeron Summer - Grass
            • Then - Actions
              • Set angle = (90.00 x 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)
 

inevit4ble

Well-Known Member
Reaction score
38
OT: tags are [ spoiler ] [ /spoiler ]

You can use real coordinates but it will become excessively complex and not sure it will even work as the coordinates will give you a point, can a unit be in a point? or would you check that the point is within other points?

And why do you not want to use regions?
 

mvcthinh

New Member
Reaction score
0
because with every unpassable terrain or doodad have collision size in the map , each one I have to create a region! OMG it will need a long time to finish... But also I can't do both way.
I know Jass so I want to use coordinates instead of point. Because coordinates do not leak memory.
Could you help me?
 

inevit4ble

Well-Known Member
Reaction score
38
Hmm.
Ok well I can help you, but what is the whole story?

You have the boundaries that it bounces off and the doodads and stuff must bounce the missile too?
 

mvcthinh

New Member
Reaction score
0
Thanks! I want to make a spell. Like this spell(Example 4) in JASS Or somespell like that. When I read this spell in GUI but MUI I couldn't understand because the system is too long (lazy ^^!).

could you please show me the way to make it as you said? ["You have the boundaries that it bounces off and the doodads and stuff must bounce the missile too?" - "Yes that's it!"]
 

Attachments

  • CBR.w3x
    47.8 KB · Views: 239

inevit4ble

Well-Known Member
Reaction score
38
Ok I've taken a good look, but its really all over the place (jass makes this stuff so much easier to read) so I will need more time to work something out but I am looking into it
 

inevit4ble

Well-Known Member
Reaction score
38
I can't get the maths perfect but if you have the boundaries find then what you can do (what I got from the snippet) is use something like this:
Trigger:
  • Destructible - Pick every destructible within 75.00 of Missile_StartPoint and do (Actions)
    • Loop - Actions
      • Set Missile_FlyAngle = (Angle from Missile_StartPoint to (Missile_StartPoint offset by 10.00 towards (90.00 - Missile_FlyAngle) degrees))

So in the trigger that moves the missile just add (Trigger Run - <Trigger with above actions in it>)

Missile_Start Point is the position of the missile as it moves.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top