Raised This Month: $51 Target: $400
 12% 

NadeModes, smokegrenade stick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 08-28-2022 , 14:25   NadeModes, smokegrenade stick
Reply With Quote #1

Hello, so im trying to make smoke grenade stick to wall when its on IMPACT mode, someone can help?
I have this code right here
Im using nademodes plugin
PHP Code:
case NADE_IMPACT:
        {
            if (
is_solid(touched))
            {
                
make_explode(toucher)
                
                
entity_set_float(toucherEV_FL_nextthinkget_gametime() + 0.001)
                
                if (
NadeRace:get_grenade_race(toucher) == GRENADE_SMOKEGREN)
                {
                    
entity_set_int(toucherEV_INT_flagsentity_get_int(toucherEV_INT_flags) | FL_ONGROUND)
                }
            }
        } 
i changed the
entity_set_int(toucher, EV_INT_flags, entity_get_int(toucher, EV_INT_flags) | FL_ONGROUND)

to

entity_set_int(toucher, EV_INT_movetype, MOVETYPE_NONE)

but it doesnt seem to work, the grenade sticks to the wall, but is like rapidly moving and doesnt explode
but works great when it touches the ground

Last edited by HowToRuski; 08-28-2022 at 15:09.
HowToRuski is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 08-29-2022 , 09:19   Re: NadeModes, smokegrenade stick
Reply With Quote #2

Anyone?
HowToRuski is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 08-29-2022 , 11:26   Re: NadeModes, smokegrenade stick
Reply With Quote #3

Try to play with the sequence, not just setting the movetype to none, this is probably why it's rapidly moving and doesn't explode.
engine_const.inc -> line 71 (EV_INT_sequence)

OR if you have REAPI -> RegisterHookChain(RG_CGrenade_Explode(YOURNAD EHERE)Grenade, "CGrenade_Explode(YOURNADEHERE)Grenade_Po st", true);
you can get the origins on the first bounce and then use EngFunc_PlaybackEvent to explode it.

https://github.com/s1lentq/reapi/blo...ok_list.h#L213
__________________

Last edited by deprale; 08-29-2022 at 11:39. Reason: im dumb
deprale is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 08-29-2022 , 13:25   Re: NadeModes, smokegrenade stick
Reply With Quote #4

Quote:
Originally Posted by deprale View Post
Try to play with the sequence, not just setting the movetype to none, this is probably why it's rapidly moving and doesn't explode.
engine_const.inc -> line 71 (EV_INT_sequence)

OR if you have REAPI -> RegisterHookChain(RG_CGrenade_Explode(YOURNAD EHERE)Grenade, "CGrenade_Explode(YOURNADEHERE)Grenade_Po st", true);
you can get the origins on the first bounce and then use EngFunc_PlaybackEvent to explode it.

https://github.com/s1lentq/reapi/blo...ok_list.h#L213
Thanks for reply.

I managed to do your first method with
entity_set_int(toucher, EV_INT_movetype, MOVETYPE_NONE)
entity_set_int(toucher, EV_INT_sequence, 0)

now it doesnt move, but when it gets stuck on the wall, it doesnt explode ( im using zombie plague, so when the flare stucks on the walls, it doesnt turn on as a flare, but on ground it works perfect )

Last edited by HowToRuski; 08-29-2022 at 13:59.
HowToRuski 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 04:53.


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