Epoque

r15982: Script Engine Update

Recommended Posts

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 [email protected];
input [email protected];
mes [email protected]+" + "[email protected]+" = "+MyAdd([email protected],[email protected];
close;

function MyAdd
{
	return getarg(0)+getarg(1);
}
}

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

oops, seems I'm a little behind XD

Thanks Swadon!

Share this post


Link to post
Share on other sites

Another bugfix in r16625 regarding this feature, at this point I come to think this feature might be fully functional now.

  • Upvote 1

Share this post


Link to post
Share on other sites

<3

Share this post


Link to post
Share on other sites
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 by chokoleyt

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.