AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D/L4D2] Grenade Throwing Bots (https://forums.alliedmods.net/showthread.php?t=296150)

cravenge 04-13-2017 12:17

[L4D/L4D2] Grenade Throwing Bots
 
3 Attachment(s)
Wanna make the bots more useful? Do you want to watch them throw grenades like you wanted to? Did you expect them to...... Naaahh, you already get the point.

No convars, commands, or anything unnecessary. Just simple drag and drop.

Bugs:


Notes:


Changelog:

PepeZukas 04-14-2017 22:14

Re: [L4D/L4D2] Grenade Throwing Bots
 
1 Attachment(s)
Can bots get the throwaways by himself? Does not work here...


Attachment 162147

SourceMod (v1.8.0.5981)

Left 4 Downtown 2 (v0.5.4.2)

L4DToolz (v1.0.09r1)

cravenge 04-16-2017 08:37

Re: [L4D/L4D2] Grenade Throwing Bots
 
Update 1.1:

- Made two different version for both games to prevent any harm.
- Had some tweaks to prevent them from being stucked as the chosen thrower and some bug fixes.
- Added a note for the needed extension.

PepeZukas 04-16-2017 11:17

Re: [L4D/L4D2] Grenade Throwing Bots
 
I am using the version of L4Downtown2 that you specified, and the bots can not catch the throws, and this error appears in the console.

Code:

L 04/16/2017 - 12:05:12: [SM] Exception reported: Entity 1 (1) is invalid
L 04/16/2017 - 12:05:12: [SM] Blaming: grenade_throwing_bots-l4d2.smx
L 04/16/2017 - 12:05:12: [SM] Call stack trace:
L 04/16/2017 - 12:05:12: [SM]  [0] GetEntPropString
L 04/16/2017 - 12:05:12: [SM]  [1] Line 748, C:\hcservers\L4D2 2.1.4.6\HMCoop\Normal\left4dead2\addons\sourcemod\scripting\include\entity.inc::GetEntityClassname
L 04/16/2017 - 12:05:12: [SM]  [2] Line 101, grenade_throwing_bots-l4d2.sp::OnEntityDestroyed


cravenge 04-17-2017 02:16

Re: [L4D/L4D2] Grenade Throwing Bots
 
Update 1.2 (L4D2): Replaced clumsy checking with the appropriate one. Wew, I code plugins uglier when I'm drunk.

Lux 04-18-2017 05:51

Re: [L4D/L4D2] Grenade Throwing Bots
 
I suggest using my IsSurvivorThirdPerson()
because that will catch most things that would stop you from throwing anything.

Here i modded it abit so you could use it here, i'm not 100% sure.

Code:


static
bool:IsSurvivorThirdPerson(iClient)
{
    if(GetEntPropEnt(iClient, Prop_Send, "m_isIncapacitated") > 0)
        return true;
    if(GetEntPropEnt(iClient, Prop_Send, "m_pummelAttacker") > 0)
        return true;
    if(GetEntPropEnt(iClient, Prop_Send, "m_carryAttacker") > 0)
        return true;
    if(GetEntPropEnt(iClient, Prop_Send, "m_pounceAttacker") > 0)
        return true;
    if(GetEntPropEnt(iClient, Prop_Send, "m_jockeyAttacker") > 0)
        return true;
    if(GetEntProp(iClient, Prop_Send, "m_isHangingFromLedge") > 0)
        return true;
    if(GetEntPropEnt(iClient, Prop_Send, "m_reviveTarget") > 0)
        return true; 
    if(GetEntPropFloat(iClient, Prop_Send, "m_staggerTimer", 1) > -1.0)
        return true;
    switch(GetEntProp(iClient, Prop_Send, "m_iCurrentUseAction"))
    {
        case 1:
        {
            static iTarget;
            iTarget = GetEntPropEnt(iClient, Prop_Send, "m_useActionTarget");
           
            if(iTarget == GetEntPropEnt(iClient, Prop_Send, "m_useActionOwner"))
                return true;
            else if(iTarget != iClient)
                return true;
        }
        case 4, 6, 7, 8, 9, 10:
            return true;
    }
   
    static String:sModel[31];
    GetEntPropString(iClient, Prop_Data, "m_ModelName", sModel, sizeof(sModel));
   
    switch(sModel[29])
    {
        case 'b'://nick
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
                case 626, 625, 624, 623, 622, 621, 661, 662, 664, 665, 666, 667, 668, 670, 671, 672, 673, 674, 620, 680:
                    return true;
            }
        }
        case 'd'://rochelle
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
                case 674, 678, 679, 630, 631, 632, 633, 634, 668, 677, 681, 680, 676, 675, 673, 672, 671, 670, 687, 629:
                    return true;
            }
        }
        case 'c'://coach
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
                case 656, 622, 623, 624, 625, 626, 663, 662, 661, 660, 659, 658, 657, 654, 653, 652, 651, 621, 620, 669:
                    return true;
            }
        }
        case 'h'://ellis
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
                case 625, 675, 626, 627, 628, 629, 630, 631, 678, 677, 676, 575, 674, 673, 672, 671, 670, 669, 668, 667, 666, 665, 684:
                    return true;
            }
        }
        case 'v'://bill
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
                case 528, 759, 763, 764, 529, 530, 531, 532, 533, 534, 753, 676, 675, 761, 758, 757, 756, 755, 754, 527, 772, 762:
                    return true;
            }
        }
        case 'n'://zoey
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
                case 537, 819, 823, 824, 538, 539, 540, 541, 542, 543, 813, 828, 825, 822, 821, 820, 818, 817, 816, 815, 814, 536, 809:
                    return true;
            }
        }
        case 'e'://francis
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
                case 532, 533, 534, 535, 536, 537, 769, 768, 767, 766, 765, 764, 763, 762, 761, 760, 759, 758, 757, 756, 531, 530, 775:
                    return true;
            }
        }
        case 'a'://louis
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
                case 529, 530, 531, 532, 533, 534, 766, 765, 764, 763, 762, 761, 760, 759, 758, 757, 756, 755, 754, 753, 527, 772, 528:
                    return true;
            }
        }
        case 'w'://adawong
        {
            switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
            {
            case 674, 678, 679, 630, 631, 632, 633, 634, 668, 677, 681, 680, 676, 675, 673, 672, 671, 670, 687, 629:
                    return true;
            }
        }
    }
   
    return false;
}

