• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Angles and stuff

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,602
Hello,

Very simple thing. How to make this battlefield go full of black tile stuff.

Map and code attached. I know I'm pretty close.

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Wait 2.00 seconds
      • Set TempReal = 0.00
      • Set TempLoc = (Center of Region 000 Copy 5 <gen>)
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • Set TempReal = (TempReal + 128.00)
          • Set TempReal2 = 0.00
          • Set TempLoc2 = (TempLoc offset by TempReal towards 0.00 degrees)
          • Environment - Change terrain type at TempLoc2 to Outland - Abyss using variation -1 in an area of size 1 and shape Circle
          • For each (Integer B) from 1 to 30, do (Actions)
            • Loop - Actions
              • Set TempReal2 = (TempReal + 128.00)
              • Set TempLoc3 = (TempLoc2 offset by TempReal2 towards 45.00 degrees)
              • Environment - Change terrain type at TempLoc3 to Outland - Abyss using variation -1 in an area of size 1 and shape Circle
 

Attachments

  • tilesss.w3x
    59.8 KB · Views: 58

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
it should be 64 and not 128, no?

Also instead of 30 use something like this to get the proper number:


JASS:
function GetBounds takes nothing returns nothing
    local rect world = yourRect
    //if you don't like written jass just use custom scripts.
    set udg_maxX = R2I(GetRectMaxX(world)) / 64
    set udg_minX = R2I(GetRectMinX(world)) / 64
    set udg_maxY = R2I(GetRectMaxY(world))  / 64
    set udg_minY = R2I(GetRectMinY(world)) / 64
endfunction

then loop from minX to maxX and from minY to maxY in the other loop.

edit: ok the looping maybe wont work in your case.. in the following map I spawn trackables over the entire map, you can see which method I use there.
 

Attachments

  • trackable.w3x
    26.4 KB · Views: 79
Last edited:
Level 4
Joined
Feb 28, 2014
Messages
70
^

What's the point in making a hardly noticeable optimization on Map Initialization? Integer A/B will work okay as soon as you only use them only once, like in this particular case. Otherwise you're right, creating a variable array of type integer will make it more efficent and it will work better, but since this is in map init, there's not point on use a variable.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
No need to go over complicated here. This will happen just once in a game, in a middle of game, plus I know how to fix leaks. Leaks I will fix later when I put the thing to the campaign. So what I want is pretty obvious. Can someone please help me with the actual case?

Just one simple trigger to make area black. I think that's possible and I'm so near. How to finish this?
 
Level 20
Joined
Jul 14, 2011
Messages
877
Unless I misunderstood you, this is what you need:

EDIT: Oops, forgot something. Fixed it
EDIT2: My internet stopped while saving the comment -.-, all fixed now.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Wait 2.00 seconds
      • Set TempLoc = (Center of Region 000 Copy 5 <gen>) //Basically this is where you start from
      • Custom script: set udg_TempReal = GetLocationX(udg_TempLoc) - 128
      • Custom script: set udg_TempReal2 = GetLocationY(udg_TempLoc) + 128 // I dont remember what the GUI action was called
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • Set TempReal = (TempReal + 128.00)
          • Custom script: set udg_TempReal2 = GetLocationY(udg_TempLoc) + 128
          • For each (Integer B) from 1 to 30, do (Actions)
            • Loop - Actions
              • Set TempReal2 = (TempReal2 - 128.00)
              • Custom script: set udg_TempLoc3 = Location(udg_TempReal, udg_TempReal2) // I forget if there was such an action in GUI
              • Environment - Change terrain type at TempLoc3 to Outland - Abyss using variation -1 in an area of size 1 and shape Circle
 
Last edited:
Level 37
Joined
Aug 14, 2006
Messages
7,602
Unless I misunderstood you, this is what you need:

EDIT: Oops, forgot something. Fixed it
EDIT2: My internet stopped while saving the comment -.-, all fixed now.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Wait 2.00 seconds
      • Set TempLoc = (Center of Region 000 Copy 5 <gen>) //Basically this is where you start from
      • Custom script: set udg_TempReal = GetLocationX(udg_TempLoc) - 128
      • Custom script: set udg_TempReal2 = GetLocationY(udg_TempLoc) + 128 // I dont remember what the GUI action was called
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • Set TempReal = (TempReal + 128.00)
          • Custom script: set udg_TempReal2 = GetLocationY(udg_TempLoc) + 128
          • For each (Integer B) from 1 to 30, do (Actions)
            • Loop - Actions
              • Set TempReal2 = (TempReal2 - 128.00)
              • Custom script: set udg_TempLoc3 = Location(udg_TempReal, udg_TempReal2) // I forget if there was such an action in GUI
              • Environment - Change terrain type at TempLoc3 to Outland - Abyss using variation -1 in an area of size 1 and shape Circle

Map please!
 
Level 20
Joined
Jul 14, 2011
Messages
877
Basically writing this:
  • Custom script: set udg_TempReal = GetLocationX(udg_TempLoc) - 128
  • Custom script: set udg_TempReal2 = GetLocationY(udg_TempLoc) + 128
  • For each (Integer A) from 1 to 30, do (Actions)
    • Loop - Actions
      • Set TempReal = (TempReal + 128.00)
      • Custom script: set udg_TempReal2 = GetLocationY(udg_TempLoc) + 128
      • For each (Integer B) from 1 to 30, do (Actions)
        • Loop - Actions
          • Set TempReal2 = (TempReal2 - 128.00)
          • Set TempLoc3 = Point(TempReal, TempReal2)
          • Environment - Change terrain type at TempLoc3 to Outland - Abyss using variation -1 in an area of size 1 and shape Circle
is the same as:
  • For each (Integer A) from 0 to 30, do (Actions)
    • Loop - Actions
      • For each (Integer B) from 0 to 30, do (Actions)
        • Loop - Actions
          • Set TempLoc3 = Point((Center X of Region 0000 Copy 5) + Integer A*128, (Center Y of Region 0000 Copy 5) - Integer B*128)
          • Environment - Change terrain type at TempLoc3 to Outland - Abyss using variation -1 in an area of size 1 and shape Circle
I dont have access to wc3 atm, but I think the actions should look the same.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Note that using a tile type with a trigger requires the map to have free space for the tile type in the tileset of the map, if the tileset does not already include it. You can check your available space for tile types in Advanced - > Modify tileset in the basic editor. The abyss tile type requires one free tile type.

If your tileset space is maxed out and you try to add yet another tile type into the map with a trigger, unintended behaviour will happen as the newly added tile type will replace an existing one.

An alternative method to achieve what you need is to use images.

  • Image - Create an image using Textures\Black32.blp of size 256.00 at location with Z offset 0.00 using image type Selection

  • Textures\Black32.blp is an in-game completely black texture
  • The image type affects the order of rendering. Shadow type does not cover terrain but selection does. See which type suits you the best
  • The location is the bottom left corner of the image
  • You can create the image at polar offset, offset is sqrt(width2 + height2) towards 225 degrees
    • Set p2 = (p1 offset by (Square root((2.00 x 256^2))) towards 225.00 degrees)
    Now image created at p2 will have its center at p1
  • You can show/hide the image by enabling/disabling the render state
    • Image - Change (Last created image): Enable render always state

You can toggle the texture on/off with esc in the test map.
 

Attachments

  • Board2.w3x
    13.5 KB · Views: 51
Status
Not open for further replies.
Top