• 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.

Destroy destructables in rect

Status
Not open for further replies.
Level 3
Joined
Sep 5, 2019
Messages
33
Hi all, im looking to destroy all destructibles in a region. Im wondering when to exit my loop? What does RandomDestructableInRectBJ return if there are no more destructibles?

Also, if someone has a better way than using BJs I will gladly listen, when I looked at the function it just uses other BJs.

Another thing, why does blizzard spell it destructable (with an a instead of i)?

I see other people inserting jass coding with color coding and other formatting, how do I do this? My code is below and it looks quite horrendous. I tried insert > code from the toolbar, but theres no dropdown for jass, and 'general code' looks the same as this.
JASS:
   // removes walls where openings for hallway are
        call SetRect(OpeningRect,x-128,udg_RoomCellY[SlotNum1]+udg_RoomSizeY[SlotNum1]-128,x+128,udg_RoomCellY[SlotNum1]+udg_RoomSizeY[SlotNum1]+128)
          loop
            exitwhen RandomDestructableInRectBJ(OpeningRect,null) == null
            call RemoveDestructable(RandomDestructableInRectBJ(OpeningRect,null))
          endloop
        call SetRect(OpeningRect,x-128,udg_RoomCellY[SlotNum2]-udg_RoomSizeY[SlotNum2]-128,x+128,udg_RoomCellY[SlotNum2]-udg_RoomSizeY[SlotNum2]+128)
          loop
            exitwhen RandomDestructableInRectBJ(OpeningRect,null) == null
            call RemoveDestructable(RandomDestructableInRectBJ(OpeningRect,null))
          endloop
This function doesnt even remove the first destructible though, so Im wondering if there is something wrong with my rect. Do I write my rect as gg_rct_OpeningRect, or simply OpeningRect? Or is there a different problem? Thank you everyone!
 
Last edited:
Level 3
Joined
Sep 5, 2019
Messages
33
I have since worked on this some more and I am now using
JASS:
  call EnumDestructablesInRectAll(OpeningRect, function RemoveDes )
      //which calls another function that
  call RemoveDestructable( GetEnumDestructable() )
      // the full function is in my OP
However, its still not working, and I still think i have a problem with my local rect (Still using the same code as in the original post)

I am thinking of ways to do this without using rects, and I figured that i could assign each wall destructable to a variable as I spawn them, so that I could later destroy the exact ones I want. However, I have a changing number of rooms, each with 4 sides, and each side has a changing number of destructables. It would be handy if i could have an array within an array, is this possible? Otherwise i would need a great deal of global integers for these destructables. Thanks!
 
Last edited:
Level 12
Joined
Feb 22, 2010
Messages
1,115
First, you can use [code=jass][/code] tags to show your code.
JASS:
call EnumDestructablesInRectAll(OpeningRect, function RemoveDes )
which calls another function that
call RemoveDestructable( GetEnumDestructable() )

Second, I think this forum would be more appropriate for your question: Triggers & Scripts

Third, You should explain what you are trying to do first, instead of only showing a bunch of code that doesn't work.

Edit: The topic was at The Lab section when I wrote this post.
 
Last edited:
Level 3
Joined
Sep 5, 2019
Messages
33
Thank you!
I will definitely use tags, the way I did it, it looked quite ugly just pasted there.
Thank you moving forum location, I'm new to Hive and just put it in the Lab.

You asked what I am trying to do.
My general goal is to create a game that randomly spawns a new map each time you enter. This means a random number of rooms, random width and height for each room, random directions that the next room spawns in, and different things in each room. I am basing this off Soul Knight, a mobile game which I enjoy (and I think that in turn is based off Enter The Gungeon). I am currently far from being done, so the items/enemies/etc in the rooms are not coded yet, but I have all the actual world creation working - except that I couldn't figure out a way to remove the walls to create an opening where a hallway was. (This is the problem I was/am having)
I spent several hours working on this over a few days, before I decided to try a different way and simply not create the walls where a hallway would be in the first place. I'm currently working out the compile errors for this atm, so I don't know if it works, but I have higher hopes than for removing the wall destructables like I tried before.

However, even if I find a new way of making something work, I like to understand what I was doing wrong so that I know for next time and can avoid that mistake. So if you have any suggestions on what I was doing before, or even what I am doing currently, I will certainly listen. How would you guys do this?

The coding is quite long, and there are currently still some errors from my recent changes, so I'm not posting it atm, but if it would help, I can do it anyways.

Debugging is very frustrating in world editor because sometimes instead of listing compile errors, the entire program crashes (and any unsaved work goes down the drain). Iv learned to disable triggers and save, so at least I have my changes. For the most part, it only crashes when something kinda big is wrong, like I forgot an endif, or an exitwhen never actually meets the condition and the loop never ends, but its not always the case.
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
Im wondering when to exit my loop?
There isn't much to be done in order to accomplish that. They will enumerate until the list of destructible be finished. The same applies for Unit, Player and Item enumerators (Pick X within X).

All I can think of right now is place "Skip Remaining Actions" or "Wait" on top of everything else within the loop block.

"Skip remaining actions" does what it says. "Wait" doesn't work within those loops, and anything below it won't be executed either.

Example:

Trees.png


  • Set counter = 0
  • Destructible - Pick every destructible in (Playable map area) and do (Actions)
    • Loop - Actions
      • Set counter = (counter + 1)
      • Skip remaining actions
      • -------- Of course, anything below this line won't run at all. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked destructible) is alive) Equal to True
          • counter Less than 3
        • Then - Actions
          • -------- blablabla --------
        • Else - Actions
  • Game - Display to (All players) the text: (String(counter))
Still, even if a "skip remaining actions" or "wait" are there, those loops will still attempt to repeat the code until they reach their max value. That being said, the code above will print 5.

