Senior Member
|
09-22-2008
, 23:14
spawning a monster
|
#1
|
Hi,
I am trying to create a walkable entity that uses player models. My main problem is making the entity walk, crouch, jump, and so forth. Please help me find a solution. Also, I'm trying to HookSingleEntityOutput to get the monsters health when its shot and when it dies. So, any help on that would be great as well.
Code:
new ent=CreateEntityByName("prop_physics_multiplayer"); //func_physbox_multiplayer
TeleportEntity(ent,pos,NULL_VECTOR,NULL_VECTOR);
SetEntityModel(ent,"models/player/techknow/demon/demon.mdl");
DispatchKeyValueFloat(ent, "massScale", 250.0);
DispatchKeyValueFloat(ent, "inertiaScale", 200.0);
DispatchKeyValue(ent, "ExplodeRadius", "256");
DispatchKeyValue(ent, "ExplodeDamage", "50");
DispatchSpawn(ent);
new String:DemonName[128];
Format(DemonName, sizeof(DemonName), "witchDemon%d", client);
//framerate 1.0
//PrintToServer("m_flPoseParameter: %f", GetEntPropFloat(client, Prop_Data, "m_flPoseParameter"));
//SetEntPropFloat(ent, Prop_Data, "m_flModelWidthScale", 1.0);
//SetEntPropFloat(ent, Prop_Data, "m_flPoseParameter", 0.500000);
//SetEntProp(ent, Prop_Data, "m_bSequenceLoops", true);
//SetEntProp(ent, Prop_Data, "m_usSolidFlags", 152);
//SetEntPropEnt(ent, Prop_Data, "m_hLastAttacker", client);
//SetEntPropFloat(ent, Prop_Data, "m_flFriction", 0.6);
SetEntPropFloat(ent, Prop_Data, "m_flAnimTime", 2.0);
//SetEntProp(ent, Prop_Data, "m_MoveCollide", 0);
SetEntProp(ent, Prop_Data, "m_nSolidType", 2); //6
SetEntProp(ent, Prop_Data, "m_nSequence", 4);
SetEntProp(ent, Prop_Data, "m_takedamage", 1);
SetEntProp(ent, Prop_Data, "m_iMaxHealth", 400);
SetEntProp(ent, Prop_Data, "m_iHealth", 400);
SetEntPropFloat(ent, Prop_Data, "m_flGravity", 0.5);
SetEntProp(ent, Prop_Data, "m_CollisionGroup", 5); //5
SetEntPropEnt(ent, Prop_Data, "m_hOwnerEntity", client);
//SetEntProp(ent, Prop_Data, "m_MoveType", 4);
//SetEntityMoveType(ent, MOVETYPE_STEP);
DispatchKeyValue(ent, "targetname", DemonName);
new String:tmp[128];
Format(tmp, sizeof(tmp), "%s,Break,,0,-1", DemonName);
DispatchKeyValue(ent, "OnHealthChanged", tmp);
Format(tmp, sizeof(tmp), "%s,Kill,,0,-1", DemonName);
DispatchKeyValue(ent, "OnBreak", tmp);
AcceptEntityInput(ent, "Enable");
HookSingleEntityOutput(ent, "OnBreak", DemonBreak, true);
__________________
Last edited by Grrrrrrrrrrrrrrrrrrr; 09-22-2008 at 23:16.
|
|