Jump to content

[MAXscript] tablice


Guest ant-3d

Recommended Posts

Hej

 

Tym razem mam problem z tablicami i nie bardzo wiem o co chodzi. Potrzebuje miec duza tablice dwuwymiarowa. Tak wiec robie tak:

 

arr = #(#(), #()) -- dziala

 

Teraz sobie np. do niej wrzucam

 

arr[1][1] = 100 -- dziala

arr[1][234] = 123 --dziala

arr[2][2] = 453 --dziala

 

ale

 

arr[234][3] = 234

 

juz nie dziala i dostaje taki komunikat "No ""put"" function for undefined"

 

co robie zle i jak w takim razie moge taka tablice sobie zadeklarowac?

Link to comment
Share on other sites

Każdy element tablicy może przechowywać obiekt innego typu, więc trzeba tak:

arr = #();

arr.count = 234;--234 to tutaj maksymalny rozmiar tablicy

for i=1 to 234 do

(

arr = #();

)

(Łudzę się, że przypisywanie liczby do własności .count działa podobnie jak std::vector::reserve()).

Link to comment
Share on other sites

robert_lee: Man :) jak zobaczylem twoja odpowiedz to juz myslalem zesmy sie nie zrozumieli. Sprawdzilem i dziala. Nie wiedzialem ze w maxscripcie moge cos takiego jak: arr.count = xxx

 

Dzieki wielkie, reput polecial :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We are using cookies. Read about our Privacy Policy