Page 1 of 1

copying entities

Posted: Wed Nov 22, 2017 12:32 am
by Speed0x
is there a fast way for copying entities/tempentities? (creating multiple entities with same properties at once)
or is the normal initiation as multiple python vars via Entitiy()/Tempentity() the fastest way?

example code :

Syntax: Select all

entity_dict = {}
for i in range(1,25):
entity_dict[i] = Entitiy("prop_dynamic")

(can it be done faster? im thinking of some memory trick, although the server probably needs to initiate each object anyway..so a quick confirmation, that is isnt possible, would be enough to help.)

thanks!

Re: copying entities

Posted: Wed Nov 22, 2017 6:53 am
by Ayuto
BaseEntity is much faster than Entity, but doesn't provide all the convenience methods. TempEntity instance can be created with all the shared properties and then before sending/creating it, you set all the specific properties. That way you only need to create a few instances.