utofaery Posted February 10, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 228 Reputation: 19 Joined: 10/27/12 Last Seen: March 17, 2019 Share 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 Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted February 11, 2019 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share 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 Link to comment Share on other sites More sharing options...
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?
Link to comment
Share on other sites
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.