jasonch Posted August 23, 2017 Posted August 23, 2017 Hey guys, am here again! A short question: Is there a way to attach an array to a character permanently? And how do you call each variable? Quote
0 Litro Endemic Posted August 23, 2017 Posted August 23, 2017 use character permanent variable setarray arrayname[0], 1,2,3,4,5; setarray arrayname$[0],"1","2","3","4","5"; Quote
0 jasonch Posted August 24, 2017 Author Posted August 24, 2017 Hmmm, should've made myself clearer. Sorry. What I actually wanted is that the character has the ability to choose what value to set for each value on the the array. For example: The character chooses on a menu the value "2" on the an array "arrayname[0]", then chooses again "3" on arrayname[1], 1 on arrayname[2], and so on... Then it will attach to the char: arrayname[0], 2, 3, 1,..... Is it possible? And how do I call that values attach to the char? So the NPC will say: You chose values 2, 3 ,1, so on.... Quote
0 Stolao Posted August 27, 2017 Posted August 27, 2017 You want to look into the input command As far r how to set each array[index] you would do something like Input(Var[index]); should work This is a support thread so I'll support you in finding an answer Quote
0 yuchinin Posted August 28, 2017 Posted August 28, 2017 On 8/24/2017 at 6:36 PM, jasonch said: Hmmm, should've made myself clearer. Sorry. What I actually wanted is that the character has the ability to choose what value to set for each value on the the array. For example: The character chooses on a menu the value "2" on the an array "arrayname[0]", then chooses again "3" on arrayname[1], 1 on arrayname[2], and so on... Then it will attach to the char: arrayname[0], 2, 3, 1,..... Is it possible? And how do I call that values attach to the char? So the NPC will say: You chose values 2, 3 ,1, so on.... From your comment I think what you want are each character can define their own array order but not attaching array to character. So player A may have arrayname,2,3,1; Player B may have arrayname,3,1,2; Is this what you want or am I wrong? Quote
0 jasonch Posted August 28, 2017 Author Posted August 28, 2017 @yuchininYes: each and every character all can have different arrays to their desires AND it is attached to them permanently. I've tried @Stolao's suggestion, In my char_reg_num table, I've noticed the multiple same values under KEY but under INDEX, they're being numbered. Is this how array being registered in the database? If it is, then I guess my questions are answered. Quote
0 Z3R0 Posted August 31, 2017 Posted August 31, 2017 Yes, the array is registered with the following information char_id | name of variable | index of array | value so for instance, if you create array on character: setarray charArray[0], 1, 2, 3; you will have 3 values for 1 character... 150001 | charArray | 0 | 1 150001 | charArray | 1 | 2 150001 | charArray | 2 | 3 Quote
Question
jasonch
Hey guys, am here again!
A short question: Is there a way to attach an array to a character permanently? And how do you call each variable?
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.