Raised This Month: $7 Target: $400
 1% 

Forcing a player with a different groupinfo to render (AddToFullPack)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-21-2019 , 21:30   Forcing a player with a different groupinfo to render (AddToFullPack)
Reply With Quote #1

Hello

I'm trying to render a player from another groupinfo using AddToFullPack.

I'm returning 1 on this forward to force a propagation to the client but it doesn't seem to be working.

What I am doing wrong? How can I achieve this?

Code:
public plugin_init() {     register_forward(FM_AddToFullPack, "pred", 1) } /* AddToFullPack Return 1 if the entity state has been filled in for the ent and the entity will be propagated to the client, 0 otherwise · "ent_state" is the server maintained copy of the state info that is transmitted     to the client a MOD could alter values copied into state to send the "host" a     different look for a particular entity update, etc. · "e" and "edict_t_ent" are the entity that is being added to the update, if 1 is returned · "edict_t_host" is the player's edict of the player whom we are sending the update to · "player" is 1 if the ent/e is a player and 0 otherwise · "pSet" is either the PAS or PVS that we previous set up.      We can use it to ask the engine to filter the entity against the PAS or PVS.     we could also use the pas/ pvs that we set in SetupVisibility, if we wanted to.  Caching the value is valid in that case, but still only for the current frame */ public pred(ent_state,e,edict_t_ent,edict_t_host,hostflags,player,pSet) {        if(player)     {         [...]         forward_return(FMV_CELL,1);         return FMRES_OVERRIDE;     }         return FMRES_IGNORED; }

Thanks in advance.

EDIT: Forgot my return value, recompiled the plugin but it still doesn't work.
__________________

Last edited by gabuch2; 01-21-2019 at 23:14. Reason: Code edit.
gabuch2 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-22-2019 , 06:48   Re: Forcing a player with a different groupinfo to render (AddToFullPack)
Reply With Quote #2

The state probably doesn't get filled. The game code will take THIS path and not continue further down, which is most likely the issue.
You could try removing groupinfo from the player in question in the pre-hook, then set it back in the post-hook.
__________________

Last edited by klippy; 01-22-2019 at 06:50.
klippy is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-22-2019 , 07:36   Re: Forcing a player with a different groupinfo to render (AddToFullPack)
Reply With Quote #3

Return values are ignored in post forwards as far I know.
__________________








CrazY. is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-22-2019 , 13:05   Re: Forcing a player with a different groupinfo to render (AddToFullPack)
Reply With Quote #4

Quote:
Originally Posted by KliPPy View Post
The state probably doesn't get filled. The game code will take THIS path and not continue further down, which is most likely the issue.
You could try removing groupinfo from the player in question in the pre-hook, then set it back in the post-hook.
Is there no other way to force its rendering?

I can't change the groupinfo on the go since this is being used as a semiclip method from AngelScript (Sven Co-op), and I'm managing the AddToFullPack method from AMXX. (AddToFullPack is not supported by AS)

I'm not using metamod's semiclip because the latest update changed the SV_ClipToLinks method in the engine, so the metamod plugin no longer works.

Quote:
Originally Posted by CrazY. View Post
Return values are ignored in post forwards as far I know.
Makes sense, but still wouldn't work because of what was written previously. (Already tested it)
__________________

Last edited by gabuch2; 01-22-2019 at 13:11.
gabuch2 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-22-2019 , 13:36   Re: Forcing a player with a different groupinfo to render (AddToFullPack)
Reply With Quote #5

You will change it only for a single call (AddToFullPack), it won't affect any other code. Collision is not processed in AddToFullPack so it won't matter for collision. At least give it a try and see the results for yourself, it may work.
__________________

Last edited by klippy; 01-22-2019 at 13:36.
klippy is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-22-2019 , 16:14   Re: Forcing a player with a different groupinfo to render (AddToFullPack)
Reply With Quote #6

Quote:
Originally Posted by KliPPy View Post
You will change it only for a single call (AddToFullPack), it won't affect any other code. Collision is not processed in AddToFullPack so it won't matter for collision. At least give it a try and see the results for yourself, it may work.
You were right, now it renders the players, however, every time I pass through one of them I get a small "bump", cancelling my speed. Probably because I changed the groupinfo in the pre hook.

Final Code
Code:
public semiclip_pre(ent_state,e,edict_t_ent,edict_t_host,hostflags,player,pSet) {        if(player)     {         g_iGroupInfoBuffer[edict_t_ent] = pev(edict_t_ent, pev_groupinfo);         set_pev(edict_t_ent, pev_groupinfo, pev(edict_t_host, pev_groupinfo));     }         return FMRES_IGNORED; } public semiclip_post(ent_state,e,edict_t_ent,edict_t_host,hostflags,player,pSet) {        if(player)     {         if(pev(edict_t_host, pev_groundentity) == edict_t_ent)             set_es(ent_state, ES_Solid, 1);         else             set_es(ent_state, ES_Solid, 0);         set_pev(edict_t_ent, pev_groupinfo, g_iGroupInfoBuffer[edict_t_ent]);     }         return FMRES_IGNORED; }

I guess it's enough for now as a workaround, I don't know if that's fixable.

Thank you.
__________________

Last edited by gabuch2; 01-22-2019 at 16:14.
gabuch2 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-22-2019 , 17:40   Re: Forcing a player with a different groupinfo to render (AddToFullPack)
Reply With Quote #7

g_iGroupInfoBuffer doesn't have to be an array (that is probably 33 long?), it can be a single cell because no other player will get processed between pre and post hook. I don't really know how to explain it but I hope you get it.

groupinfo is completely server-side it seems (doesn't get transmitted with the entity state). The issue is probably that you enable semiclip right when players touch, so the client will predict the touch and get corrected after player's ping delay, resulting in that "jitter". Enable it at a distance, say 128 units between players' origins.
__________________

Last edited by klippy; 01-22-2019 at 17:40.
klippy 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 07:24.


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