Raised This Month: $12 Target: $400
 3% 

Solved DispatchSpawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 08-21-2017 , 16:10   DispatchSpawn
Reply With Quote #1

Someone could explain me about DispatchSpawn?

Last edited by KiLLeR.; 08-30-2017 at 14:54.
KiLLeR. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-21-2017 , 16:18   Re: DispatchSpawn
Reply With Quote #2

Calls pfnSpawn on an entity.
__________________
HamletEagle is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 08-21-2017 , 18:33   Re: DispatchSpawn
Reply With Quote #3

More detailed?! And what is the idea of it?
KiLLeR. is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-21-2017 , 19:39   Re: DispatchSpawn
Reply With Quote #4

The engine calls it for every entity when the map spawns. What pfnSpawn does is game-dependent, but it usually calls the Spawn virtual function (the same thing you can call with Ham_Spawn) on said entity, among other stuff.
klippy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-22-2017 , 03:56   Re: DispatchSpawn
Reply With Quote #5

Check in regamedll the spawn function for the entity that you want. See there what it does.
__________________

Last edited by HamletEagle; 08-22-2017 at 03:56.
HamletEagle is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 08-22-2017 , 06:41   Re: DispatchSpawn
Reply With Quote #6

DispatchSpawn spawn's an entity. Simple, no?
__________________








CrazY. is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 08-27-2017 , 15:25   Re: DispatchSpawn
Reply With Quote #7

Quote:
Originally Posted by CrazY. View Post
DispatchSpawn spawn's an entity. Simple, no?
Actually when creating entity, it's spawned without DispatchSpawn, so must I use it?!?
KiLLeR. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-27-2017 , 15:38   Re: DispatchSpawn
Reply With Quote #8

Quote:
Originally Posted by KiLLeR. View Post
Actually when creating entity, it's spawned without DispatchSpawn, so must I use it?!?
The entity will appear without DispatchSpawn, but as I told you, "Spawn" functions set some proprieties to them. For example, "Spawn" on a weaponbox entity does the following: https://github.com/s1lentq/ReGameDLL...pons.cpp#L1656
PHP Code:

    Precache
();

    
pev->movetype MOVETYPE_TOSS;
    
pev->solid SOLID_TRIGGER;

    
m_bIsBomb false;

    
UTIL_SetSize(pevg_vecZerog_vecZero);
    
SET_MODEL(ENT(pev), "models/w_weaponbox.mdl"); 
Sets movetype, solid type, size and the model. Each spawn function is different for most entities, you just have to check regamedll and see what the function does.
You can set all this stuff manually or simply call Ham_Spawn on it.
__________________
HamletEagle is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 08-30-2017 , 14:56   Re: DispatchSpawn
Reply With Quote #9

Quote:
Originally Posted by HamletEagle View Post
The entity will appear without DispatchSpawn, but as I told you, "Spawn" functions set some proprieties to them. For example, "Spawn" on a weaponbox entity does the following: https://github.com/s1lentq/ReGameDLL...pons.cpp#L1656
PHP Code:

    Precache
();

    
pev->movetype MOVETYPE_TOSS;
    
pev->solid SOLID_TRIGGER;

    
m_bIsBomb false;

    
UTIL_SetSize(pevg_vecZerog_vecZero);
    
SET_MODEL(ENT(pev), "models/w_weaponbox.mdl"); 
Sets movetype, solid type, size and the model. Each spawn function is different for most entities, you just have to check regamedll and see what the function does.
You can set all this stuff manually or simply call Ham_Spawn on it.
Ok thanks you, now I understand it better. And where (in which file) is info_target cuz i can't find it?!

EDIT: How to know whether fields are used for certain entities?! (isuer1/2/3/4, fuser1/2/3/4, etc.)

EDIT #2: Why when setting EV_ENT_owner to my ID, solid entitiy (info_target/func_breakable) become not solid for me?!?

Last edited by KiLLeR.; 08-30-2017 at 15:05.
KiLLeR. is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-30-2017 , 15:30   Re: DispatchSpawn
Reply With Quote #10

Quote:
Originally Posted by KiLLeR. View Post
Ok thanks you, now I understand it better. And where (in which file) is info_target cuz i can't find it?!
I believe info_target has no code, it's just linked to CPointEntity, which is defined in cbase.h.

Quote:
Originally Posted by KiLLeR. View Post
EDIT: How to know whether fields are used for certain entities?! (isuer1/2/3/4, fuser1/2/3/4, etc.)
Look at the code for those entities.

Quote:
Originally Posted by KiLLeR. View Post
EDIT #2: Why when setting EV_ENT_owner to my ID, solid entitiy (info_target/func_breakable) become not solid for me?!?
That's how the engine works.
klippy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:03.


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