fakemeta - create breakable entity ( light creature )
Hi guys( and gels )!
I've searched the site around here for answer without luck, so I am posting this here question to you all: How can I create a breakable entity? Or create an entity and add properties like being breakable, adding gib model and most important: setting material type. I am experimenting with creating simple creatures, which cannot be even called bots or ai-s. I would like to create a "light" creature, or a "tree" from the Half Life's Xen world. They would be breakable( material would be flesh ), and would break apart to alien gibs( agibs.mdl ). The code so far is this: PHP Code:
If you say "light", then it puts a light creature at aim. If you touch the creature, it hides back( ANIMATION PROBLEM AT WITHDRAW AND DEPLOY! HOW CAN I CORRECT THAT??? ). After a few seconds if left alone, the creature comes back. So how could I set the entity to breakable, set material type to flesh, and add a gib model? My researches so far led me to these answers( according to the Valve Hammer Editor's datas ): - I need to add keyvalues, such as material=3( for flesh, I think ) - To add a keyvalue, I should use something like the engfunc_setkeyvalue. - I could create a temporary entity for the gibs, like: PHP Code:
I've tried adding the code below, but it is rather useless, cause I do not know when will a collition happen, thus how long does the light need to be there... PHP Code:
|
Re: fakemeta - create breakable entity ( light creature )
use func_breakable entity.
|
Re: fakemeta - create breakable entity ( light creature )
Nice, but how do you set parameters, like material?
|
Re: fakemeta - create breakable entity ( light creature )
Use DispatchKeyvalue.
|
Re: fakemeta - create breakable entity ( light creature )
That's in the engine module. By the way, I've already tried that with a line similar to this:
DispatchKeyValue(tempid,"material","3"); //tempid is the entity id, 3 means flesh( I think ) I've also set the entity type to func_breakable,but it is simply not working. Can you show me a small, working code, which creates a breakable something? |
Re: fakemeta - create breakable entity ( light creature )
Set the health and health and explodemagnitude I guess. Don't forget to spawn the entity.
Don't forget to precache resources : precache_model( "models/fleshgibs.mdl" ); precache_sound( "debris/bustflesh1.wav" ); precache_sound( "debris/bustflesh2.wav" ); precache_sound( "debris/flesh1.wav" ); precache_sound( "debris/flesh2.wav" ); precache_sound( "debris/flesh3.wav" ); precache_sound( "debris/flesh5.wav" ); precache_sound( "debris/flesh6.wav" ); precache_sound( "debris/flesh7.wav" ); |
Re: fakemeta - create breakable entity ( light creature )
precached the above mentioned, edited the test function:
PHP Code:
So what is basicly needed for an entity? All entities need spawning?( dispatch spawn ) |
Re: fakemeta - create breakable entity ( light creature )
Nothing changed ? You mean when you fire you seen nothing ? and what about "explodemagnitude", set a value too.
|
Re: fakemeta - create breakable entity ( light creature )
I see the entity, I can walk through it... Nothings working, gonna expreriment with this. Do I really need to spawn it?
|
Re: fakemeta - create breakable entity ( light creature )
Fastly redone an old code, it should work when you shoot.
Use /test in game. PHP Code:
|
| All times are GMT -4. The time now is 07:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.