Jump to content
  • 0
Sign in to follow this  
安赫尔

Request a Random NPC Look, Designated X Y script.

Question

I need to put some random npc in a arena map like follow

 

The NPC audience are in red line.

post-1086-0-89508300-1394966971_thumb.jpg

 

Finally looks like the image below

post-1086-0-65587200-1394966960_thumb.jpg

 

I think it maybe to use freeloop like below. This thing is currently a bit difficult for me

	freeloop(1);	set .@size, getargcount();	for(set .@i,0; .@i<.@size; set .@i,.@i+1) {

Can someone make a examples

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Can't detailedly do this at the moment, but should be enough if you make a whitelist of NPCs you want to go to the arena and use the setnpcdisplay script command.

 

Sample:

 

-	script	voidscript	-1,{end;}arena,100,100,0	duplicate(voidscript)	#spectator0	-1arena,101,100,0	duplicate(voidscript)	#spectator1	-1arena,102,100,0	duplicate(voidscript)	#spectator2	-1arena,103,100,0	duplicate(voidscript)	#spectator3	-1-	script	rotatespectators	-1,{OnInit:	setarray .safeids[0],46,47,48,49,50,51,52,53,54,55,56,57,58,59,60;	.spectators = 4;	end;OnChangeSpectators:	for (.@i = 0; .@i < .spectators; .@i++){		if (setnpcdisplay("#spectator0" + .@i, .safeids[rand(getarraysize(.safeids))])) { // Returns 1 if there are problems			debugmes "SOMETHING WENT WRONG WITH NPC "#spectator0" + .@i + " "!"; // Note it			}	}	end;}

 

Or if you think you won't be having problems with your spectator NPCs, you can simplify the latter one if you trust your setnpcdisplays will work like this:

 

-	script	rotatespectators	-1,{OnInit:	setarray .safeids[0],46,47,48,49,50,51,52,53,54,55,56,57,58,59,60;	.spectators = 4;	end;OnChangeSpectators:	for (.@i = 0; .@i < .spectators; .@i++){		setnpcdisplay("#spectator0" + .@i, .safeids[rand(getarraysize(.safeids))]);	}	end;}

 

 

You can see NPC sprite IDs at http://nn.nachtwolke.com/dev/npclist/ (beware some aren't available on a regular data folder installation).

 

It's not a complete response, but I'm sure you'll at least get the gist of it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.