Jump to content
  • 0

Setd and Getd problem


JayPee

Question


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

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
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

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;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

Thanks KeyWorld It works now. I guess it doesnt allow me to use that kind of format

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