public void AiPlayerMoveToNode(coAIPlayer npc, uint index) { npc["currentNode"] = index.AsString(); ((coSimSet)npc["path"]).getObject(index); coMarker node = ((coSimSet)npc["path"]).getObject(index); if (npc.getMoveDestination() != node.getTransform().MPosition) { npc.setMoveDestination(node.getTransform().MPosition, false); } }
public void DemoPlayerOnMoveStuck(coPlayerData datablock, coAIPlayer npc) { coSimSet path = npc["path"]; uint targetnode = datablock["targetNode"].AsUint(); coMarker node = path.getObject(targetnode); TransformF t = node.getTransform(); t.MPosition.z += r.Next(10, 100); t.MPosition.x += r.Next(10, 30); t.MPosition.y += r.Next(10, 30); npc.setTransform(t); }
public coAIPlayer AiPlayerSpawnOnPath(string ainame, coSimSet path) { if (!console.isObject(path)) { return(null); } coMarker node = path.getObject((uint)r.Next(0, path.getCount() - 1)); TransformF transform = node.getTransform(); return(AiPlayerSpawn(ainame, transform)); }