Jump to content
  • 0

function max Arguement limit


utofaery

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

1.

How many arguements can we pass into function?  like the maximum getarg(max) can get???

2.

Can we getarraysize that is define in the npc without cloning the array inside the function?

example function has :

.@i = getarraysize(getarg(0));

return .@i;

example npc 1 array

.@narray , 1, 2, 3;

example in npc 2 :

callfunc ("F_arraysize", getvariableofnpc(.@narray, npc 1);

will this turn out or return the arraysize correctly?

 

or do we need to clone /duplicate the array inside the function to make getarraysize to work correctly?

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

1. most of the time, if it doesn't mention any limit, it will be INT, means 2147483648 ... although might need some serious test to test the limit

2. no, getarraysize doesn't support look up to another npc

npc variable .var can be done with

getarg( X, getarraysize( getvariableofnpc( .var, <npc name> ) ) )

scope variable .@var cannot retrieve like that, as it run per script state

 

 

4 hours ago, utofaery said:

callfunc ("F_arraysize", getvariableofnpc(.@narray, npc 1);

.@narray is a scope variable, server throw error

prontera,155,185,5	script	khfksjhf	1_F_MARIA,{
	.@a = 1;
	dispbottom getvariableofnpc( .@a, strnpcinfo(0) ) +"";
	end;
}
[Error]: buildin_getvariableofnpc: invalid scope (not npc variable)
[Debug]: Data: variable name='.@a' index=0
[Debug]: Source (NPC): khfksjhf at prontera (155,185)

 

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