arrays

dannyboydude

Ultra Cool Member
Reaction score
33
does anybody know if starcraft 2 will be using multidimensional arrays?

because if they do itl save LOTS of time and lots of un-used variables being created

and im going straight to SCII mapping as soon as

its a real shame : no heroes , inventories , all that lot.

But anyway thanks for replies

~Dbd~
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> lots of unused variables being created

I fail to see how multi-dimensional arrays are going to prevent that...


And, there probably won't be any. What for anyway? It's a nice-to-have but nothing more.

Actually, there will be Heroes. For the precise details, we'll have to wait though.
 

monoVertex

I'm back!
Reaction score
460
Why don't you ask your dad? :rolleyes: He was working for Blizzard, right?

And anyway, it seems you are really uninformed, as there will be heroes. Seems you dad forgot to tell you a lot of things :).
 

dannyboydude

Ultra Cool Member
Reaction score
33
lol he didnt tell me i was eves dropping reading his emails

he told me his job was secret and very wicked and hed tell me a bit later because he just quit his last job

and i was like just looking and i opened his emails and i got startled and like stars shined in my eyes

but like @AceHart

MDA = well saving player number and unit

pick all players
integer + 1
X = [ player number ] [ Integer ]

as supposed to

integer = +1
P1 X = [ integer ]
integer = +1
P2 X = [ Integer ]


hope you understand what im trying to say

and erm i didnt know there was heroes
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
All i know is that it would make my life easier.
3 of my games and a few more i got planed, i used them.
Tetris Playersfeild[rows*col] And i didn't have too but tetris is sure could have helped. plus if i make it 6 player, it will be [playernum*rows*col]
Also My AI Game could have helped. i am forced to do things like Units[50*6] Units[300]. Basically its makes it a little harder to code, and harder to look at. because now when i want to access player 3's 50 units i have to. Units[(playernumber - 1 * 50 ) + i]
My Train Game i had to make normal arrays act like them. and using the gui can make your hand go numb as is, but this would have helped me alot.

For me it would be useful, i don't think its required, but i think it wont hurt to allow them.
And have to play with it. No reason for this. Why would it hurt to add this.

p.s. my train game was a pain with out them, my roller coaster game i am working on is becoming a pain with out them. I would like an array of x[num][num][num][num]. But instead i just get [num*num*num*num]
 

dannyboydude

Ultra Cool Member
Reaction score
33
anyway i think this thead is over but

howz your game comnig on and what part are you doing now ?

EDIT: hey could you give me alink to your train game
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
Sure

Been doing alot of work on it recently and its not updated.
(a few weeks worth of work not up yet, but will be in a week or so)

But best version i have uploaded still shows the basic concepts.

http://www.thehelper.net/forums/showthread.php?t=94400&highlight=battle+trains

thehelper.net/forums/showthread.php?t=94400&highlight=battle+trains

as for the roller coster one, theres not much to show. i still waiting for a model from someone.
 

dannyboydude

Ultra Cool Member
Reaction score
33
man your train game is awesome i might test on b.net

and cant wait til your rollercoaster designer

Rock on....
 
Reaction score
333
Sorry for mild off-topic, but you can use two-dimensional arrays in vJass. Try this:

JASS:
//! textmacro Matrix takes NAME, TYPE, SCOPE, WIDTH
$SCOPE$ struct $NAME$
    private static $TYPE$ array a
        
    method operator [] takes integer i returns $TYPE$
        return .a[this+i]
    endmethod
        
    method operator []= takes integer i, $TYPE$ t returns nothing
        set .a[this+i] = t
    endmethod
        
    static method operator [] takes integer i returns $NAME$
        return i*$WIDTH$
    endmethod
endstruct
//! endtextmacro


In the interest of speed there is no bounds checking on column access. Use like this:

JASS:
library Example initializer Init
    //! runtextmacro Matrix("Table", "string", "private", "10")
    // max rows is roughly floor(8191 / width) - 1, 818 in this case.
    
    private function Init takes nothing returns nothing
        set Table[1][9] = "zzzz"
        set Table[1][8] = "wwww"
        set Table[2][8] = "xxxx"
        set Table[1][18] = "yyyy" // overflow, don't try to access columns beyond width - 1.
        set Table[3][6] = "vvvv"
        
        call BJDebugMsg(Table[1][9]) // prints "zzzz"
        call BJDebugMsg(Table[1][8]) // prints "wwww"
        call BJDebugMsg(Table[2][8]) // prints "yyyy", not "xxxx"
        call BJDebugMsg(Table[3][6]) // prints "vvvv"
    endfunction
endlibrary
 

dannyboydude

Ultra Cool Member
Reaction score
33
waaaaaaa

im trying people , its taking long time for me to learn lol

i know u can do it in the vjass but i dont even know whether to vjass or to jass straight away( i cant ever find a good tut on vjass they all say u gotta do jass before , look at some people they dont even know jass they use vjass)
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
All of my games are GUI 100% :)

But soon will have a little jass to clean leaks. (but current games don't need it)

edit: dannyboydude, i am sure you would understand my tetris game if you looked at the the triggers. its alot more simple then people think.
But some of the other ones, the triggers arnt as easy to look at, or as clean, but they are the way thats easyest for me.

Also i dont lock my games. I do when they start to get pretty polished. but i nominally upload a non locked one too.
 

dannyboydude

Ultra Cool Member
Reaction score
33
wow i didnt think your games were gui i didnt bother to look at the triggers because i knew i wouldnt understand lol
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top