AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   'find_ent_by_class' Equivalent in FakeMeta? (https://forums.alliedmods.net/showthread.php?t=24668)

Brad 02-28-2006 11:49

'find_ent_by_class' Equivalent in FakeMeta?
 
I'm trying to convert this simple line of code from something that uses the engine module to something that uses the fakemeta module. However, I'm barely familiar with fakemeta at best and thus, have little idea where to begin.

Can someone show me how I'd use fakemeta to achieve the same functionality as I get by using engine?
Code:
g_mapHasBomb = find_ent_by_class(-1, "func_bomb_target");
As you can see in the code, all I'm trying to do is find out if the current map has a bomb target in it (thus presumably a bomb as well). That's it.

VEN 02-28-2006 13:10

That works
Code:
g_mapHasBomb = engfunc(EngFunc_FindEntityByString, -1, "classname", "func_bomb_target");

Kraugh 02-28-2006 15:34

off topic, but i'm curious as to why you are using fakemeta and not engine? fakemeta has a plethora of efficiency flaws and from what i can tell every engine equivalent is better than fakemeta.

BAILOPAN 02-28-2006 15:57

Quote:

Originally Posted by Kraugh
off topic, but i'm curious as to why you are using fakemeta and not engine? fakemeta has a plethora of efficiency flaws and from what i can tell every engine equivalent is better than fakemeta.

That is untrue... please don't spread things like this without proof. If you can come to me with proof that one method is more efficient than another, I can try to correct the problem. Until then, don't spread lies. Fakemeta is a direct port of MM/engine stuff, engine is an abstraction layer.

Brad 02-28-2006 16:01

The engine module, when merely enabled, ups your CPU usage without even being told to do anything. The fakemeta module, on the other hand, will sit there and patiently wait for you to tell it to do something before it reacts, thus lower CPU usage.


All times are GMT -4. The time now is 20:18.

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