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

[HELP] Entity death gibs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-06-2016 , 14:10   [HELP] Entity death gibs
Reply With Quote #1

So i am creating an entity which can be destroyed, similar to a func_breakable
Now the question is how i can make it explode to wood gibs when it is killed?

PHP Code:
public FuncSpawn(id)
{
    new 
Float:Origin[3]
    new 
Float:Aim[3]
    
    
entity_get_vector(idEV_VEC_originOrigin)
    
    
velocity_by_aim(id128Aim)
    
    
Origin[0] += Aim[0]
    
Origin[1] += Aim[1]
    
    static 
ent;
    
ent create_entity"info_target" );
    
    
entity_set_string(entEV_SZ_classnameCLASSNAME)
    
entity_set_model(entres_model_crate)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_TOSS)
    
entity_set_int(entEV_INT_solidSOLID_BBOX)
    
entity_set_size(entFloat:{-16.0, -16.0, -16.0}, Float:{16.016.016.0})
    
entity_set_vector(entEV_VEC_originOrigin)
    
entity_set_float(entEV_FL_takedamageDAMAGE_YES)
    
entity_set_float(entEV_FL_health1000.0)
}

public 
fw_HamKilled(entattacker)
{
    static 
szClass[32]
    
entity_get_classname(ent,szClass)
    
    if(
equalszClassCLASSNAME ))
    {
        
client_print(attackerprint_chat"killed entity")
    }

__________________
Depresie is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 09-06-2016 , 15:15   Re: [HELP] Entity death gibs
Reply With Quote #2

Use TE_BREAKMODEL in HamKilled?

P.S. If you need model of wood gibs, search in valve/models.

Last edited by KiLLeR.; 09-06-2016 at 15:17.
KiLLeR. is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-06-2016 , 15:26   Re: [HELP] Entity death gibs
Reply With Quote #3

Thanks, will look up !
__________________
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-06-2016 , 15:27   Re: [HELP] Entity death gibs
Reply With Quote #4

Why you don't make it func_breakable? Then, call use on it and it will break.
__________________

Last edited by HamletEagle; 09-06-2016 at 15:27.
HamletEagle is offline
SpannerSpammer
Member
Join Date: Mar 2006
Old 09-07-2016 , 01:31   Re: [HELP] Entity death gibs
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
Why you don't make it func_breakable? Then, call use on it and it will break.
To do that, he will have to precache Five sound files (wood+debris) AND
the gib model just for one effect. Why MAKE it when you can just FAKE it.

With a Temp effect, all he needs to precache is the gib model and maybe one sound file.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-07-2016 , 06:13   Re: [HELP] Entity death gibs
Reply With Quote #6

I was thinking to make it func_breakable but i need to be able later to distinguish the difference between func_breakable and the new entity..
__________________
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-07-2016 , 06:29   Re: [HELP] Entity death gibs
Reply With Quote #7

Set a custom value in an unused field like pev_iuser1.
__________________
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-07-2016 , 09:23   Re: [HELP] Entity death gibs
Reply With Quote #8

Nah, i think i will just fake the gibs it would be easier since the plugin is going to be a little more complex

But can you tell me how do you execute use on a func_breakable ent ?
__________________
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-07-2016 , 09:43   Re: [HELP] Entity death gibs
Reply With Quote #9

DLLFunc_Use.
__________________
HamletEagle is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-07-2016 , 10:40   Re: [HELP] Entity death gibs
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
Set a custom value in an unused field like pev_iuser1.
Or a custom string in noiseX, this will be more unique.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Reply



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 18:51.


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