Jump to content
  • 0

NPC Item trade limit


Mistique

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  53
  • Reputation:   0
  • Joined:  09/15/12
  • Last Seen:  

Hello all,

 

I have a question, I'm using a script that I got from patskie requested here: http://rathena.org/board/topic/86832-help-with-this-exchanger-script-please/

 

Somewhere in the script, it asks me to add ID's (setarray .itemid, 1618, 1604; // Put all id here)

Which of course I did. But it seems like it can only take up to... like 100 items? It only recognized that much, the rest of the items just don't appear at all.

 

What I want is that I could put more than 100, like 200 or 300. Does anyone know how to do that?

 

Hope someone can help me. ^^

 

Thank you!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Array Variables

An array is a variable that references consecutive memory blocks of the same type. In C or any other programming / scripting language, an array has no limitation as in how many indexes (how many consecutive blocks of memory it references to) it can hold, nor its dimensions (how many arrays can an array hold. It's like a matrix of 2x3, for example).

In Athena, it has a limitation of 128 possible values held by a single array, and a single dimension (mostly because strings can use a full index regardless of the length of the string it references to).

Arrays can be set and unset using the default set. They also come with a special set of commands, to quickly set multiple values, or cleaning them. These are the Array related commands.

 

So meaning if you put 128+ item id's on that single array. All values from 129 onwards will not work.

 

Try ( src/map/script.c#L176 ) :

/// Maximum amount of elements in script arrays
#define SCRIPT_MAX_ARRAYSIZE 128
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  53
  • Reputation:   0
  • Joined:  09/15/12
  • Last Seen:  

Thanks Patskie, but I've already done that, I even put it to the allowed limit of 254 but no difference. u_u

 

Is there another way, or is 128 really as far as it goes?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  44
  • Reputation:   5
  • Joined:  12/06/11
  • Last Seen:  

Edit: That wasn't possible

Edited by Khazou
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Then Perhaps this will interest you: http://rathena.org/board/topic/85638-xynvaroth-array-20/

Not sure how user friendly it is, but it does allow you to increase your normal array limits.

 

Also, I'd suggest use 2dimensional arrays, but again, 2d & 3d arrays, aren't very user friendly, and frankly hard to explain :/

 

Edit: Now that I think about it.. Why doesn't rAthena support 2d Arrays, or more importantly why hasn't it been implemented yet, is there src issue that prevents the engine from rendering something like this into existence O.o?

Edited by GmOcean
  • Upvote 1
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...