Jump to content
  • 0
Sign in to follow this  
latheesan

NPC Script with Functions not working - invisible/not on a map error

Question

Hi everyone,

 

I've been away from Ragnarok Online for a very long time, I have recently picked it up and I have started NPC Scripting again.

 

I am working on a daily reward script that uses function and I am getting this error: invisible/not on a map error

 

I have managed to re-produce the error with this test script:

 

// Main Script-	script	L_Test	-1,{		// When script starts	OnInit:			// Configuration		set .npc$,"[ Test NPC ] : ";	end;		// When player logins into game	OnPCLoginEvent:			dispbottom(.npc$ + callfunc(L_SayHello, strcharinfo(0)));		end;	}function	script	L_SayHello	{	set .playerName$,getarg(0);	return "Hello "+ .playerName$;}

This script structure is identical to my real script. So when I start the server and login, I get the following error in map server:

 

[Warning]: Unexpected type for argument 1. Expected string.[Debug]: Data: variable name='L_SayHello' index=0[Debug]: Function: callfunc[Debug]: Source (NPC): L_Test (invisible/not on a map)[Error]: script:callfunc: function not found! [0][Debug]: Source (NPC): L_Test (invisible/not on a map)

Any idea what this error is about?

Edited by latheesan

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

@@latheesan

 

The function needs to be in "", you also should use = instead of set. You also don't need to pass strcharinfo, you can call it in your function.

// Main Script-	script	L_Test	-1,{	// When script starts	OnInit:		// Configuration		set .npc$,"[ Test NPC ] : ";	end;		// When player logins into game	OnPCLoginEvent:		dispbottom( .npc$ + callfunc( "L_SayHello" ) );	end;}function	script	L_SayHello	{	return "Hello "+ strcharinfo( 0 );}
Edited by Winterfox

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.