Jump to content

Recommended Posts

Posted

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);
}
}

Posted

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)
  • 3 weeks later...
Posted (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 by chokoleyt
Posted

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

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...