Also, do note that waits work within for loops. You can also break out of them by typing exitwhen true when needed.
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: (String((Integer A)))
JASS:
local integer i = 0
loop
    exitwhen i > 9
    call TriggerSleepAction(.5)
    call BJDebugMsg(I2S(i))
    set i = i + 1
endloop

What does RandomDestructableInRectBJ return if there are no more destructibles?

If there really is no destructible present, it returns null. However, it can also pick dead ones, so you should avoid that function and filter them out yourself.

Do I write my rect as gg_rct_OpeningRect, or simply OpeningRect?

Well, we can't really answer that question because we don't know how that variable was declared.

Anything that start with the gg_ prefix is a global varable that has been generated by the world editor upon map save. That applies to pre-placed units, items, destructible, regions, triggers, etc.

So, if a new region, named as opening, is created in the editor, it should be referenced as gg_rct_opening in the trigger editor.

The coding is quite long, and there are currently still some errors from my recent changes, so I'm not posting it atm, but if it would help, I can do it anyways.

We need to know how your variables/objects were declared and modified before the code in your first post, like these ones:
JASS:
OpeningRect, // Did you declare this variable within globals / endglobals block?
x,
y,
SlotNum1, // Not sure if this was declared in JASS or GUI. I'm guessing JASS due to lack of _udg prefix
udg_RoomCellX[],
udg_RoomSizeX[],
udg_RoomCellY[],
udg_RoomSizeY[]
Debugging is very frustrating in world editor because sometimes instead of listing compile errors, the entire program crashes (and any unsaved work goes down the drain).

That shouldn't happen anymore, at all. I do remember suffering from this back in 2009 when I didn't use JNGP and my WE version was 1.24e. Nowadays we have JassHelper/PJass support which will most of the time point out where the mistake is. I mean, I haven't experienced code crash upon map saving in a long time. What's your game and WE version?
 
Last edited:
Level 3
Joined
Sep 5, 2019
Messages
33
I went through some changes to the script, and I am no longer using a loop, or even removing the destructables at all (said in the responses, though not the original post). Currently I am simply leaving a gap where I would later want to remove the destructables.

I'm glad to know that RandomDestructableInRectBJ returns null, I could use this in an if then statement? ( if RandomDestructableInRectBJ==null then ).

I thought that udg_ was the global prefix. Is it different for rects? Are there any other variable types that are different?

You asked to see how I define my variables/objects.
**NOTE This is my first game I have used jass in, and I have created one game before using GUI. I'm sure there are prettier and/or more efficient ways to do this. I am all ears to any and all suggestions, and will happily improve my coding technique for this and future games. This is still rough, and I may have changed parts of the code and //comments may be outdated. Also, the section on spawning walls still has some bugs that I need to work out (I know this, but havent gotten around to sitting down and debugging, though will also listen to suggestions on how to fix it)

Here is the code for the actual spawning of rooms, hallways, and walls:
(I realize this is very long, to find the exact function, ctrl+f "function CreateWalls"
To find the variables you want, its quite long so you may want to search for those as well, though Ill try to comment where they are)