Also this has a check you missed
if(GetEntPropEnt(iClient, Prop_Send, "m_carryAttacker") > 0)
return true;

is missing from your IsInShape()
bool.

Be sure to convert to new syntax if you dislike my old syntax code.

enjoy
:attack:

EXTRA:

GetEntPropEnt(client, Prop_Send, "m_tongueOwner") > 0

I don't use this because you can still throw stuff while is
m_tongueOwner > 0
This will report back greater than 0 but you can still throw stuff, shoot and melee in the first second of being pulled, that is why i used sequences instead.

and

switch(GetEntProp(iClient, Prop_Send, "m_iCurrentUseAction"))

can be used for bot plugins Example "my bots use upgrade packs and other stuff", that would interfere with the bot plugins I use,
it's just a suggestion for compatibility with other plugins and more friendly to bots that are healing team mates

cravenge 04-19-2017 08:46

Re: [L4D/L4D2] Grenade Throwing Bots
 
Quote:

Originally Posted by Lux (Post 2513184)
[...]

Thanks Lux, I'll keep them for future updates.

Hmm, there seems to be a problem with it on L4D1 but none on L4D2 as it works flawlessly. That doesn't prevent FF though, I need to check if the area around the target to be thrown is safe from other survivors.

Lux 04-19-2017 10:34

Re: [L4D/L4D2] Grenade Throwing Bots
 
Quote:

Originally Posted by cravenge (Post 2513503)
Thanks Ludastar, I'll keep them for future updates.

Hmm, there seems to be a problem with it on L4D1 but none on L4D2 as it works flawlessly. That doesn't prevent FF though, I need to check if the area around the target to be thrown is safe from other survivors.

Bots don't damage team mates.
L4D block damage that would of damage you when being shot, i would suggest doing the same thing with the pipebomb however, i'm my opinion for molotov i would block the damage from the fire for a few secs then start damaging survivors who are in it, should give people with even the slowest reaction time to move out of it.

cravenge 04-19-2017 11:37

Re: [L4D/L4D2] Grenade Throwing Bots
 
Quote:

Originally Posted by Lux (Post 2513535)
[...]

That's actually a pretty good idea. Thanks again.

Edison1318 04-25-2017 02:49

Re: [L4D/L4D2] Grenade Throwing Bots
 
I really appreciated you improve the bots throwing grenade plugin.


All times are GMT -4. The time now is 20:31.

Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.