jasonch Posted August 23, 2017 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 29 Reputation: 1 Joined: 12/31/11 Last Seen: June 6, 2023 Share 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 Link to comment Share on other sites More sharing options...
0 Litro Endemic Posted August 23, 2017 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 283 Reputation: 79 Joined: 06/13/13 Last Seen: June 7, 2023 Share 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 Link to comment Share on other sites More sharing options...
0 jasonch Posted August 24, 2017 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 29 Reputation: 1 Joined: 12/31/11 Last Seen: June 6, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
0 Stolao Posted August 27, 2017 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Yesterday at 01:58 PM Share 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 Link to comment Share on other sites More sharing options...
0 yuchinin Posted August 28, 2017 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 120 Reputation: 48 Joined: 07/23/13 Last Seen: August 27, 2021 Share 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 Link to comment Share on other sites More sharing options...
0 jasonch Posted August 28, 2017 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 29 Reputation: 1 Joined: 12/31/11 Last Seen: June 6, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
0 Z3R0 Posted August 31, 2017 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 618 Reputation: 201 Joined: 11/09/11 Last Seen: June 14, 2024 Share 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 Link to comment Share on other sites More sharing options...
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?
Link to comment
Share on other sites
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.