Global arrays udg_RoomSizeX[] and udg_RoomSizeY[] are defined under function Trig_SpawnAllRooms_Actions. They are unique for each room.
JASS:
function TopYesHall takes integer RoomNum, integer Num1, integer Num2 returns nothing        // X2 == X1, X2 == X2, Num == MultN2    NEED TO FIGURE THIS OUT
  local real X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-(udg_RoomSizeX[udg_RoomNumber[RoomNum]])               //MAY NEED MultN1 AND MultN2
  local real X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]+(udg_RoomSizeX[udg_RoomNumber[RoomNum]])               //IM USING MultN2 FOR ALL Num
  local real Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]+(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real x
    set x = X1+64+Num2 //was +64 as well as +Num, but i dont kno0w why i need it. maybe will put it back in
      loop
        exitwhen x >= X2-(Audg_RoomSizeX[udg_RoomNumber[RoomNum]]/2)-Num1
        call CreateDestructable('B004', x, Y2-Num2, 0, 1.5, 5 )
        set x = x+Num1
      endloop
      set x = X2-(udg_RoomSizeX[udg_RoomNumber[RoomNum]]/2)+(1.5*128)
      loop
        exitwhen x >= X2-Num1
        call CreateDestructable('B004', x, Y2-Num2, 0, 1.5, 5 )
        set x = x+Num1
      endloop
endfunction
function TopNoHall takes integer RoomNum, integer Num1, integer Num2 returns nothing        // X2 == X1, X2 == X2, Num == MultN2
  local real X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-(udg_RoomSizeX[udg_RoomNumber[RoomNum]])  // I know I already defined these in the CreateWalls function
  local real X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]+(udg_RoomSizeX[udg_RoomNumber[RoomNum]])  // but I had already written these 'TopNoHall' etc functions before I
  local real Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-(udg_RoomSizeY[udg_RoomNumber[RoomNum]])  //  realized I needed these variables in CreateWalls function as well.
  local real Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]+(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real x
    set x = X1+64+Num2
      loop
        exitwhen x >= X2-Num1
        call CreateDestructable('B004', x, Y2-Num2, 0, 1.5, 5 )
        set x = x+Num1
      endloop
endfunction
function BottomYesHall takes integer RoomNum, integer Num1, integer Num2 returns nothing        // X2 == X1, X2 == X2, Num == MultN2
  local real X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]+(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]+(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real x
    set x = X1+64+Num2 //was +64 as well as +Num, but i dont kno0w why i need it. maybe will put it back in
      loop
        exitwhen x >= X2-(udg_RoomSizeX[udg_RoomNumber[RoomNum]]/2)-Num1
        call CreateDestructable('B004', x, Y1+Num2, 0, 1.5, 5 )
        set x = x+Num1
      endloop
      set x = X2-(udg_RoomSizeX[udg_RoomNumber[RoomNum]]/2)+(1.5*128)
      loop
        exitwhen x >= X2-Num1
        call CreateDestructable('B004', x, Y1+Num2, 0, 1.5, 5 )
        set x = x+Num1
      endloop
endfunction
function BottomNoHall takes integer RoomNum, integer Num1, integer Num2 returns nothing        // X2 == X1, X2 == X2, Num == MultN2
  local real X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]+(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]+(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real x
    set x = X1+64+Num2
      loop
        exitwhen x >= X2-Num1
        call CreateDestructable('B004', x, Y1+Num2, 0, 1.5, 5 )
        set x = x+Num1
      endloop
endfunction
function RightYesHall takes integer RoomNum, integer Num1, integer Num2 returns nothing        // X2 == X1, X2 == X2, Num == MultN2
  local real X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]+(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]+(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real y
    set y = Y1+64+Num2 //was +64 as well as +Num, but i dont know why i need it. maybe will put it back in
      loop
        exitwhen y >= Y2-(udg_RoomSizeY[udg_RoomNumber[RoomNum]]/2)-Num1
        call CreateDestructable('B007', X2-Num2, y, 0, 1.5, 5 )
        set y = y+Num1
      endloop
      set y = Y2-(udg_RoomSizeY[udg_RoomNumber[RoomNum]]/2)+(1.5*128)
      loop
        exitwhen y >= Y2-Num1
        call CreateDestructable('B007', X2-Num2, y, 0, 1.5, 5 )
        set y = y+Num1
      endloop
endfunction
function RightNoHall takes integer RoomNum, integer Num1, integer Num2 returns nothing        // X2 == X1, X2 == X2, Num == MultN2
  local real X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]+(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]+(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real y
    set y = Y1+64+Num2
      loop
        exitwhen y >= Y2-Num1
        call CreateDestructable('B007', X2-Num2, y, 0, 1.5, 5 )
        set y = y+Num1
      endloop
endfunction
function LeftYesHall takes integer RoomNum, integer Num1, integer Num2 returns nothing        // X2 == X1, X2 == X2, Num == MultN2
  local real X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]+(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]+(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real y
    set y = Y1+64+Num2 //was +64 as well as +Num, but i dont know why i need it. maybe will put it back in
      loop
        exitwhen y >= Y2-(udg_RoomSizeY[udg_RoomNumber[RoomNum]]/2)-Num1
        call CreateDestructable('B007', X1+Num2, y, 0, 1.5, 5 )
        set y = y+Num1
      endloop
      set y = Y2-(udg_RoomSizeY[udg_RoomNumber[RoomNum]]/2)+(1.5*128)
      loop
        exitwhen y >= Y2-Num1
        call CreateDestructable('B007', X1+Num2, y, 0, 1.5, 5 )
        set y = y+Num1
      endloop
endfunction
function LeftNoHall takes integer RoomNum, integer Num1, integer Num2 returns nothing        // X2 == X1, X2 == X2, Num == MultN2
  local real X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]+(udg_RoomSizeX[udg_RoomNumber[RoomNum]])
  local real Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]+(udg_RoomSizeY[udg_RoomNumber[RoomNum]])
  local real y
    set y = Y1+64+Num2
      loop
        exitwhen y >= Y2-Num1
        call CreateDestructable('B007', X1+Num2, y, 0, 1.5, 5 )
        set y = y+Num1
      endloop
endfunction

//THIS FUNCTION CreateWalls IS WHERE IM HAVING PROBLEMS
//this is the most current variation, where I dont remove the wall destructables, but actually never make them in the first place
//I have some older versions where I do attempt to use rects to remove walls for Hallway openings, if anyone thinks that would be easier, I can post those older CreateWall functions as well
function CreateWalls takes nothing returns nothing // this function is called after both rooms and hallways have been spawned
  local integer RoomNum = 0
  local integer MultN1  = R2I(128*1.5)
  local integer MultN2  = 64+6
  local real X1
  local real X2
  local real Y1
  local real Y2
  local real WS = 32
  local real Ws = 2+(I2R(GetRandomInt(2,9))*0.1)
  local real WV = 0
    loop
      exitwhen RoomNum >= udg_RoomAmt
      set X1 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-udg_RoomSizeX[udg_RoomNumber[RoomNum]]
      set X2 = udg_RoomCellX[udg_RoomNumber[RoomNum]]-udg_RoomSizeX[udg_RoomNumber[RoomNum]]
      set Y1 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-udg_RoomSizeY[udg_RoomNumber[RoomNum]]
      set Y2 = udg_RoomCellY[udg_RoomNumber[RoomNum]]-udg_RoomSizeY[udg_RoomNumber[RoomNum]]
      if udg_RoomFull[udg_RoomNumber[RoomNum]-9] == true then
          call TopYesHall(RoomNum,MultN1,MultN2)
        else
          call TopNoHall(RoomNum,MultN1,MultN2)
        endif
      call TriggerSleepAction(0)                                     //making sure it doesnt crash
      if udg_RoomFull[udg_RoomNumber[RoomNum]-1] == true then
          call LeftYesHall(RoomNum,MultN1,MultN2)
        else
          call LeftNoHall(RoomNum,MultN1,MultN2)
        endif
      call TriggerSleepAction(0)
      if udg_RoomFull[udg_RoomNumber[RoomNum]+1] == true then
          call RightYesHall(RoomNum,MultN1,MultN2)
        else
          call RightNoHall(RoomNum,MultN1,MultN2)
        endif
      call TriggerSleepAction(0)
      if udg_RoomFull[udg_RoomNumber[RoomNum]+9] == true then
          call BottomYesHall(RoomNum,MultN1,MultN2)
        else
          call BottomNoHall(RoomNum,MultN1,MultN2)
        endif
      call TriggerSleepAction(0)
            // Creates Corner Columns
         if GetRandomInt(1,2) == 1 then
             call CreateDestructable( 'B00C', X1+WS, Y1+WS, GetRandomInt(0,360), Ws, WV )            //spawns corner spires
           else                                                                                      //""
             call CreateDestructable( 'B00D', X1+WS, Y1+WS, GetRandomInt(0,360), Ws, WV )            //   ||
           endif                                                                                     //  \  /
         if GetRandomInt(1,2) == 1 then                                                              //   \/
             call CreateDestructable( 'B00C', X1+WS, Y2-WS, GetRandomInt(0,360), Ws, WV )
           else
             call CreateDestructable( 'B00D', X1+WS, Y2-WS, GetRandomInt(0,360), Ws, WV )
           endif
         if GetRandomInt(1,2) == 1 then
             call CreateDestructable( 'B00C', X2-WS, Y1+WS, GetRandomInt(0,360), Ws, WV )
           else
             call CreateDestructable( 'B00D', X2-WS, Y1+WS, GetRandomInt(0,360), Ws, WV )
           endif
         if GetRandomInt(1,2) == 1 then
             call CreateDestructable( 'B00C', X2-WS, Y2-WS, GetRandomInt(0,360), Ws, WV )
           else
             call CreateDestructable( 'B00D', X2-WS, Y2-WS, GetRandomInt(0,360), Ws, WV )            //""
           endif
         set RoomNum = RoomNum+1
    endloop
