Raised This Month: $ Target: $400
 0% 

prevent bots from seeing through model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
loki_himself
Member
Join Date: Nov 2021
Old 08-17-2022 , 11:40   prevent bots from seeing through model
Reply With Quote #1

i create custom models with Building Blocks (Updated 11-24-07), after reading the code i see the relevant code snippets:

set the model
PHP Code:
engfunc(EngFunc_SetModelentmodels[box_class]); 
make the model solid
PHP Code:
set_pev(entpev_solidSOLID_BBOX); 
the model is solid and a human cannot see throught. however, bots (pod and yapb) can see through and shoot through. how can this be prevented?
loki_himself is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-19-2022 , 02:52   Re: prevent bots from seeing through model
Reply With Quote #2

I guess you would need to trick it with hooking traceline and then "modifying" the players origin in AddtoFullPack.
If you need further help, provide your full code.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
loki_himself
Member
Join Date: Nov 2021
Old 08-19-2022 , 05:55   Re: prevent bots from seeing through model
Reply With Quote #3

the code is from this https://forums.alliedmods.net/showthread.php?t=58049
loki_himself is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 08-20-2022 , 09:04   Re: prevent bots from seeing through model
Reply With Quote #4

I think modifying the YaPB code would be correct way to solve this. But when I saw the code, I know it gonna be a hard quest (the code seems messed up for me).
If u want to go this way, u should ask in its github repo to try to do this
__________________
Now working on: Side Weapons
Avatar source: https://bit.ly/3BAk19g

Last edited by kww; 08-20-2022 at 09:07.
kww is offline
loki_himself
Member
Join Date: Nov 2021
Old 08-20-2022 , 09:56   Re: prevent bots from seeing through model
Reply With Quote #5

yes i will start to modify the src. as it displays really annoying messages in the center of screen as well
loki_himself is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-23-2022 , 11:00   Re: prevent bots from seeing through model
Reply With Quote #6

It would be wise, if bots would be able to detect this automatically. But since every bot system works differently you can use the attached plugin. I have tested it with the bots and seems to work pretty fine I think. It supports blocks with transparency, and supports the blockmaker plugin from Necro. Somehow I couldn't make AddtoFullPack work with bots. So now, it checks if the bot is trying to shoot through a block and simply blocks it. The bot will still keep aiming at the players though. Eventually they will try to use a different path.

I don't know which annoying message you're talking about. If it is from the blocks plugin, make a seperate thread. It would be better considered in the request section of the forum though.
Attached Files
File Type: sma Get Plugin or Get Source (bot_dont_shoot_block.sma - 10 views - 1.8 KB)
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
loki_himself
Member
Join Date: Nov 2021
Old 08-24-2022 , 15:31   Re: prevent bots from seeing through model
Reply With Quote #7

thanks will try that. how expensive is register_forward(FM_CmdStart, "fwStart") ? lets say running 8 bots
loki_himself is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-24-2022 , 17:40   Re: prevent bots from seeing through model
Reply With Quote #8

Just go for it. Not expensive. Don't make come up with things like that.
It totally depends what kind of other plugins you're using on your server.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
loki_himself
Member
Join Date: Nov 2021
Old 08-25-2022 , 10:51   Re: prevent bots from seeing through model
Reply With Quote #9

Quote:
public fwStart(id, uc_handle, seed)
{
if(!g_isBot[id]) return FMRES_IGNORED

static iTarget, szClassname[9], iRenderamt
get_user_aiming(id, iTarget)

pev(iTarget, pev_classname, szClassname, charsmax(szClassname))

if(equal(szClassname, "bbb") || equal(szClassname, "bm_block"))
{
//iRenderamt = pev(iTarget, pev_renderamt)

//if(iRenderamt < 80) return FMRES_IGNORED

new button = get_uc(uc_handle, UC_Buttons)

if(button & IN_ATTACK || button & IN_ATTACK2)
{
set_uc(uc_handle, UC_Buttons, (button & ~IN_ATTACK) & ~IN_ATTACK2)

return FMRES_HANDLED
}
}
}
this works, but only after removing test for playerid and the pev_renderamt check

what is pev_renderamt?
loki_himself is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-26-2022 , 11:14   Re: prevent bots from seeing through model
Reply With Quote #10

You had yourself a working plugin with transparency support. But following things make me personally not help you anymore:

1) You could have searched the function of pev_renderamt
2) You ask for server performance, yet you make changes in the code and turn it into something worse with obviously not enough scripting experience. Why would remove the global classnames and "create always a new string"? So good job doing it!!

Maybe you're not going to care about my argument. But I stand with it.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:33.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode