安赫尔 9 Posted March 16, 2014 I need to put some random npc in a arena map like follow The NPC audience are in red line. Finally looks like the image below 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 Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted March 20, 2014 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. Quote Share this post Link to post Share on other sites
I need to put some random npc in a arena map like follow
The NPC audience are in red line.
Finally looks like the image below
I think it maybe to use freeloop like below. This thing is currently a bit difficult for me
Can someone make a examples
Share this post
Link to post
Share on other sites