endfunction
function RemoveDes takes nothing returns nothing
  call RemoveDestructable( GetEnumDestructable() )
endfunction
function HallwayVertUp takes integer SlotNum1, integer SlotNum2 returns nothing
  local integer x
  local integer y
  local rect OpeningRect
    set x = udg_RoomCellX[SlotNum1]
    set y = udg_RoomCellY[SlotNum1]+udg_RoomSizeY[SlotNum1]
      loop                                                                      //terrain for hallway
        exitwhen y >= udg_RoomCellY[SlotNum2]-udg_RoomSizeY[SlotNum2]
        call SetTerrainType(x,y,'cYc1',2,2.5,1)
        set y = y+(5*128)
      endloop
      set y = udg_RoomCellY[SlotNum1]+udg_RoomSizeY[SlotNum1]
      loop                                                                      //left wall for hallway
        exitwhen y >= udg_RoomCellY[SlotNum2]-udg_RoomSizeY[SlotNum2]
        call CreateDestructable( 'B007', x-2*128, y, 0, 1.5, 5 )
        set y = y+R2I(128*1.5)
      endloop
      set y = udg_RoomCellY[SlotNum1]+udg_RoomSizeY[SlotNum1]
      loop                                                                      //right wall for hallway
        exitwhen y >= udg_RoomCellY[SlotNum2]-udg_RoomSizeY[SlotNum2]
        call CreateDestructable( 'B007', x+2*128, y, 0, 1.5, 5 )
        set y = y+R2I(128*1.5)
      endloop
        // removes walls where openings for hallway are
  //      call SetRect(OpeningRect,x-128,udg_RoomCellY[SlotNum1]+udg_RoomSizeY[SlotNum1]-128,x+128,udg_RoomCellY[SlotNum1]+udg_RoomSizeY[SlotNum1]+128)
  //        call EnumDestructablesInRectAll(OpeningRect, function RemoveDes )
  //      call SetRect(OpeningRect,x-128,udg_RoomCellY[SlotNum2]-udg_RoomSizeY[SlotNum2]-128,x+128,udg_RoomCellY[SlotNum2]-udg_RoomSizeY[SlotNum2]+128)
  //        call EnumDestructablesInRectAll(OpeningRect, function RemoveDes )
endfunction
function HallwayVertDown takes integer SlotNum1, integer SlotNum2 returns nothing
  local integer x
  local integer y
  local rect OpeningRect
    set x = udg_RoomCellX[SlotNum1]
    set y = udg_RoomCellY[SlotNum1]-udg_RoomSizeY[SlotNum1]
      loop                                                                      //terrain for hallway
        exitwhen y <= udg_RoomCellY[SlotNum2]+udg_RoomSizeY[SlotNum2]
        call SetTerrainType(x,y,'cYc1',2,2.5,1)
        set y = y-(5*128)
      endloop
      set y = udg_RoomCellY[SlotNum1]-udg_RoomSizeY[SlotNum1]
      loop                                                                      //left wall for hallway
        exitwhen y <= udg_RoomCellY[SlotNum2]+udg_RoomSizeY[SlotNum2]
        call CreateDestructable( 'B007', x-2*128, y, 0, 1.5, 5 )
        set y = y-R2I(128*1.5)
      endloop
      set y = udg_RoomCellY[SlotNum1]-udg_RoomSizeY[SlotNum1]
      loop                                                                      //right wall for hallway
        exitwhen y <= udg_RoomCellY[SlotNum2]+udg_RoomSizeY[SlotNum2]
        call CreateDestructable( 'B007', x+2*128, y, 0, 1.5, 5 )
        set y = y-R2I(128*1.5)
      endloop
        // removes walls where openings for hallway are
 //       call SetRect(OpeningRect,x-128,udg_RoomCellY[SlotNum1]-udg_RoomSizeY[SlotNum1]-128,x+128,udg_RoomCellY[SlotNum1]-udg_RoomSizeY[SlotNum1]+128)
 //         loop
 //           exitwhen RandomDestructableInRectBJ(OpeningRect,null) == null
 //           call RemoveDestructable(RandomDestructableInRectBJ(OpeningRect,null))
 //         endloop
 //       call SetRect(OpeningRect,x-128,udg_RoomCellY[SlotNum2]+udg_RoomSizeY[SlotNum2]-128,x+128,udg_RoomCellY[SlotNum2]+udg_RoomSizeY[SlotNum2]+128)
 //         loop
 //           exitwhen RandomDestructableInRectBJ(OpeningRect,null) == null
 //           call RemoveDestructable(RandomDestructableInRectBJ(OpeningRect,null))
 //         endloop
