Jump to content
  • 0
jasonch

Attaching array to character?

Question

6 answers to this question

Recommended Posts

  • 0

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....
 

Link to comment
Share on other sites

  • 0

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 :)

Link to comment
Share on other sites

  • 0
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?

Link to comment
Share on other sites

  • 0

@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.

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.