mawjustin Posted February 18, 2023 Posted February 18, 2023 (edited) Hi Team, How do we merge arrays and use them as a single array? Example: setarray .attr1[0],4700,4701,4702,4703,4704,4705,4706,4707,4708,4709; setarray .attr2[0],4730,4731,4732,4733,4734,4735,4736,4737,4738,4739; setarray .attr3[0],4740,4741,4742,4743,4744,4745,4746,4747,4748,4749; setarray .attr4[0],4710,4711,4712,4713,4714,4715,4716,4717,4718,4719; setarray .attr5[0],4720,4721,4722,4723,4724,4725,4726,4727,4728,4729; setarray .attr6[0],4750,4751,4752,4753,4754,4755,4756,4757,4758,4759; I want to use them as setarray .combinedArray[0], attr1, attr2, attr3, attr4, attr5, attr6; This way I can only modify a specific attribute if necessary without affecting the entire list of array, as the other .attr arrays are used in other functions. Thank you. Edited February 18, 2023 by mawjustin Removed spacing. Quote
2 Emistry Posted February 18, 2023 Posted February 18, 2023 setarray .combinedArray[getarraysize(.combinedArray)], .attr1, getarraysize(.attr1); setarray .combinedArray[getarraysize(.combinedArray)], .attr2, getarraysize(.attr2); setarray .combinedArray[getarraysize(.combinedArray)], .attr3, getarraysize(.attr3); setarray .combinedArray[getarraysize(.combinedArray)], .attr4, getarraysize(.attr4); setarray .combinedArray[getarraysize(.combinedArray)], .attr5, getarraysize(.attr5); setarray .combinedArray[getarraysize(.combinedArray)], .attr6, getarraysize(.attr6); Quote
0 mawjustin Posted February 18, 2023 Author Posted February 18, 2023 How do we implement this? I'm confused as to how to use this based on the instructions given on script commands.https://raw.githubusercontent.com/rathena/rathena/master/doc/script_commands.txt Quote
Question
mawjustin
Hi Team,
How do we merge arrays and use them as a single array?
Example:
I want to use them as
This way I can only modify a specific attribute if necessary without affecting the entire list of array, as the other .attr arrays are used in other functions.
Thank you.
Edited by mawjustinRemoved spacing.
4 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.