endfunction
function HallwayHorLeft takes integer SlotNum1, integer SlotNum2 returns nothing
  local integer x
  local integer y
  local rect OpeningRect
    set x = udg_RoomCellX[SlotNum1]-udg_RoomSizeX[SlotNum1]
    set y = udg_RoomCellY[SlotNum1]
      loop                                                                      //terrain for hallway
        exitwhen x <= udg_RoomCellX[SlotNum2]+udg_RoomSizeX[SlotNum2]
        call SetTerrainType(x,y,'cYc1',2,2.5,1)
        set x = x-(5*128)
      endloop
      set x = udg_RoomCellX[SlotNum1]-udg_RoomSizeX[SlotNum1]
      loop                                                                      //left wall for hallway
        exitwhen x <= udg_RoomCellX[SlotNum2]+udg_RoomSizeX[SlotNum2]
        call CreateDestructable( 'B004', x, y-2*128, 0, 1.5, 5 )
        set x = x-R2I(128*1.5)
      endloop
      set x = udg_RoomCellX[SlotNum1]-udg_RoomSizeX[SlotNum1]
      loop                                                                      //right wall for hallway
        exitwhen x <= udg_RoomCellX[SlotNum2]+udg_RoomSizeX[SlotNum2]
        call CreateDestructable( 'B004', x, y+2*128, 0, 1.5, 5 )
        set x = x-R2I(128*1.5)
      endloop
        // removes walls where openings for hallway are
 //       call SetRect(OpeningRect,udg_RoomCellX[SlotNum1]-udg_RoomSizeX[SlotNum1]-128,y-128,udg_RoomCellX[SlotNum1]-udg_RoomSizeX[SlotNum1]+128,y+128)
 //         loop
 //           exitwhen RandomDestructableInRectBJ(OpeningRect,null) == null
 //           call RemoveDestructable(RandomDestructableInRectBJ(OpeningRect,null))
 //         endloop
 //       call SetRect(OpeningRect,udg_RoomCellX[SlotNum2]+udg_RoomSizeX[SlotNum2]-128,y-128,udg_RoomCellX[SlotNum2]+udg_RoomSizeX[SlotNum2]+128,y+128)
 //         loop
 //           exitwhen RandomDestructableInRectBJ(OpeningRect,null) == null
 //           call RemoveDestructable(RandomDestructableInRectBJ(OpeningRect,null))
 //         endloop
endfunction
function HallwayHorRight takes integer SlotNum1, integer SlotNum2 returns nothing
  local integer x
  local integer y
  local rect OpeningRect
    set x = udg_RoomCellX[SlotNum1]+udg_RoomSizeX[SlotNum1]
    set y = udg_RoomCellY[SlotNum1]
      loop                                                                      //terrain for hallway
        exitwhen x >= udg_RoomCellX[SlotNum2]-udg_RoomSizeX[SlotNum2]
        call SetTerrainType(x,y,'cYc1',2,2.5,1)
        set x = x+(5*128)
      endloop
      set x = udg_RoomCellX[SlotNum1]+udg_RoomSizeX[SlotNum1]
      loop                                                                      //left wall for hallway
        exitwhen x >= udg_RoomCellX[SlotNum2]-udg_RoomSizeX[SlotNum2]
        call CreateDestructable( 'B004', x, y-2*128, 0, 1.5, 5 )
        set x = x+R2I(128*1.5)
      endloop
      set x = udg_RoomCellX[SlotNum1]+udg_RoomSizeX[SlotNum1]
      loop                                                                      //right wall for hallway
        exitwhen x >= udg_RoomCellX[SlotNum2]-udg_RoomSizeX[SlotNum2]
        call CreateDestructable( 'B004', x, y+2*128, 0, 1.5, 5 )
        set x = x+R2I(128*1.5)
      endloop
        // removes walls where openings for hallway are
  //      call SetRect(OpeningRect,udg_RoomCellX[SlotNum1]+udg_RoomSizeX[SlotNum1]-128,y-128,udg_RoomCellX[SlotNum1]+udg_RoomSizeX[SlotNum1]+128,y+128)
  //        loop
  //          exitwhen RandomDestructableInRectBJ(OpeningRect,null) == null
  //          call RemoveDestructable(RandomDestructableInRectBJ(OpeningRect,null))
  //        endloop
  //      call SetRect(OpeningRect,udg_RoomCellX[SlotNum2]-udg_RoomSizeX[SlotNum2]-128,y-128,udg_RoomCellX[SlotNum2]-udg_RoomSizeX[SlotNum2]+128,y+128)
  //        loop
  //          exitwhen RandomDestructableInRectBJ(OpeningRect,null) == null
  //          call RemoveDestructable(RandomDestructableInRectBJ(OpeningRect,null))
  //        endloop
