AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   NadeModes, smokegrenade stick (https://forums.alliedmods.net/showthread.php?t=339257)

HowToRuski 08-28-2022 14:25

NadeModes, smokegrenade stick
 
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

HowToRuski 08-29-2022 09:19

Re: NadeModes, smokegrenade stick
 
Anyone?

deprale 08-29-2022 11:26

Re: NadeModes, smokegrenade stick
 
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

HowToRuski 08-29-2022 13:25

Re: NadeModes, smokegrenade stick
 
Quote:

Originally Posted by deprale (Post 2787660)
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 )


All times are GMT -4. The time now is 15:40.

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