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

[General] Region contains region

Status
Not open for further replies.
Level 9
Joined
Dec 31, 2016
Messages
315
Is there a way to use this condition in standart WE? I don't see it.

Other times, I simply used "region contains point" condition and just created 4 this conditions to define rectangle, but I had created a region through action "region centered at ... with size ...", which is a circle and thus it has infinite amount of points.

Do I have to download extended WE to do this?
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Regions are called rect in JASS and they are rectangular. There is also a thing called region in JASS, which could have the shape of a circle.
So basically your region is rectangular, because there are no JASS-regions in GUI only JASS-rects.

Can you show me the action "region centered at..." in your trigger?
 
Level 9
Joined
Dec 31, 2016
Messages
315
  • Starting positions
    • Events
    • Conditions
    • Actions
      • Set SPN = (SPN + 1)
      • Set SP[SPN] = (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPN Greater than or equal to 2
        • Then - Actions
          • For each (Integer A) from 1 to (SPN - 1), do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                • Then - Actions
                  • Set SPR[SPN] = (Region centered at SP[SPN] with size (1024.00, 1024.00))
                  • Unit - Create 1 Town Hall for (Player(SPN)) at SP[SPN] facing Default building facing degrees
                  • Set SPPO = (Random angle)
                  • Unit - Create 1 Gold Mine for (Player(SPN)) at (SP[SPN] offset by 770.00 towards SPPO degrees) facing Default building facing degrees
                  • Unit - Create 5 Peasant for (Player(SPN)) at (SP[SPN] offset by 256.00 towards SPPO degrees) facing Default building facing degrees
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPN Not equal to ((Number of players in (All players controlled by a Computer player)) + (Number of players in (All players controlled by a User player)))
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
          • Trigger - Run Tree Gen Start <gen> (checking conditions)
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
Ah ok. I thought you were using a function, that only uses one parameter as radiues, but this one has height and width, so it is an rectangle.
Here is the JASS code of that function:
JASS:
function RectFromCenterSizeBJ takes location center, real width, real height returns rect
    local real x = GetLocationX( center )
    local real y = GetLocationY( center )
    return Rect( x - width*0.5, y - height*0.5, x + width*0.5, y + height*0.5 )
endfunction
As you can see the parameters are used as width and height and the coordinates are:
x - width*0.5, y - height*0.5, x + width*0.5, y + height*0.5
 
Status
Not open for further replies.
Top