endfunction
function SpawnRoom takes integer XCoor, integer YCoor, integer AWidth, integer BLength, integer WhichRoom returns nothing  // this is the main function which creates a room
  local real X                                          //x coordinate at center
  local real Y                                          //y coordinate at center
  local real A                                       //random integer to set different width for X
  local real B                                       //used for spawning terrain if its not a square   (x coordinate)
  local real a                                       //""                                              (y coordinate)
  local real b                                       //random integer to set different length for y
  local real X1                                      //minimum x coordinate (half of A from X)          //so left side
  local real Y1                                      //minimum y coordinate (half of B from Y)          //bottom side
  local real X2                                      //"" in other direction                            //right side
  local real Y2                                      //""                                               //top side
  local real x1
  local real y1                                                    
  local real x
  local real y
  local integer MultN1
  local integer MultN2
  local real WS = 32                                            //Variation for corner spires
  local real Ws = 2+(I2R(GetRandomInt(2,9))*0.1)
  local integer WV = 0
  local integer HallLength
  local integer RNum = WhichRoom
    set HallLength = 7*128
    set MultN1 = R2I(128*1.5)
    set MultN2 = 64+6
    set A = AWidth                    //randomizes A between 80 and 110 (i can change these later for diff sized rooms, can even set them to variables)
    set B = BLength                    //"" but for B
        set X = XCoor   //GetLocationX( center )                      //sets X to center (i can input my own location here if i want, will become the center of the room)
        set Y = YCoor
    set X1 = X-(A)                                         //sets X1 to half of A less than X
    set Y1 = Y-(B)                                         //sets Y1 to half of B less than Y
    set X2 = X+(A)                                         //sets X2 to half of A more than X
    set Y2 = Y+(B)                                         //sets Y2 to half of B more than Y
      call SetRect(udg_RegionRoom[RNum],X1+128,Y1+128,X2-128,Y2-128)                             //creates rect with bottom left X1,Y1 and top right X2,Y2 with center at X,Y
      if A==B then                                                       //if its a square room (A=B) then                                                             //square room
            call SetTerrainType(X,Y,'cYc1',2,R2I(B/128),1)                     //creates terrain in a square shape A*B centered at XY                                        //""
          elseif A>B then                                               //if its not a square, and A>B                                                                //rectangular room, where width is greater than length
                call SetTerrainType(X,Y,'cYc1',2,R2I(B/128),1)                 //create a square centered at XY of area smallest value (B) squared                           //spawns square terrain
                set a = X1+64                                          //sets a to left side plus half of spawned tile size
                set b = Y1+64                                          //sets b to bottom side plus half of spawned tile size
                  loop
                    exitwhen a>=X-B                                 //exit loop when a > center minus Square Terrain minus spawned tile size
                        loop
                           exitwhen b>=Y2-128                           //exit loop when b > top side minus spawned tile size
                             call SetTerrainType(a,b,'cYc1',2,1,1)    //create terrain at ab of tile size 512 (4 tiles)                                             //spawns column of terrain starting at bottom left (big size)
                             set b = b+128                             //sets b to next row
                           endloop                                      //repeat
                        set a = a+128                                   //sets a to next column over                                                                  //spawns next column
                        set b = Y1+64                                  //resets b to bottom side plus half of spawned tile size
                        call TriggerSleepAction(0.05)
                    endloop                                             //repeat
                set a = X+B                                        //sets a to edge of spawned square terrain plus half of spawned tile size
                set b = Y1+64                                          //sets b to bottom side plus half of spawned tile size
                  loop
                    exitwhen a>=X+A                                //exit loop when a > center minus Square Terrain minus spawned tile size
                        loop
                           exitwhen b>=Y2-128                          //exit loop when b > top side minus spawned tile size
                             call SetTerrainType(a,b,'cYc1',2,1,1)    //create terrain at ab of tile size 512 (4 tiles)                                             //spawns column of terrain starting at bottom left (big size)
                             set b = b+128                              //sets b to next row up
                           endloop                                      //repeat
                        set a = a+128                                   //sets a to next column over                                                                  //spawns next column
                        set b = Y1+64                                  //resets b to bottom side plus half of spawned tile size
                        call TriggerSleepAction(0.05)
                    endloop                                             //repeat
          elseif B>A then                                               //if its not a sqaure, and B>A
                call SetTerrainType(X,Y,'cYc1',2,R2I(A/128),1)                 //creates a square centered at XY of area smallest value (A) squared
                set a = X1+64                                          //sets a to left side plus half of spawned tile size
                set b = Y1+64                                          //sets b to bottom side plus half of spawned tile size
                  loop
                    exitwhen b>=Y-A                                 //exit loop when b > center minus Square Terrain minus spawned tile size
                        loop
                           exitwhen a>=X2-128                           //exit loop when a > right side minus spawned tilse size
                             call SetTerrainType(a,b,'cYc1',2,1,1)    //create terrain at ab of tile size 512 (4 tiles)
                             set a = a+128                              //sets a to next column over
                           endloop                                      //repeat
                        set b = b+128                                   //sets b to next row up
                        set a = X1+64                                  //resets a to left side plus half of spawned tile size
                        call TriggerSleepAction(0.05)
                    endloop                                             //repeat
                  set a = X1+64                                           //sets a to left side plus half of spawned tile size
                  set b = Y+A                                         //sets b to bottom side plus half of spawned tile size
                  loop
                    exitwhen b>=Y+B                                 //exit loop when b > center minus Square Terrain minus spawned tile size
                        loop
                           exitwhen a>=X2-128                           //exit loop when a > right side minus spawned tilse size
                             call SetTerrainType(a,b,'cYc1',2,1,1)    //create terrain at ab of tile size 512 (4 tiles)
                             set a = a+128                              //sets a to next column over
                           endloop                                      //repeat
                        set b = b+128                                   //sets b to next row up
                        set a = X1+64                                  //resets a to left side plus half of spawned tile size
                        call TriggerSleepAction(0.05)
                    endloop                                             //repeat
endfunction
function RRoom takes integer b, integer c returns integer
  local integer a
    set a = GetRandomInt(b,c)*128
    return a
