Jump to content
  • 0

Question

Posted

I was playing around on AnnieRuru's code here, as I want to spawn warps on a specific day and time and bind it to an atcommand in case that fails.

I'm getting this error

[Error]: npc_event: event not found [day_night_npc::Warpact]
-	script	day_night_npc	-1,{
OnInit:
	bindatcmd("summonwarps", strnpcinfo(3) +"::Warpact");
}

//OnClock1151:
//OnInit:
OnWarpact:
	sleep 1; // if you want to use different script file, then slow down the script execution
	if(gettime(DT_DAYOFMONTH)==10) { // day warp
		enablenpc "launchwarp#1";
		disablenpc "nightwarp#1";
	}
	else {
		enablenpc "nightwarp#1";
		disablenpc "launchwarp#1";
	}
	end;
}

map,90,87,0	warp	launchwarp#1	1,1,iz_int,18,26		//test

 

3 answers to this question

Recommended Posts

  • 0
Posted (edited)
47 minutes ago, Snaehild said:

[Error]: npc_event: event not found [day_night_npc::Warpact]

-	script	day_night_npc	-1,{
OnInit:
	bindatcmd("summonwarps", strnpcinfo(3) +"::Warpact"); // Youre' Calling Warpact function here instead OnWarpact
}

//OnClock1151:
//OnInit:
OnWarpact: // This is different with ::Warpact
	

map,90,87,0	warp	launchwarp#1	1,1,iz_int,18,26		//test

 

look at my Comment //

Edited by mihaamiharu
  • 0
Posted (edited)

Thanks @mihaamiharu

I still get an error by using OnWarpact

[Error]: npc_parsesrcfile: Unknown syntax in file '/warps_launch.txt', line '8'. Stopping...
 * w1=OnWarpact:
-	script	day_night_npc	-1,{
OnInit:
	bindatcmd("summonwarps", strnpcinfo(3) +"::OnWarpact");
}

//OnClock1151:
//OnInit:
OnWarpact:
	sleep 1; // if you want to use different script file, then slow down the script execution

 

Edited by Snaehild
  • 0
Posted
-	script	day_night_npc	-1,{
OnInit:
	bindatcmd("summonwarps", strnpcinfo(3) +"::OnWarpact");
	end;
	
//OnClock1151:
//OnInit:
OnWarpact:
	sleep 1; // if you want to use different script file, then slow down the script execution
	if(gettime(DT_DAYOFMONTH)==10) { // day warp
		enablenpc "launchwarp#1";
		disablenpc "nightwarp#1";
	}
	else {
		enablenpc "nightwarp#1";
		disablenpc "launchwarp#1";
	}
	end;
}

map,90,87,0	warp	launchwarp#1	1,1,iz_int,18,26		//test

your event label is wrong, and your script has extra curley bracket that ended the script, and causing errors

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

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