Jump to content
  • 0

Enable Warp on atcommand


Snaehild

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   7
  • Joined:  06/23/14
  • Last Seen:  

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

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   0
  • Joined:  07/29/19
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   7
  • Joined:  06/23/14
  • Last Seen:  

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

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

-	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

Link to comment
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.

×
×
  • Create New...