endfunction
function Trig_SpawnAllRooms_Actions takes nothing returns nothing // this calls the functinos for creating rooms, hallways, and walls, and decides which direction to spawn the next room in
  local integer ASlot1
  local integer ASlot2
  local integer A
  local integer B
  local integer EnemyRooms
  local integer LoopNum
  local integer Message = 0
  local integer RNumSlot = 0
  local boolean NoSpace = false
  local integer x
  local integer y
    // first room (Spawn)
    set EnemyRooms = 0
    set LoopNum = 0
      set ASlot1 = GRInt9(31,32,33,40,41,42,49,50,51)
      set udg_RoomNumber[RNumSlot] = ASlot1
      set RNumSlot = 1
      set A = RRoom(5,7)
      set B = RRoom(5,7)
      set udg_RoomSizeX[ASlot1] = A*128
      set udg_RoomSizeY[ASlot1] = B*128
        call SpawnRoom(udg_RoomCellX[ASlot1], udg_RoomCellY[ASlot1], A, B, ASlot1)
      set x = udg_RoomCellX[ASlot1]
      set y = udg_RoomCellY[ASlot1]
      set udg_RoomAmt = 1
      set udg_RoomFull[ASlot1] = true
      set udg_RoomType[ASlot1] = 0
      set ASlot2 = ASlot1
      // next room (Must be enemy)
      set ASlot1 = GRInt4(ASlot2-9, ASlot2-1, ASlot2+1, ASlot2+9)
      set udg_RoomNumber[RNumSlot] = ASlot1
      set RNumSlot = 2
      set A = RRoom(7,13)
      set B = RRoom(7,13)
      set udg_RoomSizeX[ASlot1] = A*128
      set udg_RoomSizeY[ASlot1] = B*128
        call SpawnRoom(udg_RoomCellX[ASlot1], udg_RoomCellY[ASlot1], A, B, ASlot1)
      if ASlot1 == ASlot2-9 then
                call HallwayVertUp(ASlot2,ASlot1)
              elseif ASlot1 == ASlot2-1 then
                call HallwayHorLeft(ASlot2,ASlot1)
              elseif ASlot1 == ASlot2+1 then
                call HallwayHorRight(ASlot2,ASlot1)
              elseif ASlot1 == ASlot2+9 then
                call HallwayVertDown(ASlot2,ASlot1)
              else
                call DoNothing()
              endif
      set udg_RoomAmt = udg_RoomAmt+1
      set udg_RoomFull[ASlot1] = true
      set udg_RoomType[ASlot1] = 3
      set EnemyRooms = 1
      set ASlot2 = ASlot1
      // next room (Any type)
      loop
        exitwhen (udg_RoomAmt >= 12) or (EnemyRooms >= 6) or (LoopNum >= 12)
        set ASlot1 = GRInt4(ASlot2-9, ASlot2-1, ASlot2+1, ASlot2+9)
        set udg_RoomNumber[RNumSlot] = ASlot
        set RNumSlot = RNumSlot+1
          if udg_RoomFull[ASlot1] == true then
            loop
              exitwhen (udg_RoomFull[ASlot1] == false) or (LoopNum >= 12)
              set ASlot1 = GRInt4(ASlot2-9, ASlot2-1, ASlot2+1, ASlot2+9)
              set LoopNum = LoopNum+1
              if LoopNum >= 12 then
                set NoSpace = true
              else
                call DoNothing()
              endif
            endloop
            set LoopNum = 0
            else
              call DoNothing()
            endif
        if NoSpace == false then
            set A = RRoom(7,13)
            set B = RRoom(7,13)
            set udg_RoomSizeX[ASlot1] = A*128
            set udg_RoomSizeY[ASlot1] = B*128
              call SpawnRoom(udg_RoomCellX[ASlot1], udg_RoomCellY[ASlot1], A, B, ASlot1)
            if ASlot1 == ASlot2-9 then
                call HallwayVertUp(ASlot2,ASlot1)
              elseif ASlot1 == ASlot2-1 then
                call HallwayHorLeft(ASlot2,ASlot1)
              elseif ASlot1 == ASlot2+1 then
                call HallwayHorRight(ASlot2,ASlot1)
              elseif ASlot1 == ASlot2+9 then
                call HallwayVertDown(ASlot2,ASlot1)
              else
                call DoNothing()
              endif
            set udg_RoomAmt = udg_RoomAmt+1
            set udg_RoomFull[ASlot1] = true
            set udg_RoomType[ASlot1] = GetRandomInt(1,8)
            if (udg_RoomType[ASlot1] == 3) or (udg_RoomType[ASlot1] == 5) or (udg_RoomType[ASlot1] == 5) then
                set EnemyRooms = EnemyRooms+1
              else
                call DoNothing()
              endif
            set ASlot2 = ASlot1
          else
            call DoNothing()
          endif
        endloop
    call CreateWalls
                  //After here is all just testing
        call DisplayTimedTextToPlayer(Player(0), 0, -50, 300, "Number of rooms spawned (udg_RoomAmt) is: "+I2S(udg_RoomAmt))
        call DisplayTimedTextToPlayer(Player(0), 0, -50, 300, " ")
          set Message = 10
        loop
          exitwhen Message >= 71
            if udg_RoomFull[Message] == true then
              call DisplayTimedTextToPlayer(Player(0), 0, -50, 300, "Room number "+I2S(Message)+" is type: "+I2S(udg_RoomType[Message]))
            else
              call DoNothing()
            endif
              if  ((Message >= 10) and (Message < 16)) or ((Message >= 19) and (Message < 25)) or ((Message >= 28) and (Message < 34)) or ((Message >= 37) and (Message < 43)) or ((Message >= 46) and (Message < 52)) or ((Message >= 55) and (Message < 61)) or ((Message >= 64) and (Message < 70)) then
                set Message = Message+1
              else
                set Message = Message+3
              endif
        endloop
        set Message = 0
        set NumberRooms = 0
        loop
          exitwhen Message >= 80
          if udg_RoomFull[Message] == true then
            set NumberRooms = NumberRooms+1
          else
            call DoNothing()
          endif
            if  ((Message >= 10) and (Message < 16)) or ((Message >= 19) and (Message < 25)) or ((Message >= 28) and (Message < 34)) or ((Message >= 37) and (Message < 43)) or ((Message >= 46) and (Message < 52)) or ((Message >= 55) and (Message < 61)) or ((Message >= 64) and (Message < 70)) then
              set Message = Message+1
            else
              set Message = Message+3
            endif
          endloop
        call DisplayTimedTextToPlayer(Player(0), 0, 0, 300, "Number of full rooms (local var NumberRooms) == "+I2S(NumberRooms))
        call DisplayTimedTextToPlayer(Player(0), 0, 0, 300, "Number of EnemyRooms == "+I2S(EnemyRooms))
