the reason why I'm posting this I needed something to grab path nodes to a set point with no problem
this dont work good no mater what i use it on ingame i loos fps
nodes = GetAllNodes(); goal = get_array_of_closest( self.favoriteenemy.origin, nodes, undefined, 45);
GetAllNodes works fine but get_array_of_closest dus not work good at all or getNodeArray() didnt ever get it to work for what i need so i made a diff script based off a default cod one works like a charm
can use this with path_node grabber in game
will show grabbed path nodes count and origin of the number 7 node "iPrintLn(" array 2 nodes origin " + new_nods[7].origin);" when you shoot your gun this can allso help you find bad paths if nods are not spaced out good for zombies
a good count is 23 and up if in a open space with 400 being how far you look if lower might need to look at
help if you no you got bad nodes and zombies dont do right in a spot in your map now you can check the nodes ingame as you walk
update physically see your path node layout in game shoot 1 time to play fx on all grabbed path nodes shoot 2nd time to delete fx and script model and repeat add you own nun looping fx where ??????? is level._effect["kiblast"] = loadfx( "?????????t" );
and you get fx on your path nodes they delete when you shoot 2nd time or use way point just add pick here //self.target_scan = "????????"; un comment all take fx off see_node() { self endon("disconnect"); self.nod_spot = 0; set_node_fx = 1; for (;;) { self waittill("weapon_fired"); { if (set_node_fx == 1) { self.bullets2 = []; self.new_nods = self get_desired_paths_nods(self.origin, 400, 60, 0); iPrintLn("nodes array size " + self.new_nods.size); for (i = 0; i < self.new_nods.size; i++) { if (self.nod_spot < self.new_nods.size) { self.bullets2[self.nod_spot] = Spawn("script_model", self.new_nods[self.nod_spot].origin); self.bullets2[self.nod_spot] SetModel("tag_origin"); PlayFXOnTag(level._effect["kiblast"], self.bullets2[self.nod_spot], "tag_origin"); //self.target_scan = "????????"; //self.payload2 = NewClientHudElem(self); //self.payload2.hideWhenInMenu = true; //self.payload2 setshader( self.target_scan, 40, 40 ); //self.payload2 SetTargetEnt( self.bullets2[self.nod_spot]); //self.payload2 setWayPoint( true, self.target_scan ); self.nod_spot = self.nod_spot + 1; } set_node_fx = 0; } } else if (set_node_fx == 0) { for (i = 0; i < self.new_nods.size; i++) { if (self.nod_spot.size > - 1) { self.bullets2[self.nod_spot] delete(); self.nod_spot = self.nod_spot - 1; } self.bullets2[0] delete(); set_node_fx = 1; } } wait .05; } } }
get_desired_paths_nods(A, B, C, D or E) D or E allways start with D so you dont loos fps from grabbing every path-nod out side where you look
/* ============= AllMoDs AKA KrooKlyN 8/24/2018================ ///ScriptDocBegin //get_desired_paths_nods(A, B, C, D or E) // A:origin to start from //B: distance from start origin to start looking for path_nodes determined by D or E ); //C: max size of path_nodes to return // D: return the nodes, reordered from closest to farthest aka < Example new_nods[0].origin is closer set a 0 for this // E: return the nodes, reordered from farthest to closest aka > Example new_nods[0].origin is farthest set a 1 for this ///ScriptDocEnd ========================================= */ ///////////////////path_nods only//////////////////////////////// get_desired_paths_nods(org, dis, new_max, lessthan_biggerthan) { nodes = GetAllNodes(); dist = []; index = []; max = undefined; for (i = 0; i < nodes.size; i++) { length = distancesquared(org, nodes[i].origin); if (lessthan_biggerthan == 0) { if ( dis * dis < length) continue; dist[dist.size] = length; index[index.size] = i; } if (lessthan_biggerthan == 1) { if ( dis * dis > length) continue; dist[dist.size] = length; index[index.size] = i; } } for (;;) { change = false; for (i = 0; i < dist.size - 1; i++) { if (dist[i] <= dist[i + 1]) continue; change = true; temp = dist[i]; dist[i] = dist[i + 1]; dist[i + 1] = temp; temp = index[i]; index[i] = index[i + 1]; index[i + 1] = temp; } if (!change) break; } newnodes = []; if (new_max > dist.size) max = max + new_max; max = dist.size; for (i = 0; i < new_max; i++) newnodes[i] = nodes[index[i]]; iPrintLn(" array 1 nodes origin " + newnodes[7].origin); return newnodes; }
must define everything
this one you can send any array to check and you can run something in it 2 times one getting < and then send it back in doing > will get you ring of what ever you are looking for Example 1strun = get_desired_paths_nods(A, B, 1000, D, 0); //set 0 at end 2ndrun = get_desired_paths_nods(A, 1run , 500, D, E or 1); //set 1 at end and use 1strun as array in 2nd part
/* ========================== AllMoDs AKW KrooKlyN 8/24/2018================ ///ScriptDocBegin //get_desired_paths_nods(A, B, C, D, E or f) // A:origin to start from //B array to check //C: distance from start origin to start looking for array determined by E or F); //D: max size of arrayto return // E: return the array, reordered from closest to farthest aka < Example new_nods[0].origin is closer set a 0 for this // F: return the array, reordered from farthest to closest aka > Example new_nods[0].origin is farthest set a 1 for this ///ScriptDocEnd ============= */ ////////////////any array/////////////////////////////// get_desired_paths_nods(org, array, dis, new_max, lessthan_biggerthan) { dist = []; index = []; max = undefined; for (i = 0; i < array.size; i++) { length = distancesquared(org, array[i].origin); if (lessthan_biggerthan == 0) { if ( dis * dis < length) continue; dist[dist.size] = length; index[index.size] = i; } if (lessthan_biggerthan == 1) { if ( dis * dis > length) continue; dist[dist.size] = length; index[index.size] = i; } } for (;;) { change = false; for (i = 0; i < dist.size - 1; i++) { if (dist[i] <= dist[i + 1]) continue; change = true; temp = dist[i]; dist[i] = dist[i + 1]; dist[i + 1] = temp; temp = index[i]; index[i] = index[i + 1]; index[i + 1] = temp; } if (!change) break; } newnodes = []; if (new_max > dist.size) max = max + new_max; max = dist.size; for (i = 0; i < new_max; i++) newnodes[i] = array[index[i]]; iPrintLn(" my origin " + self.origin); return newnodes; }