Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RobbinsonBlock

Pages: 1 [2]
16
Modification Help / Re: Making a Hole Bot only target specific teams
« on: June 02, 2021, 09:40:33 PM »
In case anyone else ever needs to do this, I found a way how.
Just set the bot's hType (team) to Neutral, then add the following code to the bot's loop:
Code: [Select]
function ExampleHoleBot::onBotLoop(%this, %obj)
{
    //hReturnCloseBlockhead code, with a couple of tweaks.
    %type = $TypeMasks::PlayerObjectType;
    %pos = %obj.getPosition();
    %scale = getWord(%obj.getScale(),0);
    %radius = brickToRadius( %obj.hSearchRadius )*%scale;

    initContainerRadiusSearch(%pos,%radius,%type);
    while((%target = containerSearchNext()) != 0)
    {
        %target = %target.getID();

// take into consideration LOS
if( %target != %obj && !%target.isCloaked && hLOSCheck( %obj, %target ) )
{
            if(%target.hType $= "TeamToAttack") //Check the target's team to make sure it's the specific team that needs to be attacked. Not put into the above line for readability.
            {
               // remember to check FOV before continuing
       if( %obj.hSearchFOV )
       {
           if( %obj.hFOVCheck( %target ) )
                   {
                        %obj.hFollowPlayer( %target, 1, 0 ); //Makes the bot attack the target if it's team matches.
                   }
        }
            }
        }
        else
        {
            if(%target.hType $= "TeamToAttack")
            {
                %obj.hFollowPlayer( %target, 1, 0 );
            }
        }
    }
}
Thanks to both of you for the help.

17
Modification Help / Re: Making a Hole Bot only target specific teams
« on: June 01, 2021, 11:25:32 PM »
From what I read, you can handle this perfectly with setTeam.
If you just change the bot's team, it will attack everyone that is not on it's team. What I'm trying to achieve is a bot that will target and attack people on a specific team if it sees them, but is neutral to everyone that is NOT on that team.

18
Modification Help / Re: Making a Hole Bot only target specific teams
« on: June 01, 2021, 10:40:28 PM »
Idk why the hell you'd dig through the code when it's a simple event function that exists already for bots, it's called setTeam.
Read carefully.

19
Modification Help / Making a Hole Bot only target specific teams
« on: June 01, 2021, 08:38:06 PM »
I'm trying to make a Cop bot that will attack people on a specific criminal team when he sees them, but is otherwise neutral. I've dug through the Bot_Hole code but still can't figure out how to do this. Does anyone know how?

20
Add-Ons / Re: Event - doTeleport v2
« on: November 27, 2019, 11:53:14 PM »
Thank you, this was very much needed.

Pages: 1 [2]