endfunction
//===========================================================================
function InitTrig_SpawnAllRooms takes nothing returns nothing
    set gg_trg_SpawnAllRooms = CreateTrigger(  )
    call TriggerRegisterTimerEvent(gg_trg_SpawnAllRooms, 1.00, false)
    call TriggerAddAction( gg_trg_SpawnAllRooms, function Trig_SpawnAllRooms_Actions )
endfunction

To decide where my rooms would be, I have created a 9x9 grid of X and Y (using two integer variable arrays, instead of a location array). Here is the coding for defining these variables:

This declares global arrays udg_RoomCellX[] and udg_RoomCellY[]

JASS:
function Trig_Untitled_Trigger_011_Actions takes nothing returns nothing
  local integer a  = 0
  local integer RS = 20  // Room Size
  local integer HS = 7   // Hall Size
  local integer LengthX
  local integer LengthY
  local integer LoopNum = 0
  local integer Slot
    set LengthX = 0-(RS+HS+RS+HS+RS+HS+RS+HS) // I know i could make this simpler, but it helped me visualize it
    set LengthY = RS+HS
  loop
    exitwhen a >= 10
    set udg_RoomCellX[a]    = LengthX*128
    set udg_RoomCellX[a+9]  = LengthX*128
    set udg_RoomCellX[a+18] = LengthX*128
    set udg_RoomCellX[a+27] = LengthX*128
    set udg_RoomCellX[a+36] = LengthX*128
    set udg_RoomCellX[a+45] = LengthX*128
    set udg_RoomCellX[a+54] = LengthX*128
    set udg_RoomCellX[a+63] = LengthX*128
    set udg_RoomCellX[a+72] = LengthX*128
         // Y after this point
    set udg_RoomCellY[a]    = (0+(LengthY*4))*128
    set udg_RoomCellY[a+9]  = (0+(LengthY*3))*128
    set udg_RoomCellY[a+18] = (0+(LengthY*2))*128
    set udg_RoomCellY[a+27] = (0+(LengthY*1))*128
    set udg_RoomCellY[a+36] = (0+(LengthY*0))*128
    set udg_RoomCellY[a+45] = (0-(LengthY*1))*128
    set udg_RoomCellY[a+54] = (0-(LengthY*2))*128
    set udg_RoomCellY[a+63] = (0-(LengthY*3))*128
    set udg_RoomCellY[a+72] = (0-(LengthY*4))*128
      set LengthX = LengthX+RS+HS
      set a = a+1
    endloop
      //setting border cells to full
  set Slot = 0
  loop
    exitwhen Slot >= 9
    set udg_RoomFull[Slot] = true
    set Slot = Slot+1
  endloop
  set Slot = 9
  loop
    exitwhen Slot >= 81
    set udg_RoomFull[Slot] = true
    set Slot = Slot+9
  endloop
  set Slot = 17
  loop
    exitwhen Slot >= 89
    set udg_RoomFull[Slot] = true
    set Slot = Slot+9
  endloop
  set Slot = 73
  loop
    exitwhen Slot >= 81
    set udg_RoomFull[Slot] = true
    set Slot = Slot+1
  endloop
endfunction
//===========================================================================
function InitTrig_SetRoomCells9 takes nothing returns nothing
    set gg_trg_SetRoomCells9 = CreateTrigger(  )
    call TriggerRegisterTimerEvent(gg_trg_SetRoomCells9, 0.00, false)
    call TriggerAddAction( gg_trg_SetRoomCells9, function Trig_Untitled_Trigger_011_Actions )
endfunction

And finally, under the general custom script code, I have a few functions for returning random integers. I couldnt find a native that returned a random number other than GetRandomInt(N1,N2) and didnt always want to select from a range. So here is a way to return an integer from a set that isnt consecutive.

JASS:
function GRInt9 takes integer Int1, integer Int2, integer Int3, integer Int4, integer Int5, integer Int6, integer Int7, integer Int8, integer Int9 returns integer
  local integer Num
    set Num = GetRandomInt(1,9)
      if Num == 1 then
        return Int1
      elseif Num == 2 then
        return Int2
      elseif Num == 3 then
        return Int3
      elseif Num == 4 then
        return Int4
      elseif Num == 5 then
        return Int5
      elseif Num == 6 then
        return Int6
      elseif Num == 7 then
        return Int7
      elseif Num == 8 then
        return Int8
      else
        return Int9
      endif
endfunction
function GRInt4 takes integer Int1, integer Int2, integer Int3, integer Int4 returns integer
  local integer Num
    set Num = GetRandomInt(1,4)
      if Num == 1 then
          return Int1
        elseif Num == 2 then
          return Int2
        elseif Num == 3 then
          return Int3
        else
          return Int4
      endif
endfunction
function GRInt3 takes integer Int1, integer Int2, integer Int3 returns integer
  local integer Num
    set Num = GetRandomInt(1,3)
      if Num == 1 then
          return Int1
        elseif Num == 2 then
          return Int2
        else
          return Int3
      endif
endfunction
function GRInt2 takes integer Int1, integer Int2 returns integer
  local integer Num
    set Num = GetRandomInt(1,3)
      if Num == 1 then
          return Int1
        else
          return Int2
      endif
endfunction

I think that this is all the code that defines variables or functions that I use to create walls (which is where my problem lies)

As for what version I am using, 'Version: 1.20 (6052)'. , I am not sure. How would I check? EDIT: It says modified on Aug 6th, 2008, though I'm still not sure how to find version number.
I bought TFT disc from blizzard a few years ago, but recently moved abroad and dont have access to it anymore. So I downloaded warcraft from oldgamesdownload (basically a nostalgia games site) and am currently using that. Its probably quite outdated. Where can I get the newest version of World Editor?


Thanks everyone!
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
I thought that udg_ was the global prefix. Is it different for rects? Are there any other variable types that are different?
It’s the prefix for user defined globals. Other things like game generated get gg_<var type>_. You can see this if you convert some GUI triggers to custom text. Triggers will be gg_trg_NAME and rects will be gg_rct_NAME.
 
Status
Not open for further replies.
Top