Raised This Month: $ Target: $400
 0% 

fake_touch not triggering touch forwards


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mydas
Senior Member
Join Date: Mar 2005
Old 10-11-2023 , 05:27   fake_touch not triggering touch forwards
Reply With Quote #1

I'm registering a touch:
Code:
	register_touch( "*", "player", "fantastic_touch" )
Then, on keydown I'm simulating a touch from player to aimed-at entity:
Code:
if ( pev_valid( aimee ) )
	{
		fake_touch( aimee, id )	/* Simulate two entities colliding/touching. */
		draw_beam( id, aimee )
	}
But the registered touch doesn't get called. I want the fake_touch to trigger all other plugins on the server that do something when people are touching, for instance.
edit: The beam is getting drawn, so the entity is valid.
__________________
[2021] I would love to revive SHMOD.

My heroes: SLAYER, Akasha, Achilles, Robo-Ky,Justice, Potemkin, Juggernaut, Mirage, Leviathan, Tyrael, Marduk, Omega Red

Last edited by mydas; 10-11-2023 at 12:44.
mydas is offline
Send a message via Yahoo to mydas
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-11-2023 , 09:48   Re: fake_touch not triggering touch forwards
Reply With Quote #2

Make a log on the aimee entity. We don’t have the whole code so it’s hard to tell but from the code we have i guess you are just not getting any valid entity, so the function won’t get called.
__________________
Jhob94 is offline
mydas
Senior Member
Join Date: Mar 2005
Old 10-11-2023 , 12:44   Re: fake_touch not triggering touch forwards
Reply With Quote #3

Make a log? What do you mean?

Forgot to mention: The beam is drawn, so the function is getting called
__________________
[2021] I would love to revive SHMOD.

My heroes: SLAYER, Akasha, Achilles, Robo-Ky,Justice, Potemkin, Juggernaut, Mirage, Leviathan, Tyrael, Marduk, Omega Red

Last edited by mydas; 10-11-2023 at 12:50.
mydas is offline
Send a message via Yahoo to mydas
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-11-2023 , 12:58   Re: fake_touch not triggering touch forwards
Reply With Quote #4

I meant when you find the entity to log it’s classname or simply it’s id.

Well if it detects it should work. Not 100% sure if fake_touch calls other plugins touches. Did you tried executing ham_touch?
__________________
Jhob94 is offline
mydas
Senior Member
Join Date: Mar 2005
Old 10-12-2023 , 06:37   Re: fake_touch not triggering touch forwards
Reply With Quote #5

Well probably that's it, maybe fake_touch simply doesn't call other plugins touches. Waiting for confirmation/denial from anybody who knows this fact, so I stop looking lol.

Thx for ham_touch suggestion, tried it (and also dllfunc(DLLFunc_Touch, aimee, id ) ) - still doesn't call the registered touch
__________________
[2021] I would love to revive SHMOD.

My heroes: SLAYER, Akasha, Achilles, Robo-Ky,Justice, Potemkin, Juggernaut, Mirage, Leviathan, Tyrael, Marduk, Omega Red
mydas is offline
Send a message via Yahoo to mydas
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-12-2023 , 06:55   Re: fake_touch not triggering touch forwards
Reply With Quote #6

Make a print_chat on aimee’s classname just to be sure
__________________
Jhob94 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-13-2023 , 12:31   Re: fake_touch not triggering touch forwards
Reply With Quote #7

That's how to properly use register_touch...

PHP Code:
register_touch("player""*""fantastic_touch" )

public 
fantastic_touch(entother
Where the 1st argument in register_touch is the entity to be hooked touch for..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-13-2023 , 12:53   Re: fake_touch not triggering touch forwards
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
That's how to properly use register_touch...

PHP Code:
register_touch("player""*""fantastic_touch" )

public 
fantastic_touch(entother
Where the 1st argument in register_touch is the entity to be hooked touch for..
Afaik everytime there is a touch it just notifies the game and it doesn’t matter how you register it. You need 2 entities to have a touch. Every touch will be verified until your registered touch is found.
__________________
Jhob94 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 05:30.


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