utofaery Posted February 10, 2019 Posted February 10, 2019 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? Quote
0 AnnieRuru Posted February 11, 2019 Posted February 11, 2019 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) Quote
Question
utofaery
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?
1 answer 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.