About 'Introducing Arrays'!

In this video (objectives)…

Put all of our plugin words into an array Put wildcards into our story text Merge the new array into the story

After watching (learning outcomes)…

Create arrays, use format strings and create a scalable foundation for Loony Lips!

(Unique Video Reference: 2_LL_GDT)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

Just a note… you say in the video that having too many values in the array is fine (won’t give an error), but I happened to do that by accident, and it does indeed give an error:

“not all arguments converted during string formatting in operator ‘%’.”

I kept holding my breath to see if you would actually run it with too many (to prove your point, or not in this case), but you didn’t. Oh well. :slight_smile:

Good stuff so far!

1 Like

will remove my question keeping the course clean, as I found this issue when doing my own challenge.

Ah, I think I misspoke. I meant that you can have an array of any size without problems, not that it’d work here. I shall have to take another peek at that video.

1 Like

It was in the context of providing enough array elements for the %s’s in your string. 11:05: “It doesn’t matter if I have too many. It matters if I have too few.” But it does seem to matter. (I’m not sure why, but hey, that’s the way they coded it.)

1 Like

Coming from a background of C# and procedural languages, I have had real problems getting to grips with arrays in Godot as they work very differently to arrays in those languages, particularly when trying to use multidimensional arrays. In fact I think calling them arrays in Godot is a little misleading, as they are really lists, rather than arrays in the sense of these other static languages. There are swings and roundabouts here, the Godot implementation is more flexible in some ways but I think more awkward to use when iterating through them particularly when populating the array. Still it is what it is, but I think that you could bring these differences to the fore a bit more for the benefit of us old dinosaurs.

Good point. I think I’ll see about getting a JSON refresher in after Ben’s done his C# conversion videos - that way we can get a theory-based video in without breaking the flow too much for those who don’t do well with theory videos.

1 Like

I tried using an integer so see if %s will be able to take it in, and it did. GDScript - loving it!

Privacy & Terms