Jump to content
  • 0

Force duplicated npc to use a label


Question

Posted (edited)

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

4 answers to this question

Recommended Posts

Posted

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;
Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...