![]() |
Help with a couple commands
Hello, I have been going over the commands list as of late, and have passed over a few things multiple times that I honestly couldn't figure out what to do with. I don't understand Tokenize and arrays are a mystery to me. I understand that arrays can hold multiple numeric data, but I don't know how to access them properly. Looking over the board I have seen tokenize used before, but I don't see how it holds the variables(Words instead maybe?). I am sorry to sound like a beginner, but I am lost and was hoping if some of you could help me. Any explanations on what these commands do, what they are used for, and how they are used would be greatly appreciated. Thanks for your time.
DevaS posting on Masa's account. |
NPC Code: :( I always said I was a poor teacher. But here is a script using an array and a for loop together. Maybe it will make sense when you run it. I believe it shows how you can use a for loop to access the information in an array. I assure you there are much more complex methods of data retrieval using multiple arrays. |
Alright, so an array holds the different sets of numeric data, and you can call one part of the set by it's index. Would it be possible then, to show an image or put an explosion at 4 points in a level with a single command? Or would you still need to call each number in the array individually? That helped alot to give me an idea of what an array is and how it's information can be retrieved, thanks. Any suggestions on what I could try to script to see if I understand how to use an array? Sorry for all the questions, I am just happy to start learning about some of this stuff.
|
"tokenize <string>;" will split up <string> wherever there are commas or spaces. Each part of the string is stored in a different message code, starting with #t(0) and going up (#t(0), #t(1), #t(2), etc.)
|
Just to let you know, you can also create arrays like
dirgo = {0,-1,0,1,-1,0,1,0}; for those lazy typers (like me) |
Quote:
does the exact same thing as dirgo. Just one less line but it's shorter none the less. |
Quote:
At least that's how I used it with my Menu. |
| All times are GMT +2. The time now is 12:09 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.