Raised This Month: $ Target: $400
 0% 

Engine func issues with CS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
urban_ninja
Senior Member
Join Date: Feb 2009
Old 04-14-2014 , 18:01   Engine func issues with CS
Reply With Quote #1

I am trying to fix the rifles being able to shoot through walls exploite but the is_visible() and is_visible_origin() always return false whether both players can see each other or not. I have no issue with the function working properly in tfc. I use these 2 functions all the time in tfc. Could some one explain to me why these engine module functions have no effect in Counter Strike?

PHP Code:
public damage(victimwpnattackerFloat:dmgbit)
{
    if(!
is_visible(victimattacker))
    {
        
ExecuteHam(Ham_TakeDamageattackerwpnattackerdmgbit)
        return 
HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;

urban_ninja is offline
Ef_Deas
Member
Join Date: Aug 2012
Location: Rio de Janeiro
Old 04-14-2014 , 20:30   Re: Engine func issues with CS
Reply With Quote #2

SDK function looks pretty simple and workable,
Spoiler

but you can try something like this:
Spoiler

Or this
Spoiler

Last edited by Ef_Deas; 04-14-2014 at 21:39.
Ef_Deas is offline
Send a message via Skype™ to Ef_Deas
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 04-14-2014 , 21:30   Re: Engine func issues with CS
Reply With Quote #3

Quote:
Originally Posted by urban_ninja View Post
I am trying to fix the rifles being able to shoot through walls exploite but the is_visible() and is_visible_origin() always return false whether both players can see each other or not. I have no issue with the function working properly in tfc. I use these 2 functions all the time in tfc. Could some one explain to me why these engine module functions have no effect in Counter Strike?

PHP Code:
public damage(victimwpnattackerFloat:dmgbit)
{
    if(!
is_visible(victimattacker))
    {
        
ExecuteHam(Ham_TakeDamageattackerwpnattackerdmgbit)
        return 
HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;

What?

Try to explain what do you "think" that is_visible checks...
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
urban_ninja
Senior Member
Join Date: Feb 2009
Old 04-14-2014 , 21:47   Re: Engine func issues with CS
Reply With Quote #4

Quote:
Originally Posted by meTaLiCroSS View Post
What?

Try to explain what do you "think" that is_visible checks...
It checks if 2 entities are visible to each other. However it does not work in counter strike for some reason. I switched to using a fakemeta stock fm_is_ent_visible() in fakemeta_util.inc which does pretty much the same thing but in fakemeta and it works. It seems to be a bug with the engine module its self running with counter strike.
urban_ninja is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-15-2014 , 14:06   Re: Engine func issues with CS
Reply With Quote #5

These functions are very simple. In clear english you can translate fm_is_ent_visible() to "can the engine draw a straigt line from the attackers eyes to the middle point of the victims body without hitting anything else?".
So this will return false when someone is sticking their head up behind something as long as their belly is covered.
If the first one fails, I would suggest adding at least 2 more levels of tracelines to cover the head and the legs or feet. One at a time of course.

There are differences as well. is_visible() is from eyes to eyes. fm_is_ent_visible() is from eyes to middle(belly).
origin_sees_origin() is middle to middle unless used with offsets. ent_sees_ent() is basically the same as origin_sees_origin() but you can't use offsets.

On top of that, I think tracelines are CPU intensive. I would not run multiple traces on a 32 player server on any aim_* map every time someone shoots.
__________________

Last edited by Black Rose; 04-15-2014 at 14:24.
Black Rose is offline
urban_ninja
Senior Member
Join Date: Feb 2009
Old 04-16-2014 , 15:14   Re: Engine func issues with CS
Reply With Quote #6

I didn't ask how the is_visible(), is_visible_origin(),ect.. functions work. I asked why it does not work in counter strike through the engine module.


Quote:
On top of that, I think tracelines are CPU intensive. I would not run multiple traces on a 32 player server on any aim_* map every time someone shoots.
How CPU intensive it is depends on OS and the speed of the core HLDS is running on as HLDS can only run on 1 core at any given time. I have at least ~100s of tracelines executed on my server per frame and performance isn't effected. Its all a relative concept.

Last edited by urban_ninja; 04-16-2014 at 15:30.
urban_ninja is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 04-16-2014 , 19:56   Re: Engine func issues with CS
Reply With Quote #7

Quote:
Originally Posted by urban_ninja View Post
I didn't ask how the is_visible(), is_visible_origin(),ect.. functions work. I asked why it does not work in counter strike through the engine module.


How CPU intensive it is depends on OS and the speed of the core HLDS is running on as HLDS can only run on 1 core at any given time. I have at least ~100s of tracelines executed on my server per frame and performance isn't effected. Its all a relative concept.
They WORK lol, he's telling you the functionality of them because you may think another think of their functionality
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
urban_ninja
Senior Member
Join Date: Feb 2009
Old 04-17-2014 , 04:40   Re: Engine func issues with CS
Reply With Quote #8

Quote:
Originally Posted by meTaLiCroSS View Post
They WORK lol, he's telling you the functionality of them because you may think another think of their functionality
Not for me. I use those functions all the time when making plugins for tfc but when I use those functions in cs they return the same value unconditionally and this problem only occurs with the engine module in cs. When a wall is between both players, it turns 0 which is expected. But when there's absolutely nothing between both players, it still returns 0. This is definitely an unusual scenario im having with it in cs and im not imagining this.

I've even had some craziness with the get_user_health() function in recent months returning some absurd value in the trillions while entity_get_float(id, EV_FL_health) returns the correct value matching the hud.

Last edited by urban_ninja; 04-17-2014 at 04:43.
urban_ninja is offline
Ef_Deas
Member
Join Date: Aug 2012
Location: Rio de Janeiro
Old 04-17-2014 , 09:00   Re: Engine func issues with CS
Reply With Quote #9

Quote:
Originally Posted by urban_ninja View Post
Not for me. I use those functions all the time when making plugins for tfc but when I use those functions in cs they return the same value unconditionally and this problem only occurs with the engine module in cs. When a wall is between both players, it turns 0 which is expected. But when there's absolutely nothing between both players, it still returns 0. This is definitely an unusual scenario im having with it in cs and im not imagining this.
I gave you the SDK code, it works exactly like it says

Quote:
Originally Posted by urban_ninja View Post
I've even had some craziness with the get_user_health() function in recent months returning some absurd value in the trillions while entity_get_float(id, EV_FL_health) returns the correct value matching the hud.
Thats mostly because people try to print float value with %d or vice versa
Ef_Deas is offline
Send a message via Skype™ to Ef_Deas
urban_ninja
Senior Member
Join Date: Feb 2009
Old 04-17-2014 , 10:02   Re: Engine func issues with CS
Reply With Quote #10

Quote:
Originally Posted by Ef_Deas View Post
I gave you the SDK code, it works exactly like it says


Thats mostly because people try to print float value with %d or vice versa
The sdk code doesn't explain why its returning the same value no matter what.

As far as the get_user_health(), it was literally indexing a number in the trillions. It wasn't a print formatting mistake. If it was that, then the condition I had if(health < 100) should of returned as true anyway but it didn't because the value that got stored was much higher than the max 100. The get_user_health() turns health as an integer which %d is the proper format for that.

Last edited by urban_ninja; 04-17-2014 at 10:09.
urban_ninja is offline
Reply



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 13:09.


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