Records as parameters?

Builder Bob

Live free or don't
Reaction score
249
I just noticed that records cannot be used as parameters in functions. Why would they not allow that? It's so inconvenient...

Edit: I guess records aren't really what I thought they would be :(
 

Arkless

New Member
Reaction score
31
I just noticed that records cannot be used as parameters in functions. Why would they not allow that? It's so inconvenient...

Edit: I guess records aren't really what I thought they would be :(

They kinda are, blizzard just forbid doing that when the editor came out (thought it is implemented, with patch 8 you could do it)...

I still hope they allow it when it oficially comes out <.<
 

Builder Bob

Live free or don't
Reaction score
249
I'm still a bit unsure about how the records works.

Let's say I make a record like this

CarType
Length
Width
Acceleration

and another record

Car
CarType
PositionX
PositionY
Velocity

It seems to me that the variables of CarType inside the record Car must be specifically set for each car, and that I won't be able to just set the specifications of the different car types once. You're saying that they just removed this kind of referencing somewhere along the way? Really hope they bring it back.
 

Dave312

Censored for your safe viewing
Reaction score
269
You could always create an array of CarType variables, with all the defaults set for each type of vehicle. Then in your Car record, make the CarType variable be an integer to represent the index for the CarType.

It is a little odd that you can't use a record as a parameter.
 

Builder Bob

Live free or don't
Reaction score
249
Yeah, it seems that it has to be done that way. It just seems so inconvenient and backwards...
 
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