PoLlama Forums  

Go Back   PoLlama Forums > WarCraft > World Editor Help

Reply
 
LinkBack Thread Tools
Old 07-09-2008   #1
 
Join Date: Jul 2008
Posts: 5
drunken is an unknown quantity at this point
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. ]
drunken is offline   Reply With Quote
Old 07-09-2008   #2
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
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
I don't know if you can read JASS ( I hope otherwise you got some nasty GUI nested loops in your code <.< ), but this does *roughly* the same. It might need some tweaks here and there and some optimization but it should give you the basic idea.

An example call:
call Setup_Squares('DTrx', 5, 5, 128, 128, 90, 1)

... Would produce something like this:
Code:
xxxxx
xxxxx
xxxxx
xxxxx
xxxxx
E.g. Syntax:
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 :]

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Old 07-09-2008   #3
 
Join Date: Jul 2008
Posts: 5
drunken is an unknown quantity at this point
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.
drunken is offline   Reply With Quote
Old 07-10-2008   #4
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
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.

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"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.
Mr. Zero is offline   Reply With Quote
Old 07-10-2008   #5
Unregistered
 
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?
  Reply With Quote
Old 07-10-2008   #6
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
Re: Strange grid problem


[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


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


All times are GMT -5. The time now is 09:51 PM.

A friend of Wc3Happy
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165