Jump to content
  • 0

help Warnings in Setunitdata - Error in finding object with given game ID 0!


fictionx

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  122
  • Reputation:   17
  • Joined:  12/10/12
  • Last Seen:  

Hello,

      i've the following warning in setunitdata:

 

Spoiler

Warning]: buildin_setunitdata: Error in finding object with given game ID 0!
[Debug]: Source (NPC): #tnm2topmob at 0011@tnm2 (0,0)
[Warning]: buildin_setunitdata: Error in finding object with given game ID 0!
[Debug]: Source (NPC): #tnm2topmob at 0011@tnm2 (0,0)

Debug]: Source (NPC): #tnm3trap at 0011@tnm3 (0,0)
[Warning]: buildin_setunitdata: Error in finding object with given game ID 0!


[Debug]: Source (NPC): #tnmskill at 0011@tnm3 (0,0)
[Warning]: buildin_getunitdata: Error in finding object with given game ID 0!
[Debug]: Source (NPC): #tnmskill at 0011@tnm3 (0,0)
[Warning]: buildin_getunitdata: Error in finding object with given game ID 0!
[Debug]: Source (NPC): #tnmskill at 0011@tnm3 (0,0)

 

 

Script:

 

1@tnm2,0,0,0	script	#tnm2topmob	CLEAR_NPC,{
OnStart:
	initnpctimer;
	'TNM_STONEMOVE = 0;
	end;
OnTimer2000:
	.@map$ = instance_mapname("1@tnm2");
	.@label$ = instance_npcname("#tnm2topmob")+"::OnStone";
	.@label2$ = instance_npcname("#tnm2topmob")+"::OnSummon";
	setarray .@x[0],192, 205, 141, 68, 90;
	setarray .@y[0],86, 161, 213, 167, 86;
	mapannounce instance_mapname("1@tnm2"),"Lucille : 5 Magic Seals will spawn on the five corners. Destroy them before they reach Satan Morroc.", 0x1, 0x00ff00, 0x190, 18, 0, 0;
	'TNM_FLAMECROSS = monster(.@map$,.@x[.@i],.@y[.@i],"",2938,1,.@label$+(.@i+1));
	setunitdata 'TNM_FLAMECROSS,29,1;
	unitskilluseid 'TNM_FLAMECROSS, 353, 1;
	donpcevent instance_npcname("#tnm2flamecross")+"::OnStart";
	for(.@i = 0; .@i < 5; ++.@i) {
		'TNM_STONE[.@i] = monster(instance_mapname("1@tnm2"),.@x[.@i],.@y[.@i],"Magic Seal",2938,1,.@label$+(.@i+1));
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2939,1,.@label2$+(.@i+1);
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2940,1,.@label2$+(.@i+1);
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2941,1,.@label2$+(.@i+1);
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
	}
	end;
OnTimer6000:
	setnpctimer 10000;
	mapannounce instance_mapname("1@tnm2"),"Lucille : Defeat Satan Morroc before he fully recovers!", 0x1, 0x00ff00, 0x190, 18, 0, 0;
	end;
