2019-05-12 12:50:46

so in bgt it doesn't know the difference between 0 and 1 when saying: array.length. And when I try: if(array_is_empty, but that seems to have no effect. What is the best way of it knowing the different between 0 and 1 items?

2019-05-12 16:14:13

In any programming language, an array is empty if it has 0 items. 1 item, even if it is an array, constitutes a non-empty array. Is there something that you are testing that is not giving the result you expect? If so, please provide a short snippet that illustrates the question.

Thanks!

Kind regards,

Philip Bennefall

2019-05-12 16:32:55

Couldn't you just do

array = {"GoT", "Big Bang Theory", "Grey's Anatomy", "The Ranch", "LivePD"};
if (array)
{
  //do stuff
}
else
{
  //other stuff
}

The inverse would be if (!array). I've done that type of thing in other langs and it worked fine, syntactically matching the other lang's structure of course.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2019-05-12 18:39:23

Nope. You can't do that in bgt.

If you like what I do, Feel free to check me out on GitHub, or follow me on Twitter

2019-05-12 20:10:26

well damn.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2019-05-12 20:17:04

@3
That won't work in  bgt unforchinatly

2019-05-12 20:17:20

And that, is why bgt needs updates.

2019-05-12 21:00:54

If the OP wants an initializer list, the syntax is:

int[] my_list={1, 2, 3};

Kind regards,

Philip Bennefall

2019-05-12 21:22:10

@7 I think it's clear that BGT will not get updates. I think that if you want updates to BGT< you'll have to consult with Philip. I'm not sure of the details, but I guess if you pay him it may be possible for him to make your updates, keyword being may as I am not Philip so can't say. LOL

2019-05-12 21:33:08

na. Been there, done that.

If you like what I do, Feel free to check me out on GitHub, or follow me on Twitter

2019-05-12 22:35:54

I have had several requests from people who want to buy the source code for BGT, but I have turned them down for various reasons which I shall not expand upon here. At this time I don't have any planned updates because I have neither enough time nor enough interest to dive back into it. As I stated in another topic a while back, I recommend people look into other programming languages. BGT was good for what I intended it to do about 10 years ago, but it is not particularly relevant today. If you want to make Windows games and are aware of what the engine can and cannot do, by all means use it. But I personally think it is time to move on and expand the audio games landscape far beyond the feature set of BGT.

Kind regards,

Philip Bennefall

2019-05-13 02:29:16

I recommend trying JS or python, because it is clear that BGT will have no updates. Well, it's quite clear now rooofl

2019-05-13 06:41:36

So @1, are you confused by the 0 based indexing in arrays? I have never in all my time using BGT seen the length method of an array fail to do what it is supposed to do. I'm almost certain it can not be confused with 0 and 1 items. If array.length returns 0, there are 0 items. If array.length returns 1, there is 1 item. If it returns 0 and you try accessing array[0], it will crash because that element doesn't exist. If it returns 1 and you try accessing array[1], it will also crash because it thinks you are trying to access the second element in the array. Arrays are indexed starting at 0, so if array.length returns 1, the proper way to access that element is by accessing array[0]. Hopefully this helps.

I am a web designer, and a game developer. If you wish see me at http://www.samtupy.com

2019-05-14 16:35:05

@13 I already knew. I think I’m just an idiot for not trying if(array.length==0 or 1). I seriously think I thought I did that but haven’t. Maybe I thought but didn’t