![]() | |
| | #1 |
![]() Join Date: Jul 2008
Posts: 5
![]() | Strange grid problem Sorry if this comes up twice but I posted it unregistered and I am impatient so I registered and reposted it I am trying to make a grid of destructibles at runtime, mostly it is working fine but there is a problem that has me thoroughly confused. My (pseudo)code looks like this: For each (a) from 1 to GridSize For each (b) from 1 to GridSize create destructible at (region)Origin with offset (a*SquareSize,b*SquareSize) this nested loop creates a nice grid of destructibles but randomly the 17th row and every subsequent row in both the x and y axes is moved roughly SquareSize/2 towards the origin. Here are some images of the transition zone: [Only registered and activated users can see links. ] [Only registered and activated users can see links. ] [Only registered and activated users can see links. ] |
| | |
| | #2 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: Strange grid problem Wow random... I were working a bit on the same... Hang let me get my code. Code: //===========================================================================
function Setup_Squares takes integer typeId, real numberofsqx, real numberofsqy, real sqsizex, real sqsizey, real sqface, real sqscale returns nothing
local real x = (numberofsqx/2)-numberofsqx
local real resety = (numberofsqy/2)-numberofsqy
local real y = resety
local real maxx = numberofsqx/2
local real maxy = numberofsqy/2
loop
loop
call CreateDestructable('B003',((sqsizex*x)+(sqsizex/2)),((sqsizey*y)+(sqsizey/2)),sqface,sqscale,0)
set y = y + 1.00
exitwhen y >= maxy
endloop
set y = resety
set x = x + 1.00
exitwhen x >= maxx
endloop
endfunction An example call: call Setup_Squares('DTrx', 5, 5, 128, 128, 90, 1) ... Would produce something like this: Code: xxxxx xxxxx xxxxx xxxxx xxxxx call Setup_Squares(<Your destructible typeid here>, <How many on the x row>, <How many on the y colloum>, <The x size of the destructible>, <The y size of the destructible>, <The face dicretion>, <Scale of the model>) The only problem is that it takes from 0.0x and 0.0y so if you want to start in 234.0x and -453.0y then you have to modify the code (should be easy enough). But for solving your problem with your code, you got to post it :] |
| | |
| | #3 |
![]() Join Date: Jul 2008
Posts: 5
![]() | Re: Strange grid problem Actually I am using the gui. the nested loops aren't that bad. Maybe one day I'll put in the minimal research it would take me to learn jass. At this point I don't even know how to include a jass script in a map. :-p The problem I posted here is not actually causeing me any serious problems with the map I'm making but I posted it because I am fairly certain that it is a major bug with the worldedit program. |
| | |
| | #4 | ||
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: Strange grid problem Na I assure you it is your code. Warcraft just do what you order it to do .But if you don't want to share your code, I can fully understand that, debug with other people can be a bit hard.
"In the end there is no greater motivation than revenge" SO I HERD U LEIK MUDKIPZ?! Last edited by Mr. Zero; 07-10-2008 at 04:30 PM. | ||
| | |
| | #5 |
![]()
Posts: n/a
| Re: Strange grid problem How can I get the script into a copy/pasteable form without typing it out from the editor? |
|
| | #6 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Re: Strange grid problem ![]() |
| | |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bush says Saudi oil boost doesn't solve US problem | King Stubby | Global News | 0 | 05-17-2008 11:22 AM |
| OK, The LOG IN LOG OUT problem, lets get it straight. | MrApples | Anouncements | 12 | 08-13-2007 09:42 PM |
| A problem for the zombies | ShadowGHX | World War Z | 11 | 08-11-2007 06:06 PM |
| a strange roblem to me at least | emrald | World Editor Help | 3 | 06-17-2007 01:00 PM |