Jump to content
  • 0
Sign in to follow this  
Snaehild

Enable Warp on atcommand

Question

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

 

Share this post


Link to post
Share on other sites

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

Share this post


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

Share this post


Link to post
Share on other sites
  • 0
-	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

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

Sign in to follow this  

×
×
  • Create New...

Important Information

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