+ Reply to Thread
Results 1 to 8 of 8

Thread: Updated Target Finder: Target the other team(s)

  1. #1
    Wirererer philxyz's Avatar
    Join Date
    Mar 2007
    Location
    Northampton, England
    Posts
    372

    Default

    This code should be correct, if not then I'm sure it's close

    We need this for aliens vs humans



    Code:
    Index: lua/entities/gmod_wire_target_finder/init.lua
    ===================================================================
    --- lua/entities/gmod_wire_target_finder/init.lua****(revision 463)
    +++ lua/entities/gmod_wire_target_finder/init.lua****(working copy)
    @@ -19,12 +19,14 @@
     ****self.Outputs = WireLib.CreateSpecialOutputs( self.Entity, { "Out" }, { "ENTITY" } )
     end
     
    -function ENT:Setup(maxrange, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel, vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist )
    +function ENT:Setup(maxrange, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel, vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, notargetteam, notteamsstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist )
    ******self.MaxRange************= maxrange
     ****self.MinRange************= minrange or 1
     ****self.TargetPlayer********= players
     ****self.NoTargetOwner********= notargetowner
     ****self.NoTargetOwnersStuff = notownersstuff
    +****self.NoTargetTeam**= notargetteam
    +****self.NoTargetTeamsStuff = notteamsstuff
     ****self.TargetNPC************= npcs
     ****self.NPCName************= npcname
     ****self.TargetBeacon********= beacons
    @@ -227,11 +229,11 @@
     ********local bogeys,dists = {},{}
     ********for _,contact in pairs(ents.FindInSphere(self.Entity:GetPos(), self.MaxRange or 10)) do
     ************local class = contact:GetClass()
    -************if (not self.NoTargetOwnersStuff or (class == "player") or (contact:GetOwner() ~= self:GetPlayer() and not self:checkOwnership(contact))) and (
    +************if (not self.NoTargetOwnersStuff or not self.NoTargetTeamsStuff or (class == "player") or (contact:GetOwner() ~= self:GetPlayer() and not self:checkOwnership(contact))) and (
     ****************-- NPCs
     ****************((self.TargetNPC) and (string.find(class, "^npc_.*")) and (class ~= "npc_heli_avoidsphere") and (self:FindInValue(class,self.NPCName))) or
     ****************--Players
    -****************((self.TargetPlayer) and (class == "player") and (!self.NoTargetOwner or self:GetPlayer() != contact) and self:FindInValue(contact:GetName(),self.PlayerName,self.CaseSen) and self:FindInValue(contact:SteamID(),self.SteamName) and self:FindColor(contact) and self:CheckTheBuddyList(contact)) or
    +****************((self.TargetPlayer) and (class == "player") and (!self.NoTargetOwner or self:GetPlayer() != contact) and (!self.NoTargetTeam or self:GetPlayer():Team() != contact:Team()) and self:FindInValue(contact:GetName(),self.PlayerName,self.CaseSen) and self:FindInValue(contact:SteamID(),self.SteamName) and self:FindColor(contact) and self:CheckTheBuddyList(contact)) or
     ****************--Locators
     ****************((self.TargetBeacon) and (class == "gmod_wire_locator")) or
     ****************--RPGs
    Index: lua/weapons/gmod_tool/stools/wire_target_finder.lua
    ===================================================================
    --- lua/weapons/gmod_tool/stools/wire_target_finder.lua****(revision 463)
    +++ lua/weapons/gmod_tool/stools/wire_target_finder.lua****(working copy)
    @@ -38,6 +38,8 @@
     ****language.Add( "WireTargetFinderTool_maxtargets", "Maximum number of targets to track:" )
     ****language.Add( "WireTargetFinderTool_notowner", "Do not target owner:" )
     ****language.Add( "WireTargetFinderTool_notownersstuff", "Do not target owner's stuff:" )
    +****language.Add( "WireTargetFinderTool_notteam", "Do not target own team:" )
    +****language.Add( "WireTargetFinderTool_notteamsstuff", "Do not target own team's stuff:" )
     ****language.Add( "WireTargetFinderTool_checkbuddylist", "Check Propprotection Buddy List (EXPERIMENTAL!):" )
     ****language.Add( "WireTargetFinderTool_onbuddylist", "Target Only Buddys (EXPERIMENTAL!):" )
     ****language.Add( "WireTargetFinderTool_MaxBogeys", "Max number of bogeys (closest):" )
    @@ -79,6 +81,8 @@
     TOOL.ClientConVar[ "maxbogeys" ]****= "1"
     TOOL.ClientConVar[ "notargetowner" ]****= "0"
     TOOL.ClientConVar[ "notownersstuff" ]****= "0"
    +TOOL.ClientConVar[ "notargetteam" ] = "0"
    +TOOL.ClientConVar[ "notteamsstuff" ] = "0"
     TOOL.ClientConVar[ "entityfil" ] ********= ""
     TOOL.ClientConVar[ "checkbuddylist" ]****= "0"
     TOOL.ClientConVar[ "onbuddylist" ]****= "0"
    @@ -122,13 +126,15 @@
     ****local maxbogeys********= self:GetClientNumber("maxbogeys")
     ****local notargetowner****= (self:GetClientNumber("notargetowner") != 0)
     ****local notownersstuff****= (self:GetClientNumber("notownersstuff") != 0)
    +****local notargetteam = (self:GetClientNumber("notargetteam") != 0)
    +****local notteamsstuff = (self:GetClientNumber("notteamsstuff") != 0)
     ****local entity********= self:GetClientInfo("entityfil")
     ****local checkbuddylist = (self:GetClientNumber("checkbuddylist") != 0)
     ****local onbuddylist****= (self:GetClientNumber("onbuddylist") != 0)
     
     ****if ( trace.Entity:IsValid() && trace.Entity:GetClass() == "gmod_wire_target_finder" && trace.Entity.pl == ply ) then
     ********//trace.Entity:Setup(range, players, npcs, npcname, beacons, hoverballs, thrusters, rpgs, painttarget)
    -********trace.Entity:Setup(range, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel,**vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist)
    +********trace.Entity:Setup(range, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel,**vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, notargetteam, notteamsstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist)
     ********
     ********trace.Entity.range************= range
     ********trace.Entity.players********= players
    @@ -156,6 +162,8 @@
     ********trace.Entity.maxbogeys********= maxbogeys
     ********trace.Entity.notargetowner****= notargetowner
     ********trace.Entity.notownersstuff****= notownersstuff
    +********trace.Entity.notargetteam = notargetteam
    +********trace.Entity.notteamsstuff = notteamsstuff
     ********trace.Entity.checkbuddylist****= checkbuddylist
     ********trace.Entity.onbuddylist****= onbuddylist
     ********trace.Entity.entity************= entity
    @@ -167,7 +175,7 @@
     ****
     ****local Ang = trace.HitNormal:Angle()
     ****
    -****local wire_target_finder = MakeWireTargetFinder( ply, trace.HitPos, Ang, range, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel,**vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist )
    +****local wire_target_finder = MakeWireTargetFinder( ply, trace.HitPos, Ang, range, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel,**vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, notargetteam, notteamsstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist )
     ****
     ****local min = wire_target_finder:OBBMins()
     ****wire_target_finder:SetPos( trace.HitPos - trace.HitNormal*min.z )
    @@ -201,7 +209,7 @@
     
     if SERVER then
     ****
    -****function MakeWireTargetFinder(pl, Pos, Ang, range, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel,**vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist, Vel, aVel, frozen )
    +****function MakeWireTargetFinder(pl, Pos, Ang, range, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel,**vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, notargetteam, notteamsstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist, Vel, aVel, frozen )
     ********if (!pl:CheckLimit("wire_target_finders")) then return end
     ********
     ********local wire_target_finder = ents.Create("gmod_wire_target_finder")
    @@ -211,7 +219,7 @@
     ********wire_target_finder:Spawn()
     ********wire_target_finder:Activate()
     ********
    -********wire_target_finder:Setup(range, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel,**vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist)
    +********wire_target_finder:Setup(range, players, npcs, npcname, beacons, hoverballs, thrusters, props, propmodel,**vehicles, playername, casesen, rpgs, painttarget, minrange, maxtargets, maxbogeys, notargetowner, entity, notownersstuff, notargetteam, notteamsstuff, steamname, colorcheck, colortarget, pcolR, pcolG, pcolB, pcolA, checkbuddylist, onbuddylist)
     ********wire_target_finder:SetPlayer(pl)
     ********
     ********local ttable = {
    @@ -243,6 +251,8 @@
     ************maxtargets****= maxtargets,
     ************maxbogeys****= maxbogeys,
     ************notargetowner ****= notargetowner,
    +************notargetteam**= notargetteam,
    +************notteamsstuff = notteamsstuff,
     ************notownersstuff****= notownersstuff,
     ************checkbuddylist ****= checkbuddylist,
     ************onbuddylist********= onbuddylist,
    @@ -256,7 +266,7 @@
     ********return wire_target_finder
     ****end
     
    -****duplicator.RegisterEntityClass("gmod_wire_target_finder", MakeWireTargetFinder, "Pos", "Ang", "range", "players", "npcs", "npcname", "beacons", "hoverballs", "thrusters", "props", "propmodel", "vehicles", "playername", "casesen", "rpgs", "painttarget", "minrange", "maxtargets", "maxbogeys", "notargetowner", "entity", "notownersstuff", "steamname", "colorcheck", "colortarget", "pcolR", "pcolG", "pcolB", "pcolA", "checkbuddylist", "onbuddylist","Vel", "aVel", "frozen")
    +****duplicator.RegisterEntityClass("gmod_wire_target_finder", MakeWireTargetFinder, "Pos", "Ang", "range", "players", "npcs", "npcname", "beacons", "hoverballs", "thrusters", "props", "propmodel", "vehicles", "playername", "casesen", "rpgs", "painttarget", "minrange", "maxtargets", "maxbogeys", "notargetowner", "entity", "notownersstuff", "notargetteam", "notteamsstuff", "steamname", "colorcheck", "colortarget", "pcolR", "pcolG", "pcolB", "pcolA", "checkbuddylist", "onbuddylist","Vel", "aVel", "frozen")
     
     end
     
    @@ -341,7 +351,17 @@
     ********Label = "#WireTargetFinderTool_notownersstuff",
     ********Command = "wire_target_finder_notownersstuff"
     ****})
    -****
    +
    +****panel:AddControl("CheckBox", {
    +********Label = "#WireTargetFinderTool_notteam",
    +********Command = "wire_target_finder_notargetteam"
    +****})
    +
    +****panel:AddControl("CheckBox", {
    +********Label = "#WireTargetFinderTool_notteamsstuff",
    +********Command = "wire_target_finder_notteamsstuff"
    +****})
    +
     ****panel:AddControl("CheckBox", {
     ********Label = "#WireTargetFinderTool_npcs",
     ********Command = "wire_target_finder_npcs"
    Attached Files Attached Files

  2. #2
    Wirererer philxyz's Avatar
    Join Date
    Mar 2007
    Location
    Northampton, England
    Posts
    372

    Default


  3. #3
    Wirererer philxyz's Avatar
    Join Date
    Mar 2007
    Location
    Northampton, England
    Posts
    372

    Default

    Sorry to bump this again, but is it useful at all?

    ?

  4. #4
    Lifetime Supporter DuFace's Avatar
    Join Date
    Aug 2007
    Posts
    234

    Default

    Something like this would be useful for any team based gamemode in my opinion. As the target find doesn't support dynamic target filtering this would add a certain degree of that. No more altering the target finder every time your friends change. Must admit, I've never played Aliens vs. Humans. Might have to check that out...
    Fields of Green

  5. #5
    Wirererer philxyz's Avatar
    Join Date
    Mar 2007
    Location
    Northampton, England
    Posts
    372

    Default

    Anyone with wiremod svn access like to try this? It's a must-have when targetting other teams. Otherwise you have to just attack "anyone-that's-not-you" including your own team on your own planet.

  6. #6
    Wire Amateur Sverror's Avatar
    Join Date
    Sep 2007
    Posts
    30

    Default

    LOL!!! this is awesome! Way to skullf**k admins only!
    Im egotastic!

  7. #7
    Administrator Tad2020's Avatar
    Join Date
    Feb 2007
    Location
    California, USA
    Posts
    1,498

    Default

    Could you post the whole edited file instead of the diff?
    "Our death ray doesn't seem to be working. I'm standing right in it, and I'm not dead yet." - Jamie Hyneman
    "Yes, managing the anonymous activity of the entire Internet is a challenge. Shoving the entire universe into a mason jar for use as a personal flashlight would also be a pesky bother." - Karl, BBR

    WIREMOD WILL NOT WORK ON YOUR FACE! BUT IT DOES ON YOUR MOM :shifty:

  8. #8
    andy1976uk
    Guest andy1976uk's Avatar

    Default

    Did anything ever happen with this? Sounds like a good addition to the TF.

+ Reply to Thread

Similar Threads

  1. Is there no order to the target finder's "next target"?
    By Beer in forum Wiremod General Chat
    Replies: 0
    Last Post: 07-07-2008, 02:30 PM
  2. Target Locked @ Target Finder
    By Walas in forum Ideas & Suggestions
    Replies: 3
    Last Post: 06-21-2008, 10:11 AM
  3. Why wont target finder target props..?
    By Xtensity in forum Installation and Malfunctions Support
    Replies: 2
    Last Post: 05-08-2008, 06:01 AM
  4. The target finder doesnt target anyone for me
    By falon1000 in forum Bug Reports
    Replies: 1
    Last Post: 03-17-2008, 03:30 AM
  5. Target Finder Target Switcher
    By jjb123 in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 12-30-2007, 07:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots