Re: hateful rant on arrays

2018-12-28 Thread AudioGames . net Forum — Developers room : rory-games via Audiogames-reflector


  


Re: hateful rant on arrays

well that explains why when using my practice game when selecting stuff from the weapon aray you always have to put the weapon number +1.

URL: http://forum.audiogames.net/post/401403/#p401403




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-27 Thread AudioGames . net Forum — Developers room : Liam via Audiogames-reflector


  


Re: hateful rant on arrays

might be base 1 now that I think of it. I'd have to go check old code

URL: http://forum.audiogames.net/post/401226/#p401226




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-27 Thread AudioGames . net Forum — Developers room : Aprone via Audiogames-reflector


  


Re: hateful rant on arrays

Nope.  I mean you can always choose to start them at 1 by just ignoring the zero spot (actually a great idea in some situations), but they do start at zero just like most other languages.  Actually I think there is a command to force them to start at values other than zero, I've just never used it.

URL: http://forum.audiogames.net/post/401221/#p401221




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-27 Thread AudioGames . net Forum — Developers room : Liam via Audiogames-reflector


  


Re: hateful rant on arrays

they are? I remember always starting at 1.

URL: http://forum.audiogames.net/post/401218/#p401218




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-27 Thread AudioGames . net Forum — Developers room : Aprone via Audiogames-reflector


  


Re: hateful rant on arrays

Arrays in VB6 are base 0.  

URL: http://forum.audiogames.net/post/401215/#p401215




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-27 Thread AudioGames . net Forum — Developers room : Liam via Audiogames-reflector


  


Re: hateful rant on arrays

That's the tricky thing about arrays. Getting a length will give you the length of the array, but since the array is base 0, you always have to subtract one from the total length so you don't go over. I was spoiled with vb6 since it is always base 1. I can't imagine going back to that though.

URL: http://forum.audiogames.net/post/401136/#p401136




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-26 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: hateful rant on arrays

No problem. Once you use them enough, you get used to their querk. C++ (and other languages) makes arrays much easier to work with with classes like std::vector (or Python's lists), providing you safety from going out of bounds and causing the classic "memory overwrite" issue that C allows you to do with standard arrays. So practice arrays in a safe environment, and only use C-style ones when you actually have to.

URL: http://forum.audiogames.net/post/400948/#p400948




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-25 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: hateful rant on arrays

that made it work. thank you Ethan. I had no idea an array would be this difficult. But I am much more comfortable using them thanks to the help you have provided. Again thank you.

URL: http://forum.audiogames.net/post/400824/#p400824




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-25 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: hateful rant on arrays

Deduct the index outside the function call to speak:index--; // or --index;.speak(messages[index]);

URL: http://forum.audiogames.net/post/400818/#p400818




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-25 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: hateful rant on arrays

Thank you for the help. It did fix my out of bounds errors. However, I am having the following issue.speak(messages[index-=1}); If index = 5, than it will always speak the message number 4. Say I press left arrow, and I've already heard message 4, it will keep repeating message 4 and not go down. I have made sure the boundary is 0 and not 4. It treats it as a number rather than a function. How do I make it decrease by one message without it always ending in the same number?

URL: http://forum.audiogames.net/post/400807/#p400807




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-25 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: hateful rant on arrays

@6, no. Find another use of the counter. Something like:int index=0;...// in loop...// C++ example, similar enough to BGTif (index-1<0) {// re-speak the message just spoken, we're at the edge of the buffer} else if (index+1>array.size()-1) {// out of bounds if we increase index, replay last message} else if (index-1>=0) {// play message at index} else if (index+1<=array.size()-1) {// play message...}That's a bit bulky, but works.

URL: http://forum.audiogames.net/post/400780/#p400780




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-25 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: hateful rant on arrays

@post4: So like this?Int index=0; then after a new message index+=1; then counter=index. So when I press left arrow: index-=1; speak(messages[counter]);

URL: http://forum.audiogames.net/post/400752/#p400752




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-24 Thread AudioGames . net Forum — Developers room : nyanchan via Audiogames-reflector


  


Re: hateful rant on arrays

Assuming you're only inclementing / declementing by 1,if(--counter==-1) counter=0;orif(++counter==menuArray.length) counter=menuArray.length-1;

URL: http://forum.audiogames.net/post/400656/#p400656




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-24 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: hateful rant on arrays

Keep an external index, and increment that, and access the buffer using that index. Then do a check to ensure your not going out of bounds.

URL: http://forum.audiogames.net/post/400655/#p400655




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-24 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: hateful rant on arrays

Here’s what I am attempting to do. A message history buffer. Left arrow says previous message and right arrow says the next message. I have the loop for it, but I don’t know what to write for previous and next. I have tried counter plus 1 and minus 1, doesn’t work

URL: http://forum.audiogames.net/post/400651/#p400651




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: hateful rant on arrays

2018-12-24 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: hateful rant on arrays

OK... first. Remind you of what arrays are:* Arrays are collections of items with a specified type.* Arrays are zero-indexed.* The last element of an array is the size of the array minus one.

URL: http://forum.audiogames.net/post/400648/#p400648




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


hateful rant on arrays

2018-12-24 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


hateful rant on arrays

I've tried to be calm, I've tried to deal with arrays. But no more! I can't take these things anymore! Arrays have pissed me off more than anything else I've encountered, even more than timers! How the fuck! Do you use these things without getting index out of bounds errors!

URL: http://forum.audiogames.net/post/400647/#p400647




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector