Jump to content
  • 0

Force duplicated npc to use a label


nakano15

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   8
  • Joined:  01/26/15
  • Last Seen:  

Hello guys, I'm working on a npc system and for that npc, I need to make so that on init, the original npc also forces the duplicates to change their position by forcing them to run a internal label, but 3 commands does not works, doevent, donpcevent and cmdothernpc or asks to attach a player to the npc (which is impossible) or runs the script and applies for the npc that called it (Original).

 

There is another way of forcing duplicates to run that label?

Edited by nakano15
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


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

It does and it will run your loop every duplicate, only

OnInit:
	getmapxy .@map$, .@x, .@y, 1;
	unitwarp 0, .@map$, -1, -1;
	end;

is needed

Link to comment
Share on other sites


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

Every duplicate will run OnInit. Well I need a sample of your work..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   8
  • Joined:  01/26/15
  • Last Seen:  

It does? I thought not, well, here the codes.

	OnInit:
	for(.@i = 0; .@i <= 15; .@i++)
	{
		cmdothernpc "Miner Team Member#" + .@i,"locationShuffle";
	}
	locationShuffle:
	getmapxy .@map$, .@x, .@y, 1;
	unitwarp 0, .@map$, -1, -1;
	end;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   8
  • Joined:  01/26/15
  • Last Seen:  

The code is working now. Had to modify the code and turn it into this:

	locationShuffle:
	OnInit:
	unitwarp getnpcid(0, strnpcinfo(0)), "this", -1, -1;
	getmapxy .@map$, .@x, .@y, 1;
	//debugmes strnpcinfo(0) + ": " + .@map$ + " X:"+ .@x + " Y:"+ .@y;
	end;

Had to leave locationShuffle because it is called by other areas. Well, thanks for the help.

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