Notifications
Clear all
[Closed] Placing all atmospherics in array
May 10, 2010 6:52 pm
Hi, i was trying to get all the atmospherics into an array, but the only thing ive written that works seems far from the best way to do it. So i wondered if someone might know a better way
this is the code i use atm.
atmosArray = #()
for i = 1 to 10 do ( try (append atmosArray (getAtmospheric i))catch(exit))
print atmosArray
2 Replies
May 10, 2010 6:52 pm
atmosArray = for i=1 to numAtmospherics collect (getAtmospheric i)
or for active effects only:
atmosArray = for i=1 to numAtmospherics where isActive (a = getAtmospheric i) collect a
May 10, 2010 6:52 pm
Awesome! Thanks a lot, didnt see numAtmospherics when i was searching, which made it quite hard