AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Spawning entities in specific location. (https://forums.alliedmods.net/showthread.php?t=313239)

thEsp 01-01-2019 15:56

Spawning entities in specific location.
 
Hello peeps, I need help spawning entities in a specific (X Y Z) location.
for example:
Code:

entity_add(x,y,z)
So how should I do that?
Thanks in advance :)

Xalus 01-01-2019 16:36

Re: Spawning entities in specific location.
 
Quote:

set_pev(entity, pev_origin, Float:{0.0, 0.0, 0.0})
Replace 0.0 with your (hardcoded)-values.

thEsp 01-02-2019 05:30

Re: Spawning entities in specific location.
 
Quote:

Originally Posted by Xalus (Post 2632269)
Replace 0.0 with your (hardcoded)-values.

Thank you :up:.

Ghosted 01-02-2019 06:29

Re: Spawning entities in specific location.
 
for some reasons its better to use entity_set_origin and not just set variable origin to your value.

CrazY. 01-02-2019 10:29

Re: Spawning entities in specific location.
 
yes, because it calls *g_engfuncs.pfnSetOrigin (something related to game engine). [pev|EV_VEC]_origin will just update variable.

Quote:

#define SET_ORIGIN (*g_engfuncs.pfnSetOrigin)

thEsp 01-02-2019 13:51

Re: Spawning entities in specific location.
 
Quote:

Originally Posted by Ghosted (Post 2632341)
for some reasons its better to use entity_set_origin and not just set variable origin to your value.

Ahm, okay thanks for that. But can I use these (https://developer.valvesoftware.com/...st_of_entities) or only pev_* and where should I?
I'm so far away for learning fakemeta/engine/hamsandwich. :oops:


All times are GMT -4. The time now is 12:09.

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