ติดตั้ง Steam
เข้าสู่ระบบ
|
ภาษา
简体中文 (จีนตัวย่อ)
繁體中文 (จีนตัวเต็ม)
日本語 (ญี่ปุ่น)
한국어 (เกาหลี)
български (บัลแกเรีย)
Čeština (เช็ก)
Dansk (เดนมาร์ก)
Deutsch (เยอรมัน)
English (อังกฤษ)
Español - España (สเปน)
Español - Latinoamérica (สเปน - ลาตินอเมริกา)
Ελληνικά (กรีก)
Français (ฝรั่งเศส)
Italiano (อิตาลี)
Bahasa Indonesia (อินโดนีเซีย)
Magyar (ฮังการี)
Nederlands (ดัตช์)
Norsk (นอร์เวย์)
Polski (โปแลนด์)
Português (โปรตุเกส - โปรตุเกส)
Português - Brasil (โปรตุเกส - บราซิล)
Română (โรมาเนีย)
Русский (รัสเซีย)
Suomi (ฟินแลนด์)
Svenska (สวีเดน)
Türkçe (ตุรกี)
Tiếng Việt (เวียดนาม)
Українська (ยูเครน)
รายงานปัญหาเกี่ยวกับการแปลภาษา
arr = ds_list_create()
ds_list_add(arr, 1, 1, 1, 56, ...)
so its like
arr[1] = 1
arr[2] = 1
arr[3] = 1
arr[4] = 56
...
(Not that arrays would necessarily be optimal in this case, either, of course, but still, they might be better, like (maybe?) less resource-intensive and getting rid of themselves automatically when their objects are removed on room change.)
I do admit that I probably should've mentioned that I would be using such many arrays.
(But still, very nice suggestion, and it looks very neat to write, it just might not be quite what I'm looking for in this case.)
if every 5 values decreases by one, just use a counter to track it and modify in the loop accordingly.
As per resources, coding time, etc.. there is no difference between the two in a general sense of things. Lists are designed to handle dynamic data. They are optimised to handle the data best and should be used if your data is dynamic. Another thing to mention is though data structures already come pre packaged with mehods to examine and extract data from the data structure, you could build methods to work with arrays. If you understand how data structures work and why they were built then you could code your own methods to do the same function on arrays with the same overhead as the pre-packaged ones do.
EDIT: on a side note... arrays came first when we started to build computers to except language. Then we notices that lists, ques, maps, etc.. were great way to handle data. So we learned to optimize them as best we can. It's similar to Vector math in Unity and C+. Just optimized way to handle data. Along with being easy to read and interpret.
Depending on what you mean by that, the main thing/reason I want to avoid using a "list" is because GameMaker: Studio's manual says[docs.yoyogames.com] "NOTE: As with all dynamic resources, data structures take up memory and so should always be destroyed when no longer needed to prevent memory leaks which will slow down and eventually crash your game." and I don't want to have to manually "destroy" the lists whenever a room ends (not even if I make a universal parent object with a room end event or such that destroys them), while an array is tied to a local instance and destroyed when an instance ceases to exist (as far as I'm aware).
I know, but I just find it silly to have to write a script in order to (neatly) initialize an array in such a way.
Studio 2 introduced this way to writing arrays:
array[0] will be 1, array[7] will 3, etc.
Which means I assume that I'll have to write a custom script to fill out arrays "neatly" (which won't be much of a problem, I'd just have preferred a native solution).