Jump to content
  • 0

Setd and Getd problem


Question

Posted (edited)

Iam making a sort of a multi dimensional array using setd and getd. This is my script


prontera,153,169,4 script Donation 123,{

set .npcname$,"Donation";
set .arrayCounter,0;


//Items
//For Headgears [Category][slot Number][itemID = 0 /ItemAmount = 1]
setd ".@Item[0][0][0]","123"; //ItemID
setd ".@Item[0][0][1]","124"; //Amount

mes getd(".@Item[0][0][2]");

}

when i mes

mes getd(".@Item[0][0][0]"); It outputs 124

mes getd(".@Item[0][0][1]"); it outputs 124

and also

mes getd(".@Item[0][0][2]"); It outputs 124

but when I entered

mes getd(".@Item[1][0][0]"); This is correct it outputs nothing since this is not set

Is this the limitation of setd and getd or is it a bug or my wrong usage of the syntax?

post-322-0-87434000-1325154155_thumb.png

Edited by JayPeeMateo

2 answers to this question

Recommended Posts

Posted

Funny that it doesn't throw an error :D

1) Athena script engine doesn't support multi-dimensional array.

2) You set a string into a int variable.

Uou have to do something like this:

prontera,153,169,4 script Donation 123,{

set .npcname$,"Donation";
set .arrayCounter,0;


//Items
//For Headgears [Category][slot Number][itemID = 0 /ItemAmount = 1]
setd ".@Item_0_0_0", 123 ; //ItemID
setd ".@Item_0_0_1", 124 ; //Amount

mes getd(".@Item_0_0_0"); // 123
mes getd(".@Item_0_0_1"); // 124
mes getd(".@Item_0_0_2"); // 0
mes getd(".@Item_1_0_0"); // 0
close;
}

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...