AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   FindEntityByString (https://forums.alliedmods.net/showthread.php?t=108490)

Styles 11-05-2009 21:14

FindEntityByString
 
I have a few questions about entities in game.

I noticed the hard way, that entities id are dynamic per load and per server ect.. Other things can throw the ranges off.

Now, once the map is loaded, is it safe enough to assume that the id's wont change? ie, cache them? Or should I always be FindEntityByString evey reference to it.

ALSO is there a way to Find all entities by a specific name? Like, if theres two door1 and door2. I can find just both door's (targetname btw).

ConnorMcLeod 11-05-2009 21:30

Re: FindEntityByString
 
Indexes don't change untill the entity is killed/remove.
If those ents are map ents, you can in lot of case find them by model, model is like "*17".
If model doesn't start with '*' but "models/....mdl, try to use origin or brush origin, or whatever is usable.
shptools could be very usefull for you.

Styles 11-05-2009 21:42

Re: FindEntityByString
 
I don't understand the model part (*17).

Also, I'm not a mapper lol no clue. What are those exactly? How are they not moving // changing?

KadiR 11-06-2009 01:07

Re: FindEntityByString
 
This could help you maybe:

http://forums.alliedmods.net/showthread.php?t=103851
http://forums.alliedmods.net/showthread.php?t=103629

ConnorMcLeod 11-06-2009 04:34

Re: FindEntityByString
 
I don't see the use of kadir links lol.

For shptools : http://forums.space-headed.net/viewtopic.php?f=43&t=111

You can aim an entity and get its index, then you can use command printent < index > that will print you all that ent properties (including model).

Arkshine 11-06-2009 10:53

Re: FindEntityByString
 
Quote:

Originally Posted by styles (Post 982070)
I don't understand the model part (*17).

Also, I'm not a mapper lol no clue. What are those exactly? How are they not moving // changing?


I don't remember exactly the explanations, but when you make a map each texture will be marked with an unique number *x at the compilation; which is actually an index.

To find an entity you have severals ways. Eg ; some engine functions.

KadiR 11-06-2009 11:09

Re: FindEntityByString
 
You can see it with the BSP Viewer tool too..
I thought that only entities got a unique model index..

xPaw 11-06-2009 12:50

Re: FindEntityByString
 
Quote:

Originally Posted by Arkshine (Post 982387)
I don't remember exactly the explanations, but when you make a map each texture entity will be marked with an unique number *x at the compilation; which is actually an index.

Note: Also the model (*x) changes only after re-compiling the map ( if you're making a map lol )

Arkshine 11-06-2009 12:51

Re: FindEntityByString
 
Oops. :mrgreen:


All times are GMT -4. The time now is 17:44.

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