Jump to content
  • 0

PVP Ladder with DOTA sound Debug Error


polong

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  32
  • Reputation:   0
  • Joined:  03/14/19
  • Last Seen:  

i use PVP ladder with DOTA sound, but i keep got debug error messages like below 

 

Quote

(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)
(11/22/2020 16:33:49) [ Error ] : buildin_setunitdata: Unit with ID '0' is not found.
(11/22/2020 16:33:49) [ Debug ] : Source (NPC): DOTAPVP (invisible/not on a map)

and I attach my script

thank you in advance for your help

newPVP.txt

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  55
  • Reputation:   4
  • Joined:  02/19/19
  • Last Seen:  

On 11/22/2020 at 5:53 PM, polong said:

i use PVP ladder with DOTA sound, but i keep got debug error messages like below 

 

and I attach my script

thank you in advance for your help

newPVP.txt 32.73 kB · 35 downloads

Any update?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

I tested the script and could not reproduce the error.

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   29
  • Joined:  06/08/23
  • Last Seen:  

if you got an error and expecting help from other try to give detail of step to reproduce the error.

iirc, this was happening if you use reloadnpcfile, the npc statue is not loaded yet, so it not set the value correctly, I usually change the place of the statue before the main script.

if there is no statue usage just end the script early no need to run the timer.

@@ -169,6 +169,10 @@ OnInit:
	if (.counttopunish <= 1) .counttopunish = 0;
	.maptriggersize = getarraysize(.maptrigger$);

+	// just end if not using any statue!
+	if (.showstatue == 0)
+		end;
+
	sleep 1;
OnTimer30000: // refresh every 30 seconds. Note the `char` table is unrealiable, player still need to perform certain task to save the character -> see 'save_settings' in conf\map-server.conf
	.@query$ = "SELECT `char`.`char_id`, `char`.`name`, `char`.`guild_id`, `char`.`class`, `char`.`sex`, `char`.`hair`, `char`.`hair_color`, `char`.`clothes_color`, `char`.`body`, `char`.`head_top`, `char`.`head_mid`, `char`.`head_bottom`, `char`.`robe`, "

move the statue if you use it to above main script. so it will be safe when using reloadnpcfile, also put safety check with unitexists script command so the console wouldn't even cry out if unit is not found.

@@ -15,6 +15,34 @@
//= add PVP Ladder statue due to popular demand
//============================================================================

+-	script	pvp_ladder_statue	FAKE_NPC,{
+	.@id = getelementofarray(getvariableofnpc(.npcgid, "DOTAPVP"), getnpcid(0));
+	mes "^996600[TOP "+ .@id +"]";
+	mes "^006699Name : "+ getelementofarray(getvariableofnpc(.statue_name$, "DOTAPVP"), .@id);
+	.@guildname$ = getelementofarray(getvariableofnpc(.statue_guild$, "DOTAPVP"), .@id);
+	mes "^00AAAAGuild : "+((.@guildname$ == "null")? "^AAAAAANone": .@guildname$);
+	mes "^00AA00Total Kills : ["+ getelementofarray(getvariableofnpc(.statue_kills, "DOTAPVP"), .@id) +"]";
+	mes "^70AC11Highest Streaks : ["+ getelementofarray(getvariableofnpc(.statue_streaks, "DOTAPVP"), .@id) +"]";
+	mes "^FF0000Deaths : <"+ getelementofarray(getvariableofnpc(.statue_deaths, "DOTAPVP"), .@id) +">";
+	close;
+OnInit:
+	.@id = strnpcinfo(2);
+	set getvariableofnpc(.statue[.@id], "DOTAPVP"), getnpcid(0);
+	set getvariableofnpc(.npcgid[getnpcid(0)], "DOTAPVP"), .@id;
+	end;
+}
+
+//brasilis,191,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#1	1_F_MARIA
+//brasilis,195,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#2	1_F_MARIA
+//brasilis,200,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#3	1_F_MARIA
+//brasilis,156,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#4	1_F_MARIA
+//brasilis,158,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#5	1_F_MARIA
+//brasilis,160,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#6	1_F_MARIA
+//brasilis,162,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#7	1_F_MARIA
+//brasilis,164,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#8	1_F_MARIA
+//brasilis,166,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#9	1_F_MARIA
+//brasilis,168,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#10	1_F_MARIA

//	add all the maps that you want this script to trigger ... all pvp and event maps perhaps ?
//	but if you already enable "all" maps, then can comment all these
guild_vs1	mapflag	loadevent
@@ -181,13 +209,17 @@ OnTimer30000: // refresh every 30 seconds. Note the `char` table is unrealiable,
	.@nb = query_sql(.@query$, .@cid, .@name$, .@guild_id, .@class, .@sex$, .@hair, .@hair_color, .@clothes_color, .@body, .@head_top, .@head_mid, .@head_bottom, .@robe, .@kills, .@streaks, .@deaths);
	if (.fix_custom_sprite) {
		for (.@i = 0; .@i < .@nb; ++.@i) {
+			if (unitexists(.statue[.@i +1] == false)
+				continue;
			setunitdata .statue[.@i +1], UNPC_HEADTOP, 0;
			setunitdata .statue[.@i +1], UNPC_HEADMIDDLE, 0;
			setunitdata .statue[.@i +1], UNPC_HEADBOTTOM, 0;
			setunitdata .statue[.@i +1], UNPC_ROBE, 0;
		}
	}
	for (.@i = 0; .@i < .@nb; ++.@i) {
+		if (unitexists(.statue[.@i +1] == false)
+			continue;
		setunitdata .statue[.@i +1], UNPC_CLASS, .@class[.@i];
		setunitdata .statue[.@i +1], UNPC_SEX, (.@sex$[.@i] == "F")? SEX_FEMALE:SEX_MALE;
		setunitdata .statue[.@i +1], UNPC_HAIRSTYLE, .@hair[.@i];
@@ -206,7 +238,11 @@ OnTimer30000: // refresh every 30 seconds. Note the `char` table is unrealiable,
		.statue_deaths[.@i +1] = .@deaths[.@i];
	}
	for (.@i = .@nb; .@i < .showstatue; ++.@i)
+	{
+		if (unitexists(.statue[.@i +1] == false)
+			continue;
		setunitdata .statue[.@i +1], UNPC_CLASS, HIDDEN_WARP_NPC;
+	}
	initnpctimer;
	end;

@@ -605,31 +641,3 @@ brasilis,209,169,5	script	PvP-StatsViewer	857,{
		}
	}
}
-
--	script	pvp_ladder_statue	FAKE_NPC,{
-	.@id = getelementofarray(getvariableofnpc(.npcgid, "DOTAPVP"), getnpcid(0));
-	mes "^996600[TOP "+ .@id +"]";
-	mes "^006699Name : "+ getelementofarray(getvariableofnpc(.statue_name$, "DOTAPVP"), .@id);
-	.@guildname$ = getelementofarray(getvariableofnpc(.statue_guild$, "DOTAPVP"), .@id);
-	mes "^00AAAAGuild : "+((.@guildname$ == "null")? "^AAAAAANone": .@guildname$);
-	mes "^00AA00Total Kills : ["+ getelementofarray(getvariableofnpc(.statue_kills, "DOTAPVP"), .@id) +"]";
-	mes "^70AC11Highest Streaks : ["+ getelementofarray(getvariableofnpc(.statue_streaks, "DOTAPVP"), .@id) +"]";
-	mes "^FF0000Deaths : <"+ getelementofarray(getvariableofnpc(.statue_deaths, "DOTAPVP"), .@id) +">";
-	close;
-OnInit:
-	.@id = strnpcinfo(2);
-	set getvariableofnpc(.statue[.@id], "DOTAPVP"), getnpcid(0);
-	set getvariableofnpc(.npcgid[getnpcid(0)], "DOTAPVP"), .@id;
-	end;
-}
-
-//brasilis,191,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#1	1_F_MARIA
-//brasilis,195,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#2	1_F_MARIA
-//brasilis,200,160,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#3	1_F_MARIA
-//brasilis,156,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#4	1_F_MARIA
-//brasilis,158,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#5	1_F_MARIA
-//brasilis,160,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#6	1_F_MARIA
-//brasilis,162,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#7	1_F_MARIA
-//brasilis,164,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#8	1_F_MARIA
-//brasilis,166,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#9	1_F_MARIA
-//brasilis,168,180,4	duplicate(pvp_ladder_statue)	pvp_ladder_statue#10	1_F_MARIA

 

Edited by Harvin
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...