Workshop 25

Posted By: ambe

Workshop 25 - 02/08/10 15:21

I have some questions regarding said workshop.

can someone tell me the major downside to using "dplay_localfunction = 2;"?


Posted By: DaGr81

Re: Workshop 25 - 02/12/10 22:50

im not very good at lite-c yet. but from what i read about that specific line is that it allows the person to see the action on their "client" and it would also save the information on the client

note that im not 100% sure about this. i havnt looked into MP gameplay coding very much. but i hope this helps
Posted By: ambe

Re: Workshop 25 - 02/12/10 23:09

thank you for your reply DaGr81.
However I know what the purpose of the variable is.
I just don't know if it has a downside, since proc_local and proc_client
also are used to achieve the same "effect".
Posted By: DaGr81

Re: Workshop 25 - 02/13/10 00:22

it seems that dplay_localfunction performs proc_local and proc_client both in a large scale. proc_local and proc_client effect only one entity function where as dplay_localfunction effects all entity functions, and also proc_local and proc_client do not affect the server where as dplay_localfunction does. so i would assume (to answer your previous question) is that depending on what you want it to effect would determine which you would use. i guess its a matter of memory.
Posted By: SchokoKeks

Re: Workshop 25 - 02/13/10 13:27

That is not quite right, DaGr81.

I think (although i could be wrong) that dplay_localfunction works just like calling proc_local once in the entity function.
proc_client is not needed then, as proc_local already starts that function on all clients. also, dplay_localfunction does not affect the server, as you wrote.
and btw, you should never use proc_local more than once on one entity.

now to the downside of dplay_localfunction:

when its enabled and an entity is created with ent_create, the id (aka handle) of its function has to be transfered. Thats a bit more traffic, but its worth it if you need some code running for it on the client, as you'd have to use proc_local anyway.
But if you do quite a lot of ent_creates for entities that don't need a local function running, you'd waste some bandwith, and you should turn off dplay_localfunction and use proc_local only for those who need it instead.

I'm not 100% sure if the above is true, but its very likely. only jcl could confirm it.
© 2024 lite-C Forums