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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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