Brian Posted August 6, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted August 6, 2012 Test("Hello !"); To call functions like that, you have to define the function within the npc object, not as a separate object. There's an example in trunk/doc/script_commands.txt prontera,150,150,0 script TestNPC 123,{ function MyAdd; mes "Enter two numbers."; next; input .@a; input .@b; mes .@a+" + "+.@b+" = "+MyAdd(.@a,.@; close; function MyAdd { return getarg(0)+getarg(1); } } Link to comment Share on other sites More sharing options...
Swadon Posted August 6, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 17 Reputation: 4 Joined: 01/07/12 Last Seen: May 11, 2014 Share Posted August 6, 2012 It works with a separate object since the revision r15979 Added support for scripts to call user-defined functions without the use of callfunc The scripting engine now supports both the direct invocation of user-defined functions (r15979 and r15981) Link to comment Share on other sites More sharing options...
Brian Posted August 6, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted August 6, 2012 oops, seems I'm a little behind XD Thanks Swadon! Link to comment Share on other sites More sharing options...
Ind Posted August 12, 2012 Group: Members Topic Count: 169 Topics Per Day: 0.03 Content Count: 1260 Reputation: 750 Joined: 11/19/11 Last Seen: April 11, 2013 Share Posted August 12, 2012 Another bugfix in r16625 regarding this feature, at this point I come to think this feature might be fully functional now. 1 Link to comment Share on other sites More sharing options...
Kisuka Posted August 13, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 56 Reputation: 30 Joined: 02/22/12 Last Seen: August 8, 2020 Share Posted August 13, 2012 <3 Link to comment Share on other sites More sharing options...
Aries Posted August 28, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 70 Reputation: 18 Joined: 01/28/12 Last Seen: May 10, 2021 Share Posted August 28, 2012 (edited) As of r15982, variables used within scripts can be directly assigned to as you would using another programming language. this will only work with varialbles and not yet with arrays? Edited August 28, 2012 by chokoleyt Link to comment Share on other sites More sharing options...
Emistry Posted August 28, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2370 Joined: 10/28/11 Last Seen: April 20 Share Posted August 28, 2012 yes variable only......doesnt support for passing an arrays into the function.... but there is still alot way for you to pass the value of an array into the function.... Link to comment Share on other sites More sharing options...
Recommended Posts