OnTimer30000:
	setnpctimer 10000;
	++ 'TNM_STONEMOVE;
  .@map$ = instance_mapname("1@tnm2");
	mapannounce .@map$,"Lucille : Magic seals are moving again! #"+'TNM_STONEMOVE+".", 0x1, 0x00ff00, 0x190, 12, 0, 0;
	switch('TNM_STONEMOVE) {
		case 1:
			setarray .@x[0],186, 199, 141, 74, 94;
			setarray .@y[0],91, 163, 207, 165, 91;
			break;
		case 2:
			setarray .@x[0],178, 188, 141, 87, 99;
			setarray .@y[0],100, 160, 196, 162, 98;
			break;
		case 3:
			setarray .@x[0],159, 166, 141, 107, 114;
			setarray .@y[0],117, 152, 175, 156, 114;
			break;
		case 4:
			setarray .@x[0],147, 152, 141, 122, 125;
			setarray .@y[0],128, 146, 155, 150, 126;
			break;
		case 5:
			setarray .@x[0],140, 141, 140, 130, 131;
			setarray .@y[0],135, 143, 144, 143, 135;
			break;

	}
	for(.@i = 0; .@i < 5; ++.@i) {
		if(!'TNM_STONE[.@i])
			continue;
		.@label$ = instance_npcname("#tnm2topmob")+"::OnSummon"+(.@i+1);
		killmonster .@map$,.@label$;
		unitwarp 'TNM_STONE[.@i],.@map$,.@x[.@i],.@y[.@i];
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2939,1,.@label$;
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2940,1,.@label$;
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2941,1,.@label$;
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
	}
	if('TNM_STONEMOVE >= 5)
		donpcevent instance_npcname("#tnm2topmob")+"::OnPushBack";
	end;

OnPushBack:
  .@map$ = instance_mapname("1@tnm2");
	.@label$ = instance_npcname("#tnm2topmob")+"::OnSummon"+(.@i+1);
	sleep 2000;
	mapannounce .@map$,"Thanatos : The seals are too close to Satan Morroc. Let me help you.", 0x1, 0x00ff00, 0x190, 12, 0, 0;
	sleep 2000;
	specialeffect 894,AREA,instance_npcname("Thanatos#tnm02");
	setnpctimer 10000;
	'TNM_STONEMOVE = 0;
	setarray .@x[0],192, 205, 141, 68, 90;
	setarray .@y[0],86, 161, 213, 167, 86;
	for(.@i = 0; .@i < 5; ++.@i) {
		if(!'TNM_STONE[.@i])
			continue;
		.@label$ = instance_npcname("#tnm2topmob")+"::OnSummon"+(.@i+1);
		killmonster .@map$,.@label$;
		unitwarp 'TNM_STONE[.@i],.@map$,.@x[.@i],.@y[.@i];
		setunitdata 'TNM_STONE[.@i],2,10; //MaxHP = 10;
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2939,1,.@label$;
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2940,1,.@label$;
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
		areamonster .@map$,.@x[.@i]-2,.@y[.@i]-2, .@x[.@i]+2,.@y[.@i]+2,"--en--",2941,1,.@label$;
		setunitdata 'TNM_FLAMECROSS,9,0x400085;
	}
	end;

OnStone1:
	'TNM_STONE[0] = 0;
	killmonster instance_mapname("1@tnm2"),instance_npcname("#tnm2topmob") + "::OnSummon1";
	donpcevent instance_npcname("#tnm2topmob") + "::OnStoneKilled";
	end;
OnStone2:
	'TNM_STONE[1] = 0;
	killmonster instance_mapname("1@tnm2"),instance_npcname("#tnm2topmob") + "::OnSummon2";
	donpcevent instance_npcname("#tnm2topmob") + "::OnStoneKilled";
	end;
OnStone3:
	'TNM_STONE[2] = 0;
	killmonster instance_mapname("1@tnm2"),instance_npcname("#tnm2topmob") + "::OnSummon3";
	donpcevent instance_npcname("#tnm2topmob") + "::OnStoneKilled";
	end;
OnStone4:
	'TNM_STONE[3] = 0;
	killmonster instance_mapname("1@tnm2"),instance_npcname("#tnm2topmob") + "::OnSummon4";
	donpcevent instance_npcname("#tnm2topmob") + "::OnStoneKilled";
	end;
OnStone5:
	'TNM_STONE[4] = 0;
	killmonster instance_mapname("1@tnm2"),instance_npcname("#tnm2topmob") + "::OnSummon5";
	donpcevent instance_npcname("#tnm2topmob") + "::OnStoneKilled";
	end;
OnSummon1:
OnSummon2:
OnSummon3:
OnSummon4:
OnSummon5:
	end;

OnStoneKilled:
	.@count = 0;
	for(.@i = 0; .@i < 5; ++.@i) {
			if('TNM_STONE[.@i])
				.@count ++;
	}
	if(.@count <= 0) {
		stopnpctimer;
		mapannounce instance_mapname("1@tnm2"),"Lucille : Looks like all the Magic Seals are destroyed. Satan Morroc is rapidly losing power!!", 0x9, 0x00ff00;
		mapwarp instance_mapname("1@tnm2"),instance_mapname("1@tnm2"),139,133;
		donpcevent instance_npcname("Satan Morroc#tnm01")+"::OnStart";
		donpcevent instance_npcname("#tnm2flamecross")+"::OnEnd";
	} else {
		mapannounce instance_mapname("1@tnm2"),"Lucille : Good, keep this up! There are "+.@count+" Magic Seals left.", 0x1, 0x00ff00, 0x190, 12, 0, 0;
	}
	end;
}
1@tnm3,0,0,0	script	#tnmskill	CLEAR_NPC,{
		end;
	OnStart:
		initnpctimer;
		'TNM_SKILL = monster(instance_mapname("1@tnm3"),1,1,"",2960,1);
		setunitdata 'TNM_SKILL, 29, 1;
		unitskilluseid 'TNM_SKILL, 353, 1;
		end;

	OnTimer15000:
		initnpctimer;
		getunitdata 'BossID,.@bossdata;
		.@x = .@bossdata[6];
		.@y = .@bossdata[7];
		switch(rand(2)) {
			case 0:
				setarray .@spiralx[0], 0,  4,  0, -6, -6, 0, 9, 10,   0, -13, -15, -14, -9;
				setarray .@spiraly[0], 4, -1, -6, -3,  4, 9, 3, -5, -12,  -7,   0,   9, 16;
				unittalk 'BossID,"Ohahaha¡";
				for(.@i = 1; .@i <= getarraysize(.@spiralx); ++.@i) {
					sleep 200;
					if('TNM_SKILL)
						unitskillusepos 'TNM_SKILL,711,1,.@x+.@spiralx[.@i-1],.@y+.@spiraly[.@i-1];
				}
				break;
			case 1:
				unittalk 'BossID,"How does my Hell Flame taste?";
				for(.@i = 1; .@i <= 5; ++.@i) {
					sleep 500;
					if('TNM_SKILL)
						unitskillusepos 'TNM_SKILL,711,1,.@x+.@i*3,.@y+.@i*3;
						unitskillusepos 'TNM_SKILL,711,1,.@x-.@i*3,.@y+.@i*3;
						unitskillusepos 'TNM_SKILL,711,1,.@x-.@i*3,.@y-.@i*3;
						unitskillusepos 'TNM_SKILL,711,1,.@x+.@i*3,.@y-.@i*3;
				}
				break;
		}
		end;
		
	OnEnd:
		unitkill 'TNM_SKILL;
		stopnpctimer;
	OnInstanceInit:
		'TNM_SKILL = 0;
		end;		
}
1@tnm3,0,0,0	script	#tnm3trap	CLEAR_NPC,{
		end;
	OnStart:
		'TNM_TRAP = monster(instance_mapname("1@tnm3"),1,1,"",2960,1);
		setunitdata 'TNM_TRAP, 29, 1;
		unitskilluseid 'TNM_TRAP, 353, 1;
		for(.@i = 1; .@i <= 10; ++.@i)
			enablenpc instance_npcname("#tnm3trap"+.@i);
		end;
		
	OnEnd:
		unitkill 'TNM_TRAP;
	OnInstanceInit:
		'TNM_TRAP = 0;
		for(.@i = 1; .@i <= 10; ++.@i) {
			stopnpctimer instance_npcname("#tnm3trap"+.@i);
			disablenpc instance_npcname("#tnm3trap"+.@i);
		}
		end;
}

 

Greetings !

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

*monster     "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>};
*areamonster "<map name>",<x1>,<y1>,<x2>,<y2>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>};
...
Returned value is an array with the game ID of the spawned monster(s) depending
on the amount spawned. Array is stored in $@mobid[].

What does that mean ?

For example your synthax is wrong in

		'TNM_TRAP = monster(instance_mapname("1@tnm3"),1,1,"",2960,1);
		setunitdata 'TNM_TRAP, 29, 1;

You need to replace it by

	monster(instance_mapname("1@tnm3"),1,1,"",2960,1);
	'TNM_TRAP = $@mobid[0];
	setunitdata 'TNM_TRAP, 29, 1;

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  122
  • Reputation:   17
  • Joined:  12/10/12
  • Last Seen:  

On 03-12-2016 at 11:51 AM, Capuche said:

*monster     "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>};
*areamonster "<map name>",<x1>,<y1>,<x2>,<y2>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>};
...
Returned value is an array with the game ID of the spawned monster(s) depending
on the amount spawned. Array is stored in $@mobid[].

What does that mean ?

For example your synthax is wrong in


		'TNM_TRAP = monster(instance_mapname("1@tnm3"),1,1,"",2960,1);
		setunitdata 'TNM_TRAP, 29, 1;

You need to replace it by


	monster(instance_mapname("1@tnm3"),1,1,"",2960,1);
	'TNM_TRAP = $@mobid[0];
	setunitdata 'TNM_TRAP, 29, 1;

 

 

